Commit Graph

222202 Commits

Author SHA1 Message Date
Matthias Krüger
d6468916c0
Rollup merge of #110450 - GuillaumeGomez:fix-nested-items-on-private-doc, r=notriddle,jyn514
rustdoc: Fix invalid handling of nested items with `--document-private-items`

Fixes #110422.

The problem is that only impl block and re-exported `macro_rules!` items are "visible" as nested items. This PR adds the missing checks to handle this correctly.

cc `@compiler-errors`
r? `@notriddle`
2023-04-18 06:44:47 +02:00
Matthias Krüger
1e3a38438a
Rollup merge of #110442 - ferrocene:pa-build-metrics-dry-run, r=ozkanonur
Avoid including dry run steps in the build metrics

Including steps executed during the dry run will result in a duplication of all the steps in the build metrics, which just adds noise.
2023-04-18 06:44:46 +02:00
Matthias Krüger
41ae7fcf9b
Rollup merge of #110409 - Nilstrieb:some-manual-javascript-object-notationing, r=fee1-dead
Don't use `serde_json` to serialize a simple JSON object

This avoids `rustc_data_structures` depending on `serde_json` which allows it to be compiled much earlier, unlocking most of rustc.

This used to not matter, but after #110407 we're not blocked on fluent anymore, which means that it's now a blocking edge.
![image](https://user-images.githubusercontent.com/48135649/232313178-e0150420-3020-4eb6-98d3-fe5294a8f947.png)

This saves a few more seconds.

cc ````@Zoxc```` who added it recently
2023-04-18 06:44:46 +02:00
Matthias Krüger
afea84f99c
Rollup merge of #110348 - GuillaumeGomez:disambiguators-suffixes-rustdoc-book, r=Manishearth
Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book

This information is otherwise only provided in case an error occurs, which isn't great.

r? ```@notriddle```
2023-04-18 06:44:45 +02:00
Matthias Krüger
06d403d670
Rollup merge of #109981 - duckymirror:issue-107094, r=albertlarsan68
Set commit information environment variables when building tools

This fixes #107094.
~I'm trying to add a regression test for this issue.~
**Update**: I've added a test and a new test header `needs-git-hash` which makes sure it doesn't run when commit hashes are ignored (`bootstrap`'s `ignore-git` option).
2023-04-18 06:44:45 +02:00
bors
e279f902f3 Auto merge of #110403 - klensy:bolt-deprecate, r=albertlarsan68,Kobzol
bolt: remove deprecated option value for split-functions

Noticed warning at https://github.com/rust-lang-ci/rust/actions/runs/4711883459/jobs/8356538964#step:26:40828, option value was removed at 96f6ec5090.

bolt only running on latest supported llvm (yes?), so it's safe to apply this patch.
cc `@Kobzol`
2023-04-18 01:00:55 +00:00
bors
7908a1d654 Auto merge of #110243 - WaffleLapkin:bless_tagged_pointers🙏, r=Nilstrieb
Tagged pointers, now with strict provenance!

This is a big refactor of tagged pointers in rustc, with three main goals:
1. Porting the code to the strict provenance
2. Cleanup the code
3. Document the code (and safety invariants) better

This PR has grown quite a bit (almost a complete rewrite at this point...), so I'm not sure what's the best way to review this, but reviewing commit-by-commit should be fine.

r? `@Nilstrieb`
2023-04-17 21:50:13 +00:00
bors
56e28e904d Auto merge of #110343 - saethlin:encode-initmask, r=lqd
Bypass the varint path when encoding InitMask

The data in a `InitMask` is stored as `u64` but it is a large bitmask (not numbers) so varint encoding doesn't make sense.
2023-04-17 19:31:45 +00:00
Guillaume Gomez
c456e15855 Add regression tests for #110422 2023-04-17 20:27:34 +02:00
Erik Hofmayer
0a763c92f2 Make commit-date pattern more specific in test for issue 107094 2023-04-17 18:53:52 +02:00
bors
31656e7295 Auto merge of #110458 - matthiaskrgr:rollup-1xcxmgc, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104055 (Migrate diagnostics in `rustc_borrowck`)
 - #110257 (fix false positives for `unused_parens` around unary and binary operations)
 - #110313 (allow `repr(align = x)` on inherent methods)
 - #110337 (Correct default value for default-linker-libraries)
 - #110386 (Clean up traversal macros)
 - #110394 (Various minor Idx-related tweaks)
 - #110425 (Encode def span for `ConstParam`)
 - #110434 (Check freeze with right param-env in `deduced_param_attrs`)
 - #110455 (tests: adapt for LLVM change 5b386b864c7619897c51a1da97d78f1cf6f3eff6)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-17 16:39:01 +00:00
Matthias Krüger
c81e8b8e18
Rollup merge of #110455 - durin42:tls-D148269-fix, r=nikic
tests: adapt for LLVM change 5b386b864c7619897c51a1da97d78f1cf6f3eff6

The above-mentioned change modified the output of thread-local.rs by changing some variable names. Rather than assume things get put in %0, we capture the variable so the test passes in both the old and new version.
2023-04-17 18:13:37 +02:00
Matthias Krüger
a76b157624
Rollup merge of #110434 - compiler-errors:issue-110171, r=oli-obk
Check freeze with right param-env in `deduced_param_attrs`

We're checking if a trait (`Freeze`) holds in a polymorphic function, but not using that function's own (reveal-all) param-env. This causes us to try to eagerly normalize a specializable projection type that has no default value, which causes an ICE.

Fixes #110171
2023-04-17 18:13:36 +02:00
Matthias Krüger
d01c62bcef
Rollup merge of #110425 - compiler-errors:def-span-for-ct-param, r=petrochenkov
Encode def span for `ConstParam`

Fixes #110206

r? ``@petrochenkov``
2023-04-17 18:13:36 +02:00
Matthias Krüger
0790996a07
Rollup merge of #110394 - scottmcm:less-idx-new, r=WaffleLapkin
Various minor Idx-related tweaks

Nothing particularly exciting here, but a couple of things I noticed as I was looking for more index conversions to simplify.

cc https://github.com/rust-lang/compiler-team/issues/606
r? `@WaffleLapkin`
2023-04-17 18:13:35 +02:00
Matthias Krüger
a6c1fa5056
Rollup merge of #110386 - nnethercote:clean-up-traversal-macros, r=lcnr
Clean up traversal macros

The declarative macros relating to type folding and visiting can be simplified.

r? ``@lcnr``
2023-04-17 18:13:35 +02:00
Matthias Krüger
a785328630
Rollup merge of #110337 - iterion:patch-1, r=jyn514
Correct default value for default-linker-libraries

This setting is false by default according to rustc code here: https://github.com/rust-lang/rust/blob/master/compiler/rustc_session/src/options.rs#L1236

I tested on a project and confirmed the behavior described. First, with no value, the `-nodefaultlibs` linker flag is present. Setting this to false has no effect, as well. The linker flag still appears. Setting it to true removes the linker flag as expected.
2023-04-17 18:13:34 +02:00
Matthias Krüger
eb0524615c
Rollup merge of #110313 - fee1-dead-contrib:repr_align_method, r=WaffleLapkin
allow `repr(align = x)` on inherent methods

Discussion: https://github.com/rust-lang/rust/issues/82232#issuecomment-905929314
2023-04-17 18:13:34 +02:00
Matthias Krüger
06d12f668e
Rollup merge of #110257 - lukas-code:why-would-anyone-write-code-like-that-anyway, r=oli-obk
fix false positives for `unused_parens` around unary and binary operations

fix https://github.com/rust-lang/rust/issues/110251
2023-04-17 18:13:33 +02:00
Matthias Krüger
91fe117418
Rollup merge of #104055 - AndyJado:bck_errors, r=davidtwco
Migrate diagnostics in `rustc_borrowck`

sorry for making a new PR, [#103559](https://github.com/rust-lang/rust/pull/103559) and [#103960](https://github.com/rust-lang/rust/pull/103960).

I am crawling, joyfully.
2023-04-17 18:13:33 +02:00
Augie Fackler
bef3502dba tests: adapt for LLVM change 5b386b864c7619897c51a1da97d78f1cf6f3eff6
The above-mentioned change modified the output of thread-local.rs by
changing some variable names. Rather than assume things get put in %0,
we capture the variable so the test passes in both the old and new
version.
2023-04-17 10:53:18 -04:00
Ben Kimock
69279c0584 Bypass the varint path when encoding InitMask 2023-04-17 09:44:43 -04:00
Deadbeef
84de04155c add test for invalid places of repr align 2023-04-17 12:42:02 +00:00
Guillaume Gomez
c3c9f8f5f8 Fix invalid handling of nested items with --document-private-items 2023-04-17 14:34:50 +02:00
bors
e49122fb1c Auto merge of #110367 - saethlin:no-truncations, r=oli-obk
Remove some suspicious cast truncations

These truncations were added a long time ago, and as best I can tell without a perf justification. And with rust-lang/rust#110410 it has become perf-neutral to not truncate anymore. We worked hard for all these bits, let's use them.
2023-04-17 09:38:31 +00:00
Guillaume Gomez
f91d02b153 Remove unused RustdocVisitor::visit_item_inner return type 2023-04-17 11:13:29 +02:00
Guillaume Gomez
1531c95c5d Add code comment to remind contributors to update rustdoc book if they update the disambiguators list 2023-04-17 11:09:24 +02:00
Guillaume Gomez
a091fd25ca Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book 2023-04-17 11:09:24 +02:00
Pietro Albini
4cd0e00655
avoid including dry run steps in the build metrics
Including steps executed during the dry run will result in a duplication
of all the steps in the build metrics, which just adds noise.
2023-04-17 09:42:45 +02:00
bors
bdb32bd4bb Auto merge of #110440 - matthiaskrgr:rollup-eit19vi, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #110038 (Erase regions when confirming transmutability candidate)
 - #110341 (rustdoc: stop passing a title to `replaceState` second argument)
 - #110388 (Add a message for if an overflow occurs in `core::intrinsics::is_nonoverlapping`.)
 - #110404 (fix clippy::toplevel_ref_arg and ::manual_map)
 - #110421 (Spelling librustdoc)
 - #110423 (Spelling srcdoc)
 - #110433 (Windows: map a few more error codes to ErrorKind)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-17 07:25:01 +00:00
Matthias Krüger
35e63890bd
Rollup merge of #110433 - ChrisDenton:notfound, r=thomcc
Windows: map a few more error codes to ErrorKind

NotFound errors:

* `ERROR_INVALID_DRIVE`: The system cannot find the drive specified
* `ERROR_BAD_NETPATH`: The network path was not found
* `ERROR_BAD_NET_NAME`: The network name cannot be found.

InvalidFilename:

* `ERROR_BAD_PATHNAME`: The specified path is invalid.

Source: [System Error Codes (0-499)](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)
2023-04-17 08:09:42 +02:00
Matthias Krüger
0a2c0eca3f
Rollup merge of #110423 - jsoref:spelling-srcdoc, r=Nilstrieb
Spelling srcdoc
2023-04-17 08:09:41 +02:00
Matthias Krüger
902b419b21
Rollup merge of #110421 - jsoref:spelling-librustdoc, r=notriddle
Spelling librustdoc

This is split from https://github.com/rust-lang/rust/pull/110392

There's one change to src/tools/rustdoc-gui/tester.js which feels like a reasonable thing to piggy-back here.
2023-04-17 08:09:41 +02:00
Matthias Krüger
1795bf8222
Rollup merge of #110404 - matthiaskrgr:mapmap, r=Nilstrieb
fix clippy::toplevel_ref_arg and ::manual_map

r? ``@Nilstrieb``
2023-04-17 08:09:40 +02:00
Matthias Krüger
6e9a52cdc0
Rollup merge of #110388 - JohnBobbo96:remove-intrinsic-unwrap, r=the8472
Add a message for if an overflow occurs in `core::intrinsics::is_nonoverlapping`.
2023-04-17 08:09:40 +02:00
Matthias Krüger
ee9b804826
Rollup merge of #110341 - notriddle:notriddle/main-js-replacestate, r=GuillaumeGomez
rustdoc: stop passing a title to `replaceState` second argument

As described on [MDN's replaceState page], this parameter is not currently used, and the empty string is "safe against future changes to the method."

[MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2023-04-17 08:09:39 +02:00
Matthias Krüger
f5222cdbd3
Rollup merge of #110038 - compiler-errors:infer-regions-in-transmutability, r=lcnr
Erase regions when confirming transmutability candidate

Fixes an ICE where we call `layout_of` on a type with infer regions.
2023-04-17 08:09:39 +02:00
bors
53ac4f8e2f Auto merge of #109588 - Nilstrieb:dropless-expr, r=compiler-errors
Alloc `hir::Lit` in an arena to remove the destructor from `Expr`

This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena.
2023-04-17 05:12:12 +00:00
Michael Goulet
1ee189cde5 Encode def span for ConstParam 2023-04-17 02:57:23 +00:00
bors
5546cb64f6 Auto merge of #109247 - saethlin:inline-without-inline, r=oli-obk
Permit MIR inlining without #[inline]

I noticed that there are at least a handful of portable-simd functions that have no `#[inline]` but compile to an assign + return.

I locally benchmarked inlining thresholds between 0 and 50 in increments of 5, and 50 seems to be the best. Interesting. That didn't include check builds though, ~maybe perf will have something to say about that~.

Perf has little useful to say about this. We generally regress all the check builds, as best as I can tell, due to a number of small codegen changes in a particular hot function in the compiler. Probably this is because we've nudged the inlining outcomes all over, and uses of `#[inline(always)]`/`#[inline(never)]` might need to be adjusted.
2023-04-17 02:36:38 +00:00
Josh Soref
bb2f23c34f Spelling librustdoc
* associated
* collected
* correspondence
* inlining
* into
* javascript
* multiline
* variadic

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-16 21:44:12 -04:00
bors
23eb90ffa7 Auto merge of #109061 - saethlin:leak-backtraces, r=oli-obk
Add a backtrace to Allocation, display it in leak reports

This addresses https://github.com/rust-lang/miri/issues/2813

Information like this from diagnostics is indispensable for diagnosing problems that are difficult to reproduce such as https://github.com/rust-lang/miri-test-libstd/actions/runs/4395316008/jobs/7697019211#step:4:770 (which has not been reproduced or diagnosed).
2023-04-17 00:22:28 +00:00
Ben Kimock
84facac97a Remove some unnecessary hash truncations 2023-04-16 20:05:02 -04:00
Michael Goulet
e28e19034f Check freeze with right param-env 2023-04-16 23:09:57 +00:00
Chris Denton
db8dfbdb75
Windows: map a few more error codes to ErrorKind
NotFound errors:

* `ERROR_INVALID_DRIVE`: The system cannot find the drive specified
* `ERROR_BAD_NETPATH`: The network path was not found
* `ERROR_BAD_NET_NAME`: The network name cannot be found.

InvalidFilename:

* `ERROR_BAD_PATHNAME`: The specified path is invalid.
2023-04-16 23:42:59 +01:00
bors
d0f204e4d7 Auto merge of #109133 - weihanglo:make-cargo-a-workspace, r=ehuss
Make cargo a workspace

8 commits in 7bf43f028ba5eb1f4d70d271c2546c38512c9875..39116ccc9b420a883a98a960f0597f9cf87414b8
2023-04-10 16:01:41 +0000 to 2023-04-15 20:24:15 +0000

- Make cargo a workspace (rust-lang/cargo#11851)
- Fix flaky not_found_permutations test. (rust-lang/cargo#11976)
- Use restricted Damerau-Levenshtein algorithm (rust-lang/cargo#11963)
- Correct the bug report for `cargo clippy --fix` (rust-lang/cargo#11882)
- Stabilize `cargo logout` (rust-lang/cargo#11950)
- Add more information to HTTP errors to help with debugging. (rust-lang/cargo#11878)
- Use registry.default for login/logout (rust-lang/cargo#11949)
- Change -C to be unstable (rust-lang/cargo#11960)

---

### What does this PR try to resolve?

Making cargo a workspace.

Why doing this?

* `rustc-workspace-hack` is primarily for sharing dependencies between rls and cargo, as rls previously depends on cargo. After rls retired, it is no longer the case sharing dependencies.
* It's q bit painful that cargo needs to deal with some dependency and licensing complexities. For example, #108665 failed because of the interaction bewteen `windows-sys` and `raw-dylib`. It currenctly blocks cargo's feature `-Zgitxodie` from moving forward.
* See rust-lang/cargo#11851

### Benchmark result

I've done a simple benchmark on both keeping or removing entire `rustc-workspace-hack`. It had no significant difference. Both took ~2m30s to finish `./x.py build -j8 src/tools/cargo src/tools/rls src/tools/clippy src/tools/miri src/tools/rustfmt`. Environment info:

```
host: aarch64-apple-darwin
os: Mac OS 13.2.1 [64-bit]
```

A sophisticated benchmark may be needed.

### Additional information

This depends on prior works from `@Muscraft` and `@ehuss.` Credits to them!
2023-04-16 19:26:02 +00:00
Michael Goulet
f6bfb4bf8e Erase regions when confirming transmutability candidate 2023-04-16 19:12:34 +00:00
Weihang Lo
103ed0e5c8
bootstrap: switch from stream_cargo to try_run_quiet
It is unnecessary to stream cargo JSON output.
2023-04-16 19:32:20 +01:00
Weihang Lo
befa5c98c9
chore: remove rustc-workspace-hack
Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-16 19:32:20 +01:00
Weihang Lo
1cfaa3431e
chore: remove Cargo features in rustc-workspace-hack 2023-04-16 19:32:20 +01:00