about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-14MaybeUninit::write: fix docMathis Bottinelli-1/+1
2025-04-30Auto merge of #140503 - matthiaskrgr:rollup-n7zigts, r=matthiaskrgrbors-309/+382
Rollup of 11 pull requests Successful merges: - #136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`) - #139059 (uses_power_alignment: wording tweaks) - #139192 (mention provenance in the pointer::wrapping_offset docs) - #140312 (Improve pretty-printing of braces) - #140404 (rm `TypeVistable` impls for `Canonical`) - #140437 (enable msa feature for mips in codegen tests) - #140438 (Add `rust.debug-assertions-tools` option) - #140439 (miri: algebraic intrinsics: bring back float non-determinism) - #140445 (Treat ManuallyDrop as ~const Destruct) - #140446 (chore: fix some tests) - #140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-30Rollup merge of #140448 - Zalathar:query-append, r=compiler-errorsMatthias Krüger-13/+36
Rename `rustc_query_append!` to `rustc_with_all_queries!` Whenever I'm trying to make sense of the query system internals, I always get tripped up on this unhelpfully-named macro. The fact that it's a higher-order proc macro is already mind-melting enough on its own. This new name, `rustc_with_all_queries!`, forms a much more intuitive combination with the helper macros that it invokes. And only one of the call sites was even making use of the “append” part of its old name. This PR also reformats the parameters matched by the helper macros, to make the actual argument syntax a bit easier to see. --- Renaming and reformatting only; no functional changes.
2025-04-30Rollup merge of #140446 - mejrs:test1, r=jieyouxuMatthias Krüger-111/+54
chore: fix some tests
2025-04-30Rollup merge of #140445 - oli-obk:const-manually-drop, r=fee1-deadMatthias Krüger-0/+47
Treat ManuallyDrop as ~const Destruct cc https://github.com/rust-lang/rust/issues/133214#issuecomment-2838078133 r? ```@compiler-errors``` cc ```@fee1-dead```
2025-04-30Rollup merge of #140439 - RalfJung:miri-algebraic-float-nondet, r=oli-obkMatthias Krüger-86/+107
miri: algebraic intrinsics: bring back float non-determinism Fixes https://github.com/rust-lang/miri/issues/4289 Cc ```@bjoernager``` r? ```@oli-obk```
2025-04-30Rollup merge of #140438 - ferrocene:pa-debug-assertions-tools, r=KobzolMatthias Krüger-5/+28
Add `rust.debug-assertions-tools` option Before this PR, the two only options to configure the presence of debug assertions were the `rust.debug-assertions` and `rust.debug-assertions-std` options. The former applied to everything, and the latter allowed to override the setting just for the standard library. This combination of settings doesn't allow to enable debug assertions for the std and the compiler but not tools. Some tools (like Cargo) are not really meant to be executed with debug assertions enabled, and in Ferrocene we hit some debug assertions in it that are exclusively meant for its test suite. We'd thus like to enable debug assertions everywhere but in tools. This PR adds a `rust.debug-assertions-tools` setting that does exactly this.
2025-04-30Rollup merge of #140437 - husqvarnagroup:af/codegen-test-mips-msa, r=jieyouxuMatthias Krüger-2/+13
enable msa feature for mips in codegen tests Fix codegen unit tests for mips by enabling the msa target feature.
2025-04-30Rollup merge of #140404 - lcnr:canonical-no-type-foldable, r=compiler-errorsMatthias Krüger-26/+4
rm `TypeVistable` impls for `Canonical` similar to `EarlyBinder`, you generally do not want to fold a canonical value directly without first instantiating it. In places where you do want to look into the `Canonical`, it's likely better to do so manually. r? ```@compiler-errors```
2025-04-30Rollup merge of #140312 - nnethercote:DelimArgs-spacing, r=petrochenkovMatthias Krüger-30/+63
Improve pretty-printing of braces r? ````@petrochenkov````
2025-04-30Rollup merge of #139192 - ↵Matthias Krüger-4/+6
lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung mention provenance in the pointer::wrapping_offset docs fixes https://github.com/rust-lang/rust/issues/139008
2025-04-30Rollup merge of #139059 - RalfJung:uses_power_alignment, r=nagisaMatthias Krüger-21/+14
uses_power_alignment: wording tweaks Slightly improves the wording introduced with https://github.com/rust-lang/rust/pull/135552.
2025-04-30Rollup merge of #136160 - ShE3py:should-panic-backticks, r=thomccMatthias Krüger-11/+10
Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg` More legible imo ```rs #[test] #[should_panic = "love"] fn foo() { assert!(1 == 2); } ``` Before: ``` note: panic did not contain expected string panic message: `"assertion failed: 1 == 2"`, expected substring: `"love"` ``` After: ``` note: panic did not contain expected string panic message: "assertion failed: 1 == 2" expected substring: "love" ``` Also removed the comma as `assert_eq!` / `assert_ne!` don't use one. ``@rustbot`` label +A-libtest
2025-04-30Auto merge of #139720 - petrochenkov:errkind2, r=jieyouxubors-2107/+2377
compiletest: Make diagnostic kind mandatory on line annotations (take 2) Compiletest currently accepts line annotations without kind in UI tests. ``` let a = b + c; //~ my message ``` Such annotations have two effects. - First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that. - Second, they are not "viral". For example, any explicit `//~ NOTE my msg` in a test requires all other `NOTE` diagnostics in the same test to be annotated. Implicit `//~ my msg` will just match the note and won't require other annotations. The second functionality has a replacement since recently - directive `//@ dont-require-annotations: NOTE`. This PR removes support for `//~ my message` and makes the explicit diagnostic kind mandatory. Unwanted additional annotations are suppressed using the `dont-require-annotations` directive. Closes https://github.com/rust-lang/compiler-team/issues/862. Previous attempt - #139427. r? `@jieyouxu`
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-2107/+2377
2025-04-30Auto merge of #140188 - nnethercote:streamline-format-macro, r=cuviperbors-10/+7
Streamline the `format` macro. Removing the unnecessary local variable speeds up compilation a little. r? `@cuviper`
2025-04-30Auto merge of #127516 - nnethercote:simplify-LazyAttrTokenStream, r=petrochenkovbors-378/+399
Simplify `LazyAttrTokenStream` `LazyAttrTokenStream` is an unpleasant type: `Lrc<Box<dyn ToAttrTokenStream>>`. Why does it look like that? - There are two `ToAttrTokenStream` impls, one for the lazy case, and one for the case where we already have an `AttrTokenStream`. - The lazy case (`LazyAttrTokenStreamImpl`) is implemented in `rustc_parse`, but `LazyAttrTokenStream` is defined in `rustc_ast`, which does not depend on `rustc_parse`. The use of the trait lets `rustc_ast` implicitly depend on `rustc_parse`. This explains the `dyn`. - `LazyAttrTokenStream` must have a `size_of` as small as possible, because it's used in many AST nodes. This explains the `Lrc<Box<_>>`, which keeps it to one word. (It's required `Lrc<dyn _>` would be a fat pointer.) This PR moves `LazyAttrTokenStreamImpl` (and a few other token stream things) from `rustc_parse` to `rustc_ast`. This lets us replace the `ToAttrTokenStream` trait with a two-variant enum and also remove the `Box`, changing `LazyAttrTokenStream` to `Lrc<LazyAttrTokenStreamInner>`. Plus it does a few cleanups. r? `@petrochenkov`
2025-04-29canonical no type foldable :<lcnr-26/+4
2025-04-30Use `ThinVec` to shrink `LazyAttrTokenStreamInner`.Nicholas Nethercote-5/+7
2025-04-30Simplify `LazyAttrTokenStream`.Nicholas Nethercote-118/+138
This commit does the following. - Changes it from `Lrc<Box<dyn ToAttrTokenStream>>` to `Lrc<LazyAttrTokenStreamInner>`. - Reworks `LazyAttrTokenStreamImpl` as `LazyAttrTokenStreamInner`, which is a two-variant enum. - Removes the `ToAttrTokenStream` trait and the two impls of it. The recursion limit must be increased in some crates otherwise rustdoc aborts.
2025-04-29Auto merge of #140023 - cjgillot:arena-try-alloc, r=BoxyUwUbors-33/+47
Introduce Arena::try_alloc_from_iter. `alloc_from_iter` already collects the iterator for reentrancy. So adding an early exit for a fallible iterator integrates naturally into the code. This avoids the other solution to allocate and dump the allocation.
2025-04-29mention provenance in the pointer::wrapping_offset docsbinarycat-4/+6
fixes https://github.com/rust-lang/rust/issues/139008
2025-04-29Auto merge of #140474 - tgross35:rollup-rdkao89, r=tgross35bors-274/+691
Rollup of 7 pull requests Successful merges: - #138344 (Enable `reliable_f16_math` on x86) - #139909 (implement or-patterns for pattern types) - #140392 (compiletest: Remove the libtest-based executor and its dependency) - #140400 (PassWrapper: adapt for llvm/llvm-project@d3d856ad8469) - #140422 (unwind: bump `unwinding` dependency to 0.2.6) - #140432 (Update documentation for `fn target_config`) - #140433 (Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-29Rollup merge of #140433 - BjoernLange:master, r=nnethercoteTrevor Gross-0/+2
Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targets This is an extension to #113814 which seems to have missed two targets which also need this patch for instrumentation with `-Z instrument-mcount` to work correctly. For anyone who might stumble over this issue again in the future: As a workaround one can dump the current target configuration using ``` rustc +nightly -Z unstable-options --target armv7-unknown-linux-gnueabihf --print target-spec-json ``` (assuming `armv7-unknown-linux-gnueabihf` is the target to build for) add the line ``` "llvm-mcount-intrinsic": "llvm.arm.gnu.eabi.mcount", ``` and compile with ``` RUSTFLAGS="-Z instrument-mcount -C passes=ee-instrument<post-inline>" cargo +nightly build -Z build-std --target <path to directory with modified target config>/armv7-unknown-linux-gnueabihf.json ``` It might be necessary to set the compiler for cross compiling using something like ``` export TARGET_CC=arm-linux-gnueabihf-gcc ```
2025-04-29Rollup merge of #140432 - tgross35:target-config-docs-update, r=jieyouxuTrevor Gross-5/+4
Update documentation for `fn target_config` This was missed as part of [1]. [1]: https://github.com/rust-lang/rust/pull/140323
2025-04-29Rollup merge of #140422 - betrusted-io:bump-unwinding-to-0.2.6, r=workingjubileeTrevor Gross-3/+3
unwind: bump `unwinding` dependency to 0.2.6 Xous now fails to compile under nightly, due to the recent change where `#[naked]` must now be wrapped in `unsafe(...)`. The `unwinding` crate was updated to account for this. With the following `bootstrap.toml`: ``` profile = "library" change-id = 138934 [build] build-stage = 2 target = ["riscv32imac-unknown-xous-elf"] [rust] std-features = ["panic-unwind"] download-rustc = false ``` The build fails when trying unwinding v0.2.5: ``` $ ./x.py build [...] Compiling unwinding v0.2.5 error: unsafe attribute used without unsafe --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unwinding-0.2.5/src/unwinder/arch/riscv32.rs:176:3 | 176 | #[naked] | ^^^^^ usage of unsafe attribute | help: wrap the attribute in `unsafe(...)` | 176 | #[unsafe(naked)] | +++++++ + error: could not compile `unwinding` (lib) due to 1 previous error warning: build failed, waiting for other jobs to finish... Build completed unsuccessfully in 0:06:26 $ ``` This patch updates `unwinding` to v0.2.6, which now wraps all issues of `naked` in `unsafe()`.
2025-04-29Rollup merge of #140400 - durin42:llvm-21-getguid, r=cuviperTrevor Gross-4/+9
PassWrapper: adapt for llvm/llvm-project@d3d856ad8469 LLVM 21 moves to making it more explicit what this function call is doing, but nothing has changed behaviorally, so for now we just adjust to using the new name of the function. `@rustbot` label llvm-main
2025-04-29Rollup merge of #140392 - Zalathar:goodbye-libtest, r=jieyouxuTrevor Gross-133/+8
compiletest: Remove the libtest-based executor and its dependency Now that #140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest. My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about. --- This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted. r? jieyouxu Blocker for https://github.com/rust-lang/rust/pull/119899
2025-04-29Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwUTrevor Gross-122/+662
implement or-patterns for pattern types These are necessary to represent `NonZeroI32`, as the range for that is `..0 | 1..`. The `rustc_scalar_layout_range_*` attributes avoided this by just implementing wraparound and having a single `1..=-1` range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussion cc https://github.com/rust-lang/rust/issues/123646 r? `@BoxyUwU`
2025-04-29Rollup merge of #138344 - tgross35:x86-f16-math, r=AmanieuTrevor Gross-7/+3
Enable `reliable_f16_math` on x86 This has been disabled due to an LLVM misoptimization with `powi.f16` [1]. This was fixed upstream and the fix is included in LLVM20, so tests no longer need to be disabled. `f16` still remains disabled on MinGW due to the ABI issue. [1]: https://github.com/llvm/llvm-project/issues/98665 try-job: x86_64-gnu try-job: x86_64-gnu-llvm-19-1 try-job: x86_64-gnu-llvm-20-1
2025-04-29Reformat parameters to macros used by with-all-queriesZalathar-6/+15
2025-04-29Rename `rustc_query_append!` to `rustc_with_all_queries!`Zalathar-7/+21
2025-04-29Coalesce duplicate missing clone testsmejrs-99/+44
2025-04-29Treat `ManuallyDrop` as `~const Destruct`Oli Scherer-23/+7
2025-04-29Add testOli Scherer-0/+63
2025-04-29Fix comment describing what the test doesmejrs-6/+3
2025-04-29Move `on impl position` test to proper directorymejrs-6/+7
2025-04-29miri: algebraic intrinsics: bring back float non-determinismRalf Jung-86/+107
2025-04-29add `rust.debug-assertions-tools` optionPietro Albini-5/+28
2025-04-29Auto merge of #140436 - RalfJung:miri-sync, r=RalfJungbors-304/+799
Miri subtree update r? `@ghost`
2025-04-29enable msa feature for mips in codegen testsAdrian Friedli-2/+13
2025-04-29Merge pull request #4301 from rust-lang/rustup-2025-04-29Ralf Jung-3796/+7701
Automatic Rustup
2025-04-29suppress dangerous_implicit_autorefs in TB testRalf Jung-0/+1
2025-04-29fmtThe Miri Cronjob Bot-7/+3
2025-04-29Merge from rustcThe Miri Cronjob Bot-3797/+7705
2025-04-29Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-29Replace the \01__gnu_mcount_nc to LLVM intrinsic for additional ARM targetsBjörn Barwinski-0/+2
2025-04-29Update documentation for `fn target_config`Trevor Gross-5/+4
This was missed as part of [1]. [1]: https://github.com/rust-lang/rust/pull/140323
2025-04-29Enable `target_has_reliable_f16_math` on x86Trevor Gross-7/+3
This has been disabled due to an LLVM misoptimization with `powi.f16` [1]. This was fixed upstream and the fix is included in LLVM20, so tests no longer need to be disabled. `f16` still remains disabled on MinGW due to the ABI issue. [1]: https://github.com/llvm/llvm-project/issues/98665
2025-04-29Auto merge of #137940 - 1c3t3a:alignment-borrows-check, r=saethlinbors-32/+88
Extend the alignment check to borrows The current alignment check does not include checks for creating misaligned references from raw pointers, which is now added in this patch. When inserting the check we need to be careful with references to field projections (e.g. `&(*ptr).a`), in which case the resulting reference must be aligned according to the field type and not the type of the pointer. r? `@saethlin` cc `@RalfJung,` after our discussion in #134424