about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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-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-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
2025-06-05Rollup merge of #142015 - oli-obk:wrong-instance, r=RalfJungMatthias Krüger-2/+3
Report the actual item that evaluation failed for instead of id of the last frame in the evaluation stack r? ``@RalfJung`` fixes rust-lang/rust#142010
2025-06-05Rollup merge of #141974 - Kivooeo:tf4, r=jieyouxuMatthias Krüger-170/+98
`tests/ui`: A New Order [4/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. r? ``@jieyouxu`` added stderr tag for commit which means it included generated stderr
2025-06-05Auto merge of #142070 - matthiaskrgr:rollup-e7lxtuo, r=matthiaskrgrbors-96/+112
Rollup of 6 pull requests Successful merges: - rust-lang/rust#140638 (UnsafePinned: also include the effects of UnsafeCell) - rust-lang/rust#141777 (Do not run PGO/BOLT in x64 Linux alt builds) - rust-lang/rust#141938 (update rust offload bootstrap) - rust-lang/rust#141962 (rustc-dev-guide subtree update) - rust-lang/rust#141965 (`tests/ui`: A New Order [3/N]) - rust-lang/rust#141970 (implement new `x` flag: `--skip-std-check-if-no-download-rustc`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-05Move generic arg checks from the hir item types visitor to ty wfcheckOli Scherer-14/+0
2025-06-05Move opaque type checks from the hir item types visitor onto the wfcheck of ↵Oli Scherer-124/+140
the opaqe type itself
2025-06-05Rollup merge of #141965 - Kivooeo:test-reform, r=jieyouxuMatthias Krüger-96/+112
`tests/ui`: A New Order [3/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ``@jieyouxu``
2025-06-05Auto merge of #135054 - cramertj:file-cstr, r=m-ou-sebors-0/+25
Add Location::file_with_nul This is useful for C/C++ APIs which expect the const char* returned from __FILE__ or std::source_location::file_name. ACP: https://github.com/rust-lang/libs-team/issues/466 Tracking issue: https://github.com/rust-lang/rust/issues/141727
2025-06-05Auto merge of #142033 - matthiaskrgr:rollup-99lvg0j, r=matthiaskrgrbors-353/+377
Rollup of 11 pull requests Successful merges: - rust-lang/rust#141890 (Add link to correct documentation in htmldocck.py) - rust-lang/rust#141932 (Fix for async drop inside async gen fn) - rust-lang/rust#141960 (Use non-2015 edition paths in tests that do not test for their resolution) - rust-lang/rust#141968 (Run wfcheck in one big loop instead of per module) - rust-lang/rust#141969 (Triagebot: Remove `assign.users_on_vacation`) - rust-lang/rust#141985 (Ensure query keys are printed with reduced queries) - rust-lang/rust#141999 (Visit the ident in `PreciseCapturingNonLifetimeArg`.) - rust-lang/rust#142005 (Change `tag_field` to `FieldIdx` in `Variants::Multiple`) - rust-lang/rust#142017 (Fix incorrect use of "recommend" over "recommended") - rust-lang/rust#142024 (Don't refer to 'this tail expression' in expansion.) - rust-lang/rust#142025 (Don't refer to 'local binding' in extern macro.) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-04Verbose suggestion to make param `const`Esteban Küber-9/+21
``` 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> {} | ```
2025-06-04Auto merge of #141309 - RalfJung:x86-simd-abi, r=tgross35,nikic,workingjubileebors-24/+17
x86 (32/64): go back to passing SIMD vectors by-ptr Fixes https://github.com/rust-lang/rust/issues/139029 by partially reverting https://github.com/rust-lang/rust/pull/135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it... Also fixes https://github.com/rust-lang/rust/issues/141848 by no longer actually using vector registers with the "Rust" ABI. r? `@tgross35` Cc `@nikic` try-job: `test-various*` try-job: dist-i586-gnu-i586-i686-musl try-job: x86_64-gnu-nopt try-job: `x86_64-msvc*` try-job: `i686-msvc*`
2025-06-04Rollup merge of #142025 - m-ou-se:which-local-binding, r=jdonszelmannMatthias Krüger-3/+3
Don't refer to 'local binding' in extern macro. When it comes from a macro expansion, the user has no clue what 'local binding' the compiler is talking about, if they don't know the expansion of the macro. Better to just say 'temporary value'.
2025-06-04Rollup merge of #142024 - m-ou-se:what-tail-expression, r=petrochenkovMatthias Krüger-4/+2
Don't refer to 'this tail expression' in expansion. The user has no clue what the compiler is talking about when it says "this tail expression". It is an implementation detail of the macro that it uses a block with tail expression.
2025-06-04Rollup merge of #141985 - compiler-errors:cycle-in-dep-graph-print, r=oli-obkMatthias Krüger-1/+26
Ensure query keys are printed with reduced queries Using `-Z query-dep-graph` and debug assertions leads to an ICE that was originally discovered in rust-lang/rust#141700: > This isn't an incremental bug per se, but instead a bug that has to do with debug printing query keys when debug assertions and `-Z query-dep-graph` is enabled. We end up printing a const (b/c we're using generic const args here) whose debug printing for -Z query-dep-graph requires invoking the same query cyclically 😃 > > I've pushed a commit which should fix this. This isn't related to the standard library changes, but instead b/c it seems to be the first usage of `feature(adt_const_params)` in the standard library that ends up being triggered in incremental tests. r? oli-obk
2025-06-04Rollup merge of #141968 - oli-obk:wfck-everything-at-once, r=wesleywiserMatthias Krüger-53/+53
Run wfcheck in one big loop instead of per module Maybe we can merge this big loop in the future with the `par_hir_body_owners` call below and run typeck only on items that didn't fail wfcheck. For now let's just see if perf likes it, as it by itself should be beneficial to parallel rustc
2025-06-04Rollup merge of #141960 - ferrocene:lw/2015-paths2, r=compiler-errorsMatthias Krüger-290/+290
Use non-2015 edition paths in tests that do not test for their resolution This allows for testing these tests on editions other than 2015 Follow up to https://github.com/rust-lang/rust/pull/141888
2025-06-04Rollup merge of #141932 - azhogin:azhogin/async-drop-inside-asyncgen-fix, ↵Matthias Krüger-2/+3
r=oli-obk Fix for async drop inside async gen fn Return value (for yield) is corrected for async drop inside async gen function. In CFG, when internal async drop future is polled and returned `Poll<()>::Pending`, then async gen resume function returns `Poll<(OptRet)>::Pending`. Fixes rust-lang/rust#140530
2025-06-04Add Location::file_with_nulTaylor Cramer-0/+25
This is useful for C/C++ APIs which expect the const char* returned from __FILE__ or std::source_location::file_name.
2025-06-04Fix parsing of frontmatters with inner hyphensMatthew Jasper-0/+21
2025-06-04Report the actual item that evaluation failed forOli Scherer-2/+3
2025-06-04Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`Jake Goulding-443/+429
2025-06-04Introduce the `mismatched_lifetime_syntaxes` lintJake Goulding-0/+791
2025-06-04cleaned up some testsKivooeo-170/+98
2025-06-04Rollup merge of #141959 - ferrocene:lw/2015-edition-directives2, ↵Matthias Krüger-46/+74
r=compiler-errors Add more missing 2015 edition directives These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-06-04Don't refer to 'this tail expression' in expansion.Mara Bos-4/+2
The user has no clue what tail expression the compiler is talking about: it is an implementation detail of the macro that it uses a block with tail expression.