about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-06-09Auto merge of #142234 - matthiaskrgr:rollup-kg5wibu, r=matthiaskrgrbors-10/+31
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141751 (Remap compiler vs non-compiler sources differently (bootstrap side)) - rust-lang/rust#142160 (Only allow `bootstrap` cfg in rustc & related) - rust-lang/rust#142191 (early return in trait detection for non-trait item) - rust-lang/rust#142211 (Do not checkout GCC submodule for the tidy job) - rust-lang/rust#142218 (CI: rfl: move job forward to Linux v6.16-rc1) - rust-lang/rust#142224 (Avoid a gratuitous 10s wait in a stress test) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-09Rollup merge of #142191 - bvanjoi:issue-135863, r=compiler-errorsMatthias Krüger-10/+31
early return in trait detection for non-trait item Fixes rust-lang/rust#135863
2025-06-09Auto merge of #141435 - RalfJung:unsupported_calling_conventions, ↵bors-316/+1393
r=workingjubilee Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions This adds back the `unsupported_calling_conventions` lint that was removed in https://github.com/rust-lang/rust/pull/129935, in order to start the process of dealing with https://github.com/rust-lang/rust/issues/137018. Specifically, we are going for the plan laid out [here](https://github.com/rust-lang/rust/issues/137018#issuecomment-2672118326): - thiscall, stdcall, fastcall, cdecl should only be accepted on x86-32 - vectorcall should only be accepted on x86-32 and x86-64 The difference to the status quo is that: - We stop accepting stdcall, fastcall on targets that are windows && non-x86-32 (we already don't accept these on targets that are non-windows && non-x86-32) - We stop accepting cdecl on targets that are non-x86-32 - (There is no difference for thiscall, this was already a hard error on non-x86-32) - We stop accepting vectorcall on targets that are windows && non-x86-* Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the `unsupported_calling_conventions` forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred. try-job: i686-msvc-1 try-job: x86_64-msvc-1 try-job: test-various
2025-06-09Auto merge of #142220 - workingjubilee:rollup-idgfpof, r=workingjubileebors-450/+294
Rollup of 12 pull requests Successful merges: - rust-lang/rust#141803 (Remove rustc's notion of "preferred" alignment AKA `__alignof`) - rust-lang/rust#142053 (Add new Tier-3 targets: `loongarch32-unknown-none*`) - rust-lang/rust#142089 (Replace all uses of sysroot_candidates with get_or_default_sysroot) - rust-lang/rust#142108 (compiler: Add track_caller to AbiMapping::unwrap) - rust-lang/rust#142132 (`tests/ui`: A New Order [6/N]) - rust-lang/rust#142162 (UnsafePinned: update get() docs and signature to allow shared mutation) - rust-lang/rust#142171 (`tests/ui`: A New Order [7/N]) - rust-lang/rust#142179 (store `target.min_global_align` as an `Align`) - rust-lang/rust#142183 (Added test for 30904) - rust-lang/rust#142194 (Remove all unused feature gates from the compiler) - rust-lang/rust#142199 (Do not free disk space in the `mingw-check-tidy` job) - rust-lang/rust#142210 (Run `mingw-check-tidy` on auto builds) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-08Rollup merge of #142183 - Kivooeo:30904-test, r=compiler-errorsJubilee-0/+53
Added test for 30904 Test that was deleted by mistake in this commit https://github.com/rust-lang/rust/commit/564c78a6981174b32079f576eb6e7f965a13945e#diff-85d65712084246fc61f287664eef63b0b25ba0a5c8b69a4a59a9454b6a3ebac4 The original issue is still open and the problem is not solved (if this is even a problem, but the error is still here at least)
2025-06-08Rollup merge of #142171 - Kivooeo:tf7, r=workingjubileeJubilee-19/+18
`tests/ui`: A New Order [7/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-08Rollup merge of #142132 - Kivooeo:tf6, r=workingjubileeJubilee-79/+45
`tests/ui`: A New Order [6/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `````@jieyouxu````` auxiliary tag means some changes in realted auxiliary file for test
2025-06-08Rollup merge of #142053 - heiher:loong32-none, r=wesleywiserJubilee-1/+7
Add new Tier-3 targets: `loongarch32-unknown-none*` MCP: https://github.com/rust-lang/compiler-team/issues/865 NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
2025-06-08Remove rustc's notion of "preferred" alignment AKA `__alignof`Jubilee Young-351/+171
In PR 90877 T-lang decided not to remove `intrinsics::pref_align_of`. However, the intrinsic and its supporting code 1. is a nightly feature, so can be removed at compiler/libs discretion 2. requires considerable effort in the compiler to support, as it necessarily complicates every single site reasoning about alignment 3. has been justified based on relevance to codegen, but it is only a requirement for C++ (not C, not Rust) stack frame layout for AIX, in ways Rust would not consider even with increased C++ interop 4. is only used by rustc to overalign some globals, not correctness 5. can be adequately replaced by other rules for globals, as it mostly affects alignments for a few types under 16 bytes of alignment 6. has only one clear benefactor: automating C -> Rust translation for GNU extensions like `__alignof` 7. such code was likely intended to be `alignof` or `_Alignof`, because the GNU extension is a "false friend" of the C keyword, which makes the choice to support such a mapping very questionable 8. makes it easy to do incorrect codegen in the compiler by its mere presence as usual Rust rules of alignment (e.g. `size == align * N`) do not hold with preferred alignment The implementation is clearly damaging the code quality of the compiler. Thus it is within the compiler team's purview to simply rip it out. If T-lang wishes to have this intrinsic restored for c2rust's benefit, it would have to use a radically different implementation that somehow does not cause internal incorrectness. Until then, remove the intrinsic and its supporting code, as one tool and an ill-considered GCC extension cannot justify risking correctness. Because we touch a fair amount of the compiler to change this at all, and unfortunately the duplication of AbiAndPrefAlign is deep-rooted, we keep an "AbiAlign" type which we can wean code off later.
2025-06-08Auto merge of #142008 - RalfJung:const-eval-error-here, r=oli-obkbors-930/+930
const-eval error: always say in which item the error occurred I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const. r? `@oli-obk`
2025-06-08Auto merge of #141700 - RalfJung:atomic-intrinsics-part2, r=bjorn3bors-137/+134
Atomic intrinsics : use const generic ordering, part 2 This completes what got started in https://github.com/rust-lang/rust/pull/141507 by using a const generic for the ordering for all intrinsics. It is based on that PR; only the last commit is new. Blocked on: - https://github.com/rust-lang/rust/pull/141507 - https://github.com/rust-lang/rust/pull/141687 - https://github.com/rust-lang/stdarch/pull/1811 - https://github.com/rust-lang/rust/pull/141964 r? `@bjorn3`
2025-06-08try to manually bless windows test outputRalf Jung-2/+37
2025-06-09early return in trait detection for non-trait itembohan-10/+31
2025-06-08cleaned up some testsKivooeo-19/+18
2025-06-08add specific help messages for stdcall and cdeclRalf Jung-102/+353
2025-06-08avoid repeating error annotations in test fileRalf Jung-418/+290
2025-06-08raw dylib: ensure that we have applied standard ABI checksRalf Jung-1/+27
also unify error messages that do not seem to have a good reason to be different
2025-06-08add (back) unsupported_calling_conventions lint to reject more invalid ↵Ralf Jung-222/+1115
calling conventions
2025-06-08Auto merge of #142074 - oli-obk:its-finally-gone, r=petrochenkovbors-138/+140
Remove CollectItemTypesVisitor I always felt like we were very unnecessarily walking the HIR, let's see if perf agrees There is lots to ~~improve~~ consolidate further here, as we still have 3 item wfchecks: * check_item (matching on the hir::ItemKind) * actually doing trait solver based checks (by using HIR spans) * lower_item (matching on the hir::ItemKind after loading it again??) * just ensure_ok-ing a bunch of queries * check_item_type (matching on DefKind) * some type based checks, mostly ensure_ok-ing a bunch of queries fixes rust-lang/rust#121429
2025-06-08added test for 30904Kivooeo-0/+53
2025-06-07Rollup merge of #142148 - workingjubilee:dont-ice-on-force-warn, r=UrgauGuillaume Gomez-0/+41
compiler: Treat ForceWarning as a Warning for diagnostic level This silences an ICE. No idea if this is the correct solution though tbh. Fixes rust-lang/rust#142144
2025-06-07Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=BoxyUwUGuillaume Gomez-2/+30
Treat normalizing consts like normalizing types in deeply normalize ...so that we don't end up putting a top-level normalizes-to goal in the fulfillment context, which ICEs. This basically just models the normalize-const code off of the normalize-ty code above it, which uses an alias-relate goal instead. Fixes rust-lang/rust#140571 r? lcnr
2025-06-07Rollup merge of #141661 - Urgau:deny-dangerous_implicit_autorefs, r=traviscrossGuillaume Gomez-92/+98
Make the `dangerous_implicit_autorefs` lint deny-by-default I intended for the `dangerous_implicit_autorefs` lint to be deny-by-default, the [T-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097) even clearly mentioned deny-by-default, but somehow I and other missed that it is only warn-by-default. I think the lint should still be deny-by-default as the implicit aliasing requirements can be quite dangerous. In any-case, opening this PR for T-lang awareness. `@rustbot` label +I-lang-nominated +T-lang r? `@traviscross`
2025-06-07Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomezGuillaume Gomez-26/+545
Allow `#![doc(test(attr(..)))]` everywhere This PR adds the ability to specify [`#![doc(test(attr(..)))]`](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/the-doc-attribute.html#testattr) ~~at module level~~ everywhere in addition to allowing it at crate-root. This is motivated by a recent PR #140323 (by ````@tgross35)```` where we have to duplicate 2 attributes to every single `f16` and `f128` doctests, by allowing `#![doc(test(attr(..)))]` at module level (and everywhere else) we can omit them entirely and just have (in both module): ```rust #![doc(test(attr(feature(cfg_target_has_reliable_f16_f128))))] #![doc(test(attr(expect(internal_features))))] ``` Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before). Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred. Best reviewed commit by commit. r? ````@GuillaumeGomez````
2025-06-08cleaned up some testsKivooeo-79/+45
2025-06-07cci_inrinsic tets: do not use atomic intrinsicRalf Jung-29/+14
2025-06-07intrinsics: use const generic to set atomic orderingRalf Jung-123/+135
2025-06-07Auto merge of #141964 - sayantn:update-stdarch, r=Amanieubors-2/+0
Update stdarch submodule Updates the stdarch submodule. ## Merged PRs - rust-lang/stdarch#1797 - rust-lang/stdarch#1758 - rust-lang/stdarch#1798 - rust-lang/stdarch#1811 - rust-lang/stdarch#1810 - rust-lang/stdarch#1807 - rust-lang/stdarch#1806 - rust-lang/stdarch#1812 - rust-lang/stdarch#1795 - rust-lang/stdarch#1796 - rust-lang/stdarch#1813 - rust-lang/stdarch#1816 - rust-lang/stdarch#1818 - rust-lang/stdarch#1820 - rust-lang/stdarch#1819 r? `@Amanieu` `@rustbot` label T-libs-api Closes rust-lang/rust#111137
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-930/+930
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-07compiler: Treat ForceWarning as a Warning for diagnostic levelJubilee Young-0/+41
This silences an ICE.
2025-06-07Rollup merge of #142131 - estebank:cast-sugg, r=UrgauJacob Pratt-46/+85
Make cast suggestions verbose ``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ``` Part of rust-lang/rust#141973.
2025-06-07Rollup merge of #142045 - estebank:obligation-cause-code-suggestion, ↵Jacob Pratt-48/+69
r=compiler-errors Make obligation cause code suggestions verbose ``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ``` Part of rust-lang/rust#141973
2025-06-06Rollup merge of #142113 - shepmaster:drop-order-test-confusion, r=jieyouxuGuillaume Gomez-29/+18
Reduce confusion of some drop order tests In addition to adhering to normal Rust casing idioms, I ran `rustfmt`. Closes rust-lang/rust#141604 r? `@jieyouxu`
2025-06-06Rollup merge of #142043 - estebank:const-suggestion, r=wesleywiserGuillaume Gomez-9/+21
Verbose suggestion to make param `const` ``` error[E0747]: type provided when a constant was expected --> $DIR/invalid-const-arguments.rs:10:19 | LL | impl<N> Foo for B<N> {} | ^ | help: consider changing this type parameter to a const parameter | LL - impl<N> Foo for B<N> {} LL + impl<const N: u8> Foo for B<N> {} | ``` Part of rust-lang/rust#141973.
2025-06-06reword suggestion messageEsteban Küber-9/+9
2025-06-06Make obligation cause code suggestions verboseEsteban Küber-48/+69
``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` help: remove the `.await` | LL - e!().await; LL + e!(); | ``` ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5]; | ^^^^ the trait `Copy` is not implemented for `String` | = note: required for `Option<String>` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array help: create an inline `const` block | LL | static _MAYBE_STRINGS: [Option<String>; 5] = [const { None }; 5]; | +++++++ + ```
2025-06-06Make cast suggestions verboseEsteban Küber-45/+84
``` error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; | ^^^^^^^^^^^^ invalid cast | help: try `char::from_u32` instead | LL - 1u32 as char; LL + char::from_u32(1u32); | ``` ``` error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; | ^^^^^^^^^^^^^ | help: try casting to a reference instead | LL | arr as &[char]; | + ``` ``` error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; | ^^^^^^^^^^^^^^^^^^^^^^^ | help: you can cast to a `Box` instead | LL | Box::new(1) as Box<dyn Send>; | ++++ + ```
2025-06-06Treat normalizing consts like normalizing types in deeply normalizeMichael Goulet-2/+30
2025-06-06Auto merge of #141681 - compiler-errors:fast-path-stalled, r=lcnrbors-5/+2
Fast path for stalled obligations on self ty If we see that the `self` type of a goal is an infer var, then don't try to compute the goal at all, since we know that it'll be forced ambiguous. This is currently only implemented when there are no opaques in the environment. We could extend it to check that the self type is not related to any already defined opaques via subtyping, but I'll leave that as a follow-up. --- Also stall coerce and subtype predicates if both of their vars are not resolved to concrete types. --- ~~Also, we don't care if the goal is higher-ranked for the sized and copy/clone fast path.~~ pulling this out into another PR. r? lcnr
2025-06-06Reduce confusion of some drop order testsJake Goulding-29/+18
In addition to adhering to normal Rust casing idioms, I ran `rustfmt`.
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-1/+7
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-06Rollup merge of #142092 - fmease:rustdoc-alias-terms, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: Support middle::ty associated const equality predicates again Fix intentional regression from PR rust-lang/rust#125076. Fixes rust-lang/rust#125092. Fixes rust-lang/rust#134775. CC rust-lang/rust#141368 (`EqPredicates` and rustdoc).
2025-06-06Rollup merge of #142012 - oli-obk:no-optional-spans, r=fee1-deadMatthias Krüger-4/+7
Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None Turns out many locations actually have a span available that we could use, so I used it
2025-06-06Rollup merge of #141982 - Kivooeo:tf5, r=jieyouxuMatthias Krüger-188/+135
`tests/ui`: A New Order [5/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. r? ``@jieyouxu``
2025-06-05Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax, ↵bors-406/+1183
r=traviscross,jieyouxu Add a new `mismatched-lifetime-syntaxes` lint The lang-team [discussed this](https://hackmd.io/nf4ZUYd7Rp6rq-1svJZSaQ) and I attempted to [summarize](https://github.com/rust-lang/rust/pull/120808#issuecomment-2701863833) their decision. The summary-of-the-summary is: - Using two different kinds of syntax for elided lifetimes is confusing. In rare cases, it may even [lead to unsound code](https://github.com/rust-lang/rust/issues/48686)! Some examples: ```rust // Lint will warn about these fn(v: ContainsLifetime) -> ContainsLifetime<'_>; fn(&'static u8) -> &u8; ``` - Matching up references with no lifetime syntax, references with anonymous lifetime syntax, and paths with anonymous lifetime syntax is an exception to the simplest possible rule: ```rust // Lint will not warn about these fn(&u8) -> &'_ u8; fn(&'_ u8) -> &u8; fn(&u8) -> ContainsLifetime<'_>; ``` - Having a lint for consistent syntax of elided lifetimes will make the [future goal](https://github.com/rust-lang/rust/issues/91639) of warning-by-default for paths participating in elision much simpler. --- This new lint attempts to accomplish the goal of enforcing consistent syntax. In the process, it supersedes and replaces the existing `elided-named-lifetimes` lint, which means it starts out life as warn-by-default.
2025-06-05Support middle::ty assoc const eq predicates againLeón Orell Valerian Liehr-1/+0
2025-06-05Auto merge of #142081 - matthiaskrgr:rollup-secpezz, r=matthiaskrgrbors-172/+122
Rollup of 7 pull requests Successful merges: - rust-lang/rust#141709 (jsondocck: Refactor directive handling) - rust-lang/rust#141974 (`tests/ui`: A New Order [4/N]) - rust-lang/rust#141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately) - rust-lang/rust#142015 (Report the actual item that evaluation failed for) - rust-lang/rust#142026 (bootstrap: Fix file permissions when dereferencing symlinks) - rust-lang/rust#142032 (Fix parsing of frontmatters with inner hyphens) - rust-lang/rust#142036 (Update the `compiler-builtins` subtree) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-05cleaned up some testsKivooeo-188/+135
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-4/+7
2025-06-05Rollup merge of #142032 - matthewjasper:frontmatter-lexing, r=fee1-deadMatthias Krüger-0/+21
Fix parsing of frontmatters with inner hyphens closes rust-lang/rust#141483 r? fee1-dead