`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.
[1]: https://github.com/rust-lang/rust/pull/137653
Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding
it is disabled by default in LLVM [1], replicate the cmake behavior in bootstrap process
It also enables some additional code that handles PAC-specific unwind info
it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags
This fixes build with clang/musl on aarch64
[1] 85624c5de3
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Bump master `stage0` compiler
To include beta backport of revert rust-lang/rust#141024 which should undo linker warnings during bootstrapping of Windows MSVC targets due to rust-lang/rust#140176.
Closesrust-lang/rust#141395.
r? `@Mark-Simulacrum` (or release)
Make two transmute-related MIR lints into HIR lint
Make `PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS` (rust-lang/rust#130540) and `UNNECESSARY_TRANSMUTES` (rust-lang/rust#136083) into "normal" HIR-based lints.
Funny enough this came up in the review of the latter (https://github.com/rust-lang/rust/pull/136083#issuecomment-2614301413), but I guess it just was overlooked.
But anywyas, there's no reason for these to be MIR lints; in fact, it makes the suggestions for them a bit more complicated than necessary.
Note that there's probably a few more simplifications and improvements to be done here. Follow-ups can be done in a separate PR, especially if they're about the messaging and suggestions themselves, which I didn't write.
gvn: bail out unavoidable non-ssa locals in repeat
Fixes#141251.
We cannot transform `*elem` to `array[idx1]` in the following code, as `idx1` has already been modified.
```rust
mir! {
let array;
let elem;
{
array = [*val; 5];
elem = &array[idx1];
idx1 = idx2;
RET = *elem;
Return()
}
}
```
Perhaps I could transform it to `array[0]`, but I prefer the conservative approach.
r? mir-opt
Make check-cfg diagnostics work in `#[doc(cfg(..))]`
This PR makes it so that the check-cfg `unexpected_cfgs` lint, is correctly emitted in `rustdoc`'s `#[doc(cfg(..))]`.
This is achieved by adding a custom trait to `cfg_matches` (the method that emits the lint) which permits `rustc` and `rustdoc` to each have their way to emitting lints (via buffered lints/AST for `rustc` and via `TyCtxt`/HIR for `rustdoc`).
The reason this is required is because buffered lints operates on the AST but `rustdoc` uses the HIR and by the time `rustdoc` calls `cfg_matches` we are way passed the point where buffered lints have been drain and emitted.
Best reviewed commit by commit.
r? `@jieyouxu` (for the compiler part)
r? `@GuillaumeGomez` (for the rustdoc part)
Add some track_caller info to precondition panics
Currently, when you encounter a precondition check, you'll always get the caller location of the implementation of the precondition checks. But with this PR, you'll be told the location of the invalid call. Which is useful.
I thought of this while looking at https://github.com/rust-lang/rust/pull/129642#issuecomment-2311703898.
The changes to `tests/ui/const*` happen because the const-eval interpreter skips `#[track_caller]` frames in its backtraces.
The perf implications of this are:
* Increased debug binary sizes. The caller_location implementation requires that the additional data we want to display here be stored in const allocations, which are deduplicated but not across crates. There is no impact on optimized build sizes. The panic path and the caller location data get optimized out.
* The compile time hit to opt-incr-patched bitmaps happens because the patch changes the line number of some function calls with precondition checks, causing us to go from 0 dirty CGUs to 1 dirty CGU.
* The other compile time hits are marginal but real, and due to doing a handful of new queries. Adding more useful data isn't completely free.
Only drop-liveness checks for maybe-initializedness of move paths, and
it does so only for the relevant live locals that have drop points.
This adds a fast path by computing this dataflow analysis only when checking for such
initializedness. This avoids this expensive computation for the common
case.
For example, it avoids computing initializedness for 20K locals in the
`cranelift-codegen` benchmark, it has 7K relevant live locals but none
with drop points. That saves 900ms on end-to-end compilation times.
tests: mark option-niche-eq as fixed on LLVM 21
Some combination of recent Rust changes (between 3d86494a0d and aa57e46e24 from what I can tell) and changes in LLVM 21 (not recently, as best I can tell) have caused this test to start showing the behavior we want, so it's time to move this test to a proper place and mark it as fixed on LLVM 21.
~~Probably "fixes" rust-lang/rust#49892, but I'll let others make that call.~~
Closesrust-lang/rust#49892 unless we want to break out a dedicated issue for `Option<bool>::eq` on LLVM 20 (seems low-value).
`@rustbot` label llvm-main
coverage: Revert "unused local file IDs" due to empty function names
The changes to coverage metadata generation in rust-lang/rust#140847 appear to be the most likely cause of the `function name is empty` errors reported in rust-lang/rust#141577.
If that guess is correct, great. If not, no big deal.
---
This reverts commit 3b22c21dd8, reversing changes made to 5f292eea6d.
r? ghost
Rename `{GenericArg,Term}::unpack()` to `kind()`
A well-deserved rename IMO.
r? `@oli-obk` or `@lcnr` (or anyone)
cc `@rust-lang/types,` but I'd be surprised if this is controversial.
This adds running of cargo's tests to the aarch64-apple-darwin job. The
reason for this is that tier-1 targets are ostensibly supposed to run
tests for host tools, but we are not doing that here. We do have fairly
good coverage in Cargo's CI, but we don't have much coverage of beta or
stable. I think it would be good to have a fallback here.
Although they are clickable in the github preview, they aren't in the actual rendered HTML on https://rustc-dev-guide.rust-lang.org/.
This commit fixes that.
With the stage0 refactor the proc_macro version found in the sysroot
will no longer always match the proc_macro version that proc-macros get
compiled with by the rustc executable that uses this proc_macro. This
will cause problems as soon as the ABI of the bridge gets changed to
implement new features or change the way existing features work.
To fix this, this commit changes rustc crates to depend directly on the
local version of proc_macro which will also be used in the sysroot that
rustc will build.
Rollup of 17 pull requests
Successful merges:
- rust-lang/rust#140591 (Fix malformed suggestion for E0061 when method is a macro token in macro context)
- rust-lang/rust#141536 (Improve `ambiguous_wide_pointer_comparisons` lint compare diagnostics)
- rust-lang/rust#141552 (Pull out dedicated `cfg_version` syntax test from feature gate test)
- rust-lang/rust#141556 (bootstrap: translate Windows paths in a way that works for both Cygwin and MSYS2)
- rust-lang/rust#141563 (Remove out-of-date `noop_*` names.)
- rust-lang/rust#141568 (dist: make sure llvm-project submodule is present)
- rust-lang/rust#141580 (Use more detailed spans in dyn compat errors within bodies)
- rust-lang/rust#141582 (intrinsics, ScalarInt: minor cleanup)
- rust-lang/rust#141584 (Support `opaque_types_defined_by` for `SyntheticCoroutineBody`)
- rust-lang/rust#141587 (Add missing edition directives for async-await tests)
- rust-lang/rust#141594 (Add `generic_arg_infer` test)
- rust-lang/rust#141596 (rustc book: fix erratic sentence by making it more simple)
- rust-lang/rust#141599 (Remove an unnecessary use of `Box::into_inner`.)
- rust-lang/rust#141611 (Update mdbook to 0.4.51)
- rust-lang/rust#141616 (Remove spastorino from vacations)
- rust-lang/rust#141623 (use custom types to clarify arguments to `emit_ptr_va_arg`)
- rust-lang/rust#141635 (further dedup `WalkItemKind` for `mut_visit` and `visit`)
r? `@ghost`
`@rustbot` modify labels: rollup