| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Some `let chains` clean-up
Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one
r? compiler
|
|
Rollup of 6 pull requests
Successful merges:
- rust-lang/rust#143607 (Port the proc macro attributes to the new attribute parsing infrastructure)
- rust-lang/rust#144471 (Remove `compiler-builtins-{no-asm,mangled-names}`)
- rust-lang/rust#144495 (bump cargo_metadata)
- rust-lang/rust#144523 (rustdoc: save target modifiers)
- rust-lang/rust#144534 (check_static_item: explain should_check_for_sync choices)
- rust-lang/rust#144535 (miri: for ABI mismatch errors, say which argument is the problem)
Failed merges:
- rust-lang/rust#144536 (miri subtree update)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
miri: for ABI mismatch errors, say which argument is the problem
|
|
check_static_item: explain should_check_for_sync choices
Follow-up to https://github.com/rust-lang/rust/pull/144226.
r? ``@oli-obk``
|
|
rustdoc: save target modifiers
`rustdoc` was filling a `target_modifiers` variable, but it was not using the result.
In turn, that means that trying to use a dependency that set a target modifier fails.
For instance, running:
```sh
RUSTC_BOOTSTRAP=1 rustc --edition=2024 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null --emit=metadata -Zfixed-x18 --crate-type rlib --crate-name core $(rustc --print sysroot)/lib/rustlib/src/rust/library/core/src/lib.rs
echo '#![allow(internal_features)]
' | RUSTC_BOOTSTRAP=1 rustdoc --edition=2021 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null -Zfixed-x18 --extern core=libcore.rmeta -
```
will fail with:
```text
error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `rust_out`
|
= help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
= note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core`
= help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core`
= help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error
```
Thus save the targets modifiers in `Options` to then pass it to the session options, so that eventually the diff can be performed as expected in `report_incompatible_target_modifiers()`.
Cc: ``@azhogin``
Fixes: https://github.com/rust-lang/rust/issues/144521
|
|
bump cargo_metadata
Bumps cargo_metadata. Change that required fixes is: https://github.com/oli-obk/cargo_metadata/commit/e3373d02e79dc64adbecb3fe32fecc1dd324bba6
|
|
Remove `compiler-builtins-{no-asm,mangled-names}`
Remove `compiler-builtins-no-asm`
This feature used to be for when Cranelift didn't support inline
assembly, but its last uses were removed in 52933e0bd200 ("Don't disable
inline asm usage in compiler-builtins when the cranelift backend is
enabled"). and cba05a7a14b3 ("Support naked functions").
This doesn't remove the feature from the `compiler-builtins` crate, that
will be done separately in the subtree repo.
---
Remove `compiler-builtins-mangled-names`
This config was added in 207de019dc67 ("libary: Forward
compiler-builtins "asm" and "mangled-names" feature") but it does not
appear this has ever been used. The PR adding it (rust-lang/rust#78472) says that
this was exposed to help with configuration and points at the [Hermit
Cargo config], but as far as I can tell, this feature name has never
been mentioned in that repository's git history.
Thus, clean up a seemingly unneeded feature.
[Hermit Cargo config]: https://github.com/hermit-os/hermit-rs/blob/ab2b830930e6a9a98c8294997a8183feeabeda4a/.cargo/config
|
|
r=jdonszelmann,traviscross
Port the proc macro attributes to the new attribute parsing infrastructure
Ports `#[proc_macro]`, `#[proc_macro_attribute]`, `#[proc_macro_derive]` and `#[rustc_builtin_macro]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163
I've split this PR into commits for reviewability, and left some comments to clarify things
I did 4 related attributes in one PR because they share a lot of their code and logic, and doing them separately is kind of annoying as I need to leave both the old and new parsing in place then.
r? ``@oli-obk``
cc ``@jdonszelmann``
|
|
Don't special-case llvm.* as nounwind
Certain LLVM intrinsics, such as `llvm.wasm.throw`, can unwind. Marking them as nounwind causes us to skip cleanup of locals and optimize out `catch_unwind` under inlining or when `llvm.wasm.throw` is used directly by user code.
The motivation for forcibly marking llvm.* as nounwind is no longer present: most intrinsics are linked as `extern "C"` or other non-unwinding ABIs, so we won't codegen `invoke` for them anyway.
Closes rust-lang/rust#132416.
`@rustbot` label +T-compiler +A-panic
|
|
|
|
Preintern some `TyKind::Bound` values
The new trait solver produces a lot of these.
r? `@compiler-errors`
|
|
Avoid unnecessary `new_adt`/`new_fn_def` calls.
They can be skipped if there are no arguments, avoiding the "relate" operation work and also the subsequent interning.
r? `@ghost`
|
|
|
|
Resolve: refactor `define` into `define_local` and `define_extern`
Follow up on rust-lang/rust#143550 and part of [#gsoc > Project: Parallel Macro Expansion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/with/527348747).
Split up `define` into `define_local` and `define_extern`. Refactor usages of `define` into either one where it's "correct" (idk if everything is correct atm). Big part of this is that `resolution` can now take a `&Resolver` instead of a mutable one.
r? `@petrochenkov`
|
|
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- rust-lang/rust#144226 (Do not assert layout in KnownPanicsLint.)
- rust-lang/rust#144385 (Optimize performance by inline in macro hygiene system)
- rust-lang/rust#144454 (move uefi test to run-make)
- rust-lang/rust#144455 (Unify LLVM ctlz/cttz intrinsic generation)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Unify LLVM ctlz/cttz intrinsic generation
The type signature for `llvm.ctlz` is the same as the one for `llvm.cttz`, which enables a small simplification.
|
|
move uefi test to run-make
Turn the `uefi` test into a more standard `run-make` test, and execute it using the `test-various` CI job like before.
This is just a straightforward translation of the python code, but using `run-make` to supply the target (hence the 3 separate calls in the docker file).
r? ```@jieyouxu```
cc ```@nicholasbishop```
try-job: test-various
|
|
Optimize performance by inline in macro hygiene system
I inline some small method in `rustc_span/src/hygiene.rs` and so on.
|
|
Do not assert layout in KnownPanicsLint.
Fixes rust-lang/rust#121176
Fixes rust-lang/rust#129109
Fixes rust-lang/rust#130970
Fixes rust-lang/rust#131347
Fixes rust-lang/rust#139872
Fixes rust-lang/rust#140332
|
|
No longer need `alloca`s for consuming `Result<!, i32>` and similar
In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this.
While doing so, rewrite `LocalAnalyzer::process_place` to be non-recursive, solving a 6+ year old FIXME.
r? codegen
|
|
`rustdoc` was filling a `target_modifiers` variable, but it was not
using the result.
In turn, that means that trying to use a dependency that set a target
modifier fails.
For instance, running:
```sh
RUSTC_BOOTSTRAP=1 rustc --edition=2024 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null --emit=metadata -Zfixed-x18 --crate-type rlib --crate-name core $(rustc --print sysroot)/lib/rustlib/src/rust/library/core/src/lib.rs
echo '#![allow(internal_features)]
' | RUSTC_BOOTSTRAP=1 rustdoc --edition=2021 --target=aarch64-unknown-none-softfloat --sysroot=/dev/null -Zfixed-x18 --extern core=libcore.rmeta -
```
will fail with:
```text
error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `rust_out`
|
= help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
= note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `core`
= help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `core`
= help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error
```
Thus save the targets modifiers in `Options` to then pass it to the
session options, so that eventually the diff can be performed as expected
in `report_incompatible_target_modifiers()`.
Fixes: https://github.com/rust-lang/rust/issues/144521
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
Rollup of 13 pull requests
Successful merges:
- rust-lang/rust#141840 (If `HOME` is empty, use the fallback instead)
- rust-lang/rust#144359 (add codegen test for variadics)
- rust-lang/rust#144379 (test using multiple c-variadic ABIs in the same program)
- rust-lang/rust#144383 (disable cfg.has_reliable_f128 on amdgcn)
- rust-lang/rust#144409 (Stop compilation early if macro expansion failed)
- rust-lang/rust#144422 (library/windows_targets: Fix macro expansion error in 'link' macro)
- rust-lang/rust#144429 (Enable outline-atomics for aarch64-unknown-linux-musl)
- rust-lang/rust#144430 (tests: aarch64-outline-atomics: Remove hardcoded target)
- rust-lang/rust#144445 (Fix `./x check bootstrap` (again))
- rust-lang/rust#144453 (canonicalize build root in `tests/run-make/linker-warning`)
- rust-lang/rust#144464 (Only run bootstrap tests in `x test` on CI)
- rust-lang/rust#144470 (clif: Don't set the `compiler-builtins-no-f16-f128` feature)
- rust-lang/rust#144480 (Revert "coverage: Enlarge empty spans during MIR instrumentation, not codegen")
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Revert "coverage: Enlarge empty spans during MIR instrumentation, not codegen"
Surprisingly, rust-lang/rust#144298 alone (extracted from rust-lang/rust#140847) was enough to re-trigger the failures observed in https://github.com/rust-lang/rust/issues/141577#issuecomment-3120667286.
---
This reverts commit f877aa7d14916f71a2f88c6d4c009e7ded7684c4.
---
r? ghost
|
|
clif: Don't set the `compiler-builtins-no-f16-f128` feature
Since rust-lang/rust be35d37d8b6c ("Use the compiler to determine whether or not to enable f16 and f128"), `compiler-builtins` relies on `rustc` to report whether or not `f16` and `f128` are supported, which is reported by the backend. This means that there should no longer be any need to unconditionally disable the types for clif in Bootstrap.
Backend config: https://github.com/rust-lang/rust/blob/a955f1cd09a027363729ceed919952d09f76f28e/compiler/rustc_codegen_cranelift/src/lib.rs#L224-L233
|
|
Only run bootstrap tests in `x test` on CI
Discussed at https://rust-lang.zulipchat.com/#narrow/channel/122652-new-members/topic/Linux.20Distribution/with/530839642. The bootstrap tests can be sensitive of the environment where they are executed. And now that they are executed very early in the test pipeline, it can be annoying for people who just try to do `x test` when it fails on bootstrap tests.
We could move the bootstrap tests back to the end of the `x test` pipeline, but then it would just fail later. I'd prefer to only run them on CI by default.
Fixes: https://github.com/rust-lang/rust/issues/143973
|
|
canonicalize build root in `tests/run-make/linker-warning`
r? jieyouxu
This is similar to rust-lang/rust#139823 -- the test fails for me because my build dir is a symlink.
|
|
Fix `./x check bootstrap` (again)
Redoes rust-lang/rust#134883 and reverts 40c2ca96411caaeab1563ff9041879f742d1d71b from rust-lang/rust#142416. Unfortunately I missed this during review.
- Commit 1: Reverts 40c2ca96411caaeab1563ff9041879f742d1d71b and re-applies rust-lang/rust#134883.
- Commit 2: Check `./x check bootstrap` in `pr-check-1` to catch "obvious" problems like this.
r? Kobzol
|
|
tests: aarch64-outline-atomics: Remove hardcoded target
Since this test is limited to aarch64 and linux hosts, the `--target` flag is entirely unnecessary and only breaks this on musl hosts. Let the compiler use the default target instead.
|
|
Enable outline-atomics for aarch64-unknown-linux-musl
They were disabled in bd287fa5084f2e153c1044632f9f3d190f090d69 and haven't been causing problems for a while anymore, see https://github.com/rust-lang/rust/issues/89626 for details.
The entire testsuite still passes on `aarch64-unknown-linux-musl` with this feature enabled.
|
|
library/windows_targets: Fix macro expansion error in 'link' macro
A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in rust-lang/rust#143592
This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon".
We add a semicolon to the line causing the issue as we also modify the non windows_raw_dylib link to make use of the link_dylib macro
|
|
Stop compilation early if macro expansion failed
Fixes rust-lang/rust#116180.
So there isn't really a type that is central for macro expansion and some errors are actually emitted (because the resolution happens after the expansion I suppose) after the expansion pass (like "not found macro"). Sometimes, errors are only emitted on the second "try" (to improve error output). So I couldn't reach a similar solution than what was done in https://github.com/rust-lang/rust/pull/133937 and suggested by ````@estebank```` in https://github.com/rust-lang/rust/issues/116180#issuecomment-3109468922. But maybe I missed something?
So in the end, I realized that there is method called every time (except one, described below) a macro error is actually emitted: `ExtCtxt::trace_macros_diag`. Considering I updated what it did, I renamed it into `macro_error_and_trace_macros_diag` to better reflect it.
There is only one call of `trace_macros_diag` which isn't reporting an error but just used for `macro_trace` feature, so I kept it as is.
r? ````@oli-obk````
|
|
disable cfg.has_reliable_f128 on amdgcn
I was experimenting with compiling a few kernels for amd while working on std::offload. It seems like the logic in https://github.com/rust-lang/compiler-builtins/pull/737 got removed, so I re-introduce it here. Probably should have a test to avoid another regression and make sure that f128 doesn't show up as target feature for amdgcn. It looks like currently we neither check that for nvptx, nor amdgpu. Maybe I could add two revisions to https://github.com/rust-lang/rust/blob/master/tests/ui/float/target-has-reliable-nightly-float.rs?
r? ````@Flakebi````
fixes: https://github.com/rust-lang/rust/issues/144381
|
|
r=RalfJung
test using multiple c-variadic ABIs in the same program
tracking issue: https://github.com/rust-lang/rust/issues/100189
Check that multiple c-variadic calling conventions can be used in the same program.
Clang and gcc reject defining functions with a non-default calling convention and a variable
argument list, so C programs that use multiple c-variadic calling conventions are unlikely
to come up. Here we validate that our codegen backends do in fact generate correct code.
(CI will not run this test because it runs on aarch64, I would like to at least test that this runs on windows)
try-job: `x86_64-gnu`
try-job: `x86_64-msvc-*`
try-job: `x86_64-apple-2`
|
|
add codegen test for variadics
This is a part of https://github.com/rust-lang/rust/pull/144066 that can land without FCP.
|
|
If `HOME` is empty, use the fallback instead
This is a minor change in the `home_dir` api. An empty path is never (or should never be) valid so if the `HOME` environment variable is empty then let's use the fallback instead.
r? libs-api
|
|
Let `codegen_transmute_operand` just handle everything
When combined with rust-lang/rust#143720, this means `rvalue_creates_operand` can just return `true` for *every* `Rvalue`. (A future PR could consider removing it, though just letting it optimize out is fine for now.)
It's nicer anyway, IMHO, because it avoids needing the layout checks to be consistent in the two places, and thus is an overall reduction in code. Plus it's a more helpful building block when used in other places this way.
(TBH, it probably would have been better to have it this way the whole time, but I clearly didn't understand `rvalue_creates_operand` when I originally wrote rust-lang/rust#109843.)
|
|
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
|
|
|