Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}`
Catch the case where `kw::Self` is recovered in the parser and causes us to subsequently resolve `&self`'s implicit type to something that's not a type.
This check could be made more accurate, though I'm not sure how hard we have to try here.
Fixes#123988
refactor clippy in bootstrap
Previously, using clippy in bootstrap was not very useful as explained in #122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run `x clippy compiler -Aclippy::all -Dclippy::correctness` and `x clippy library/std -Dclippy::all` and none of them will affect each other).
Resolves#122825
Update cargo
11 commits in 48eca1b164695022295ce466b64b44e4e0228b08..6f06fe908a5ee0f415c187f868ea627e82efe07d
2024-04-12 21:16:36 +0000 to 2024-04-16 18:47:44 +0000
- fix(toml): Error on `[project]` in Edition 2024 (rust-lang/cargo#13747)
- feat(update): Include a Locking message (rust-lang/cargo#13759)
- chore(deps): update rust crate gix to 0.62.0 [security] (rust-lang/cargo#13760)
- test(schemas): Ensure tests cover the correct case (rust-lang/cargo#13761)
- feat(resolve): Tell the user the style of resovle done (rust-lang/cargo#13754)
- Make sure to also wrap the initial `-vV` invocation (rust-lang/cargo#13659)
- docs: update `checkout` GitHub action version (rust-lang/cargo#13757)
- Recategorize cargo test's `--doc` flag under "Target Selection" (rust-lang/cargo#13756)
- Reword sentence describing workspace toml for clarity (rust-lang/cargo#13753)
- docs(ref): Update unstable docs for msrv-policy (rust-lang/cargo#13751)
- refactor(config): Consistently use kebab-case (rust-lang/cargo#13748)
r? ghost
This makes sure that &[] is just as efficient as indirecting through
unsafe code (from_raw_parts). No new stable guarantee is intended about
whether or not we do this, this is just an optimization.
Co-authored-by: Ralf Jung <post@ralfj.de>
Rollup of 7 pull requests
Successful merges:
- #123673 (Don't ICE for kind mismatches during error rendering)
- #123675 (Taint const qualifs if a static is referenced that didn't pass wfcheck)
- #123975 (Port the 2 `rust-lld` run-make tests to `rmake`)
- #124000 (Use `/* value */` as a placeholder)
- #124013 (Box::into_raw: make Miri understand that this is a box-to-raw cast)
- #124027 (Prefer identity equality over equating types during coercion.)
- #124036 (Remove `default_hidden_visibility: false` from wasm targets)
r? `@ghost`
`@rustbot` modify labels: rollup
Remove `default_hidden_visibility: false` from wasm targets
To the best of my ability I believe that this is no longer necessary. I don't fully recall why this was first added but I believe it had to do with symbols all being exported by default and this was required to undo that. Regardless nowadays the default output of rustc seems suitable so it seems best to keep wasm in line with other targets.
Prefer identity equality over equating types during coercion.
These types are always generic only over their own generic parameters with no inference variables involved.
r? `@compiler-errors`
I love touching code that [hasn't changed meaningfully since 2016](https://github.com/rust-lang/rust/pull/41937)
Box::into_raw: make Miri understand that this is a box-to-raw cast
Turns out https://github.com/rust-lang/rust/pull/122647 went a bit too far in cleaning up `Box`... we still need a hack in `Box::into_raw`. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.
Fixes https://github.com/rust-lang/miri/issues/3473.
Use `/* value */` as a placeholder
The expression `value` isn't a valid suggestion; let's use `/* value */` as a placeholder (which is also invalid) since it more clearly signals to the user that they need to fill it in with something meaningful. This parallels the suggestions we have in a couple other places, like arguments.
We could also print the type name instead of `/* value */`, especially if it's suggestable, but I don't care strongly about that.
Port the 2 `rust-lld` run-make tests to `rmake`
In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`:
- `tests/run-make/rust-lld`
- `tests/run-make/rust-lld-custom-target`
As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library.
Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`.
r? `@jieyouxu`
Taint const qualifs if a static is referenced that didn't pass wfcheck
It is correct to only check the signature here, as the ICE is caused by `USE_WITH_ERROR` trying to allocate memory to store the result of `WITH_ERROR` before evaluating it.
fixes#123153
Rollup of 7 pull requests
Successful merges:
- #122811 (Move `SourceMap` initialization)
- #123512 (Match ergonomics 2024: Implement eat-one-layer)
- #123811 (Use queue-based `RwLock` on more platforms)
- #123859 (Remove uneeded clones now that TrustedStep implies Copy)
- #123979 (Subtype predicates only exist on inference types, so we can allow them to register opaque types within them.)
- #124016 (Outline default query and hook provider function implementations)
- #124023 (Allow workproducts without object files.)
r? `@ghost`
`@rustbot` modify labels: rollup
To the best of my ability I believe that this is no longer necessary. I
don't fully recall why this was first added but I believe it had to do
with symbols all being exported by default and this was required to undo
that. Regardless nowadays the default output of rustc seems suitable so
it seems best to keep wasm in line with other targets.
Allow workproducts without object files.
This pull request partially reverts changes from e16c3b4a44
Original motivation for this assert was described with "A WorkProduct without a saved file is useless"
which was true at the time but now it is possible to have work products with other types of files
(llvm-ir, asm, etc) and there are bugreports for this failure:
For example: https://github.com/rust-lang/rust/issues/123695
Fixes https://github.com/rust-lang/rust/issues/123234
Now existing `assert` and `.unwrap_or_else` are unified into a single
check that emits slightly more user friendly error message if an object
files was meant to be produced but it's missing
Outline default query and hook provider function implementations
The default query and hook provider functions call `bug!` with a decently long message.
Due to argument inlining in `format_args!` ([`flatten_format_args`](https://github.com/rust-lang/rust/issues/78356)), this ends up duplicating the message for each query, adding ~90KB to `librustc_driver.so` of unreachable panic messages.
To avoid this, we can outline the common `bug!` logic.
Subtype predicates only exist on inference types, so we can allow them to register opaque types within them.
We were unable to come up with an example where this could be reached (subtype predicates with either side not being an infer var gets consumed during any `select_where_possible` invocation, of which we have a lot in typeck). To ensure we don't silently accept new behaviour in case we missed a situation where this could occur, I have added an assert that prevents opaque types from having their hidden type constrained.
r? `@compiler-errors`
Use queue-based `RwLock` on more platforms
This switches over Windows 7, SGX and Xous to the queue-based `RwLock` implementation added in #110211, thereby fixing #121949 for Windows 7 and partially resolving #114581 on SGX. TEEOS can't currently be switched because it doesn't have a good thread parking implementation.
CC `@roblabla` `@raoulstrackx` `@xobs` Could you help me test this, please?
r? `@ChrisDenton` the Windows stuff should be familiar to you
Previously this command was linting compiler and library together.
As we no longer run clippy on the entire tree unless it's explicitly
requested, we need to update this command by adding `library` path.
Signed-off-by: onur-ozkan <work@onurozkan.dev>
interpret: remove outdated comment
In https://github.com/rust-lang/rust/pull/107756, allocation became generally fallible, so the "only panic if there is provenance" no longer applies.
r? ``@oli-obk``
Change a diagnostics-path-only `DefineOpaqueTypes` to `Yes`.
This can't possibly affect compilation, so it's safe to flip, even if I couldn't come up with an affected test
r? ``@compiler-errors``