about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-06-26Auto merge of #143057 - matthiaskrgr:rollup-bulih8o, r=matthiaskrgrbors-215/+612
Rollup of 8 pull requests Successful merges: - rust-lang/rust#124595 (Suggest cloning `Arc` moved into closure) - rust-lang/rust#139594 (Simplify `ObligationCauseCode::IfExpression`) - rust-lang/rust#141311 (make `tidy-alphabetical` use a natural sort) - rust-lang/rust#141648 ([rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion) - rust-lang/rust#142285 (tests: Do not run afoul of asm.validity.non-exhaustive in input-stats) - rust-lang/rust#142393 (Don't give APITs names with macro expansion placeholder fragments in it) - rust-lang/rust#142884 (StableMIR: Add method to retrieve body of coroutine) - rust-lang/rust#142981 (Make missing lifetime suggestion verbose) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-26Better recoveryMichael Goulet-6/+13
2025-06-26Make recovery for enum with struct field a bit more accurateMichael Goulet-0/+16
2025-06-26rustdoc: show attributes on enum variantsbinarycat-0/+25
mostly for #[non_exhaustive]
2025-06-26clarify and unify 'transient mutable borrow' errorsRalf Jung-61/+61
2025-06-26add more sensible mut-ref-to-immutable testRalf Jung-8/+21
2025-06-26const-eval: allow constants to refer to mutable/external memory, but reject ↵Ralf Jung-127/+159
such constants as patterns
2025-06-26Rollup merge of #142981 - compiler-errors:verbose-missing-suggestion, r=estebankMatthias Krüger-117/+246
Make missing lifetime suggestion verbose I keep seeing this suggestion when working on rustc, and it's annoying that it's inline. Part of https://github.com/rust-lang/rust/issues/141973. Feel free to close this if there's another PR already doing this. r? ``@estebank``
2025-06-26Rollup merge of #142884 - makai410:coroutine-body, r=celinvalMatthias Krüger-0/+105
StableMIR: Add method to retrieve body of coroutine It would be handy if we can retrieve body of a coroutine in StableMIR.
2025-06-26Rollup merge of #142393 - compiler-errors:nofield, r=petrochenkovMatthias Krüger-9/+44
Don't give APITs names with macro expansion placeholder fragments in it The `DefCollector` previously called `pprust::ty_to_string` to construct a name for APITs (arg-position impl traits). The `ast::Ty` that was being formatted however has already had its macro calls replaced with "placeholder fragments", which end up rendering like `!()` (or ICEing, in the case of rust-lang/rust#140333, since it led to a placeholder struct field with no name). Instead, collect the name of the APIT *before* we visit its macros and replace them with placeholders in the macro expander. This makes the implementation a bit more involved, but AFAICT there's no better way to do this since we can't do a reverse mapping from placeholder fragment -> original macro call AST. Fixes rust-lang/rust#140333
2025-06-26Rollup merge of #142285 - workingjubilee:dont-use-bad-assembly, r=nnethercoteMatthias Krüger-7/+10
tests: Do not run afoul of asm.validity.non-exhaustive in input-stats This addresses one of the three powerpc64-unknown-linux-musl test failures in https://github.com/rust-lang/rust/issues/142280 I was motivated to cover it myself because technically this is also compile-time UB if we compile a program that has `asm!` with x86-64-specific instructions on another platform. That'll only mean something if this is ever switched to build-pass, or if checking emits object code, but conveniently "nop" is valid assembly on all platforms anyone has implemented Rust codegen for. Even the weird ones LLVM doesn't support, like PA-RISC or Common Intermediate Language. ...except GPUs. Not sure about those. r? ```@nnethercote```
2025-06-26Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, ↵Matthias Krüger-0/+79
r=lolbinarycat [rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion Fixes https://github.com/rust-lang/rust/issues/141553. The problem was that we change the context for the attributes in some cases to get better error output, preventing us to detect if the attribute comes from expansion. Most of the changes are about keeping track of the "does this span comes from expansion" information. r? ```@Manishearth```
2025-06-26Rollup merge of #139594 - compiler-errors:if-cause, r=oli-obkMatthias Krüger-78/+70
Simplify `ObligationCauseCode::IfExpression` This originally started out as an experiment to do less incremental invalidation by deferring the span operations that happen on the good path in `check_expr_if`, but it ended up not helping much (or at least not showing up in our incremental tests). As a side-effect though, I think the code is a lot cleaner and there are modest diagnostics improvements with overlapping spans, so I think it's still worth landing.
2025-06-26Rollup merge of #124595 - estebank:issue-104232, r=davidtwcoMatthias Krüger-4/+58
Suggest cloning `Arc` moved into closure ``` error[E0382]: borrow of moved value: `x` --> $DIR/moves-based-on-type-capture-clause-bad.rs:9:20 | LL | let x = "Hello world!".to_string(); | - move occurs because `x` has type `String`, which does not implement the `Copy` trait LL | thread::spawn(move || { | ------- value moved into closure here LL | println!("{}", x); | - variable moved due to use in closure LL | }); LL | println!("{}", x); | ^ value borrowed here after move | = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider cloning the value before moving it into the closure | LL ~ let value = x.clone(); LL ~ thread::spawn(move || { LL ~ println!("{}", value); | ``` Fix rust-lang/rust#104232.
2025-06-26Rename `tilde const` test files to `conditionally const`Oli Scherer-61/+65
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-1200/+1249
2025-06-26Move an ACE test out of the GCI directoryLeón Orell Valerian Liehr-35/+17
2025-06-26Auto merge of #142255 - estebank:edition-diagnostic-changes, ↵bors-130/+1201
r=fee1-dead,WaffleLapkin Add edition checks for some tests that had divergent output In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while I was looking at something else.
2025-06-26const validation: properly ignore zero-sized UnsafeCellRalf Jung-0/+15
2025-06-26Move mixed export_name/no_mangle check to check_attr.rs and improve the errorJonathan Brouwer-10/+81
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-26Port `#[export_name]` to the new attribute parsing infrastructureJonathan Brouwer-13/+13
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-26Simplify IfCauseMichael Goulet-78/+70
2025-06-25Bless `tests/ui/macros/must-use-in-macro-55516.rs`Urgau-1/+4
2025-06-25Fix suggestion spans inside macros for the `unused_must_use` lintUrgau-0/+168
2025-06-25Rollup merge of #142992 - workingjubilee:dont-validate-naughty-abis, r=jieyouxuJana Dönszelmann-188/+83
Convert some ABI tests to use `extern "rust-invalid"`
2025-06-25Rollup merge of #142976 - compiler-errors:coerce-ice, r=fee1-deadJana Dönszelmann-58/+32
Check CoerceUnsized impl validity before coercing Self-explanatory from the title. Fixes rust-lang/rust#126982 Fixes rust-lang/rust#131048 Fixes rust-lang/rust#134217 Fixes rust-lang/rust#126269 Fixes rust-lang/rust#138265
2025-06-25Rollup merge of #142200 - Kivooeo:tf8, r=jieyouxuJana Dönszelmann-148/+151
`tests/ui`: A New Order [8/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-25tests: Do not run afoul of asm.validity.non-exhaustive in input-statsJubilee Young-7/+10
2025-06-25emit `StorageLive` and schedule `StorageDead` for `let`-`else` after matchingdianne-14/+27
2025-06-25Add edition checks for some tests that had divergent outputEsteban Küber-113/+1184
In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while looking at something else.
2025-06-25Do not use `gen` as binding nameEsteban Küber-17/+17
If we ever start testing every edition, using a new keyword unnecessarily will cause divergent output, so pre-emptively change `gen` into `generator`.
2025-06-25Don't give APITs names with macro expansion placeholder fragments in itMichael Goulet-9/+44
2025-06-25Normalize before computing ConstArgHasType goalMichael Goulet-6/+28
2025-06-25Compute hard errors without diagnostics in ↵Michael Goulet-6/+0
impl_intersection_has_impossible_obligation
2025-06-25update ui/import testsLorrensP-2158466-124/+497
2025-06-25Sprinkle breadcrumbs around to lead people to the rust-invalid ABIJubilee Young-0/+2
2025-06-25tests: specify why extern "rust-invalid" cannot be used in varargs testJubilee Young-1/+2
2025-06-25tests: migrate unsupported-abi-transmute.rs to extern "rust-invalid"Jubilee Young-13/+13
2025-06-25tests: split out unsupported-in-impls.rsJubilee Young-174/+66
The cross-build megatest gets extremely conflict-prone, so start cutting it into smaller pieces.
2025-06-25move unstable book page and account for itJubilee Young-4/+4
2025-06-25tests: bless s/C-cmse/cmse/Jubilee Young-313/+313
2025-06-25tests: s/C-cmse/cmse/Jubilee Young-112/+110
2025-06-24Rollup merge of #142983 - compiler-errors:taint-invalid-call-abi, ↵Jubilee-0/+45
r=workingjubilee Taint body on invalid call ABI Fixes https://github.com/rust-lang/rust/issues/142969 I'm not certain if there are any other paths that should be tainted, but they would operate similarly. Perhaps pointer coercion. Introduces `extern "rust-invalid"` for testing purposes. r? ```@workingjubilee``` or ```@oli-obk``` (or anyone)
2025-06-24Rollup merge of #142977 - aDotInTheVoid:rustdochtml-targetfeature, ↵Jubilee-0/+38
r=GuillaumeGomez rustdoc: Don't mark `#[target_feature]` functions as ⚠ Closes https://github.com/rust-lang/rust/issues/142952
2025-06-24Rollup merge of #142955 - bjorn3:cg_clif_test_fixes, r=jieyouxuJubilee-10/+77
Couple of test suite fixes for cg_clif Most of these are required for getting the test suite running with panic=unwind for cg_clif.
2025-06-24Rollup merge of #142934 - nnethercote:tweak-macro-stats, r=petrochenkovJubilee-20/+20
Tweak `-Zmacro-stats` measurement. It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1. r? ```@petrochenkov```
2025-06-24Rollup merge of #142844 - dpaoliello:short-ice, r=jieyouxuJubilee-4/+11
Enable short-ice for Windows Works fine for x64 without modifications. x86 MSVC is still failing. Addresses item in rust-lang/rust#128602 --- try-job: x86_64-mingw-* try-job: x86_64-msvc-* try-job: i686-msvc-*
2025-06-24Rollup merge of #142825 - jdonszelmann:track-caller, r=oli-obkJubilee-14/+18
Port `#[track_caller]` to the new attribute system r? ``@oli-obk`` depends on https://github.com/rust-lang/rust/pull/142493 Closes rust-lang/rust#142783 (didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
2025-06-24Rollup merge of #142768 - scottmcm:avoid-unneeded-bitcast, r=WaffleLapkinJubilee-0/+45
Avoid a bitcast FFI call in transmuting For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
2025-06-24Rollup merge of #142633 - folkertdev:interrupt-abi-restrict-signature, ↵Jubilee-164/+400
r=workingjubilee Error on invalid signatures for interrupt ABIs We recently added `extern "custom"`, which must have type `fn()`. The various `extern "interrupt"` ABIs impose similar constraints on the signature of functions with that ABI: `x86-interrupt` should not have a return type (linting on the exact argument types is left as future work), and the other interrupt ABIs cannot have any parameters or a return type. r? ```@workingjubilee```