rust/tests/ui/use
Rust timing bot d060fad6ee
Unrolled build for #145399
Rollup merge of #145399 - estebank:resolve-error-wording-2, r=petrochenkov

Unify wording of resolve error

Remove "failed to resolve" from the main error message and use the same format we use in other resolution errors "cannot find `name`":

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```

The intent behind this is to end up with all resolve errors eventually be on the form of

```
error[ECODE]: cannot find `{NAME}` in {SCOPE}
  --> $DIR/file.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ {SPECIFIC LABEL}
```

A category of errors that is interest are those that involve keywords. For example:

```
error[E0433]: cannot find `Self` in this scope
  --> $DIR/issue-97194.rs:2:35
   |
LL |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
   |                                   ^^^^ `Self` is only available in impls, traits, and type definitions
```
and

```
error[E0433]: cannot find `super` in this scope
  --> $DIR/keyword-super.rs:2:9
   |
LL |     let super: isize;
   |         ^^^^^ there are too many leading `super` keywords
```

For these the label provides the actual help, while the message is less informative beyond telling you "couldn't find `name`".

This is an off-shoot of https://github.com/rust-lang/rust/pull/126810 and https://github.com/rust-lang/rust/pull/128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov
2026-02-18 18:17:37 +01:00
..
auxiliary replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
use-mod Use non-2015 edition paths in tests that do not test for their resolution 2025-06-05 09:19:31 +02:00
import_trait_associated_functions-2015.rs Implement use associated items of traits 2025-01-16 16:34:05 +08:00
import_trait_associated_functions.rs Implement use associated items of traits 2025-01-16 16:34:05 +08:00
import_trait_associated_item_bad.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
import_trait_associated_item_bad.stderr resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
import_trait_associated_item_glob.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
issue-18986.rs
issue-18986.stderr Add support for trait object types in type_info reflection 2026-01-27 19:49:09 -04:00
issue-60976-extern-use-primitive-type.rs
unused-trait-with-method-err.rs Suppress import errors for traits that couldve applied in method lookup on error 2024-10-14 14:40:11 -04:00
unused-trait-with-method-err.stderr Suppress import errors for traits that couldve applied in method lookup on error 2024-10-14 14:40:11 -04:00
use-after-move-based-on-type.rs
use-after-move-based-on-type.stderr Do not mention -Zmacro-backtrace for std macros that are a wrapper around a compiler intrinsic 2026-01-26 17:34:31 +00:00
use-after-move-implicity-coerced-object.rs
use-after-move-implicity-coerced-object.stderr Mention type that could be Clone but isn't in more cases 2025-07-25 18:34:10 +00:00
use-after-move-self-based-on-type.rs
use-after-move-self-based-on-type.stderr
use-after-move-self.rs
use-after-move-self.stderr
use-associated-const.rs
use-associated-const.stderr
use-crate-self.rs
use-crate-self.stderr
use-from-trait-xc.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
use-from-trait-xc.stderr resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
use-from-trait.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
use-from-trait.stderr resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
use-keyword.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
use-keyword.stderr
use-meta-mismatch.rs compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
use-meta-mismatch.stderr compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
use-nested-groups-error.rs
use-nested-groups-error.stderr
use-nested-groups-unused-imports.rs
use-nested-groups-unused-imports.stderr
use-path-segment-kw.rs Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use-path-segment-kw.stderr Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use-paths-as-items.rs
use-paths-as-items.stderr
use-self-type.rs Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use-self-type.stderr Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use-super-global-path.rs Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use-super-global-path.stderr Unify wording of resolve error 2026-02-17 16:51:44 +00:00
use.rs remove #![allow(stable_features)] from most tests 2026-02-17 08:45:08 +00:00