rust/src
Stuart Cook efbc8957a6
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 17:29:41 +11:00
..
bootstrap Auto merge of #152677 - ehuss:bootstrap-json-target-spec, r=davidtwco,jieyouxu 2026-02-17 17:35:50 +00:00
build_helper citool: report debuginfo test statistics 2026-02-04 06:44:09 +05:30
ci Rollup merge of #152609 - mati865:gnullvm-llvm-dll, r=bjorn3 2026-02-17 14:18:43 +01:00
doc Remove last remnants of rustc_query_system. 2026-02-16 22:56:47 +11:00
etc fixup debugger files wrt to MaybeDangling 2025-12-26 22:02:17 +01:00
gcc@efdd0a7290 Update GCC submodule 2026-02-14 16:59:09 +01:00
librustdoc Rollup merge of #152664 - Embers-of-the-Fire:fix-152601, r=GuillaumeGomez 2026-02-17 13:02:24 +11:00
llvm-project@a306f6a8c5 Update to LLVM 22 rc 3 2026-02-10 10:11:25 +01:00
rustc-std-workspace Generalize branch references to HEAD 2025-11-02 11:15:55 +01:00
rustdoc-json-types rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution 2025-11-21 09:22:59 +00:00
tools Rollup merge of #145399 - estebank:resolve-error-wording-2, r=petrochenkov 2026-02-18 17:29:41 +11:00
README.md
stage0 Bump stage0 2026-01-21 20:03:56 -05:00
version Bump version to 1.95.0 2026-01-17 10:19:26 -05:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.