-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #98967 - ClementTsang:fix_inaccessible_type_alias_plu…
…ral_typo, r=lcnr fix typo in note about multiple inaccessible type aliases Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope but there are multiple inaccessible type aliases that match the missing type. In general this change would use the correct plural form in this scenario for base words that end with 's'.
- Loading branch information
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mod a { | ||
type Foo = u64; | ||
type Bar = u64; | ||
} | ||
|
||
mod b { | ||
type Foo = u64; | ||
} | ||
|
||
fn main() { | ||
let x: Foo = 100; //~ ERROR: cannot find type `Foo` in this scope | ||
let y: Bar = 100; //~ ERROR: cannot find type `Bar` in this scope | ||
println!("x: {}, y: {}", x, y); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0412]: cannot find type `Foo` in this scope | ||
--> $DIR/inaccessible_type_aliases.rs:11:12 | ||
| | ||
LL | let x: Foo = 100; | ||
| ^^^ not found in this scope | ||
| | ||
note: these type aliases exist but are inaccessible | ||
--> $DIR/inaccessible_type_aliases.rs:2:5 | ||
| | ||
LL | type Foo = u64; | ||
| ^^^^^^^^^^^^^^^ `a::Foo`: not accessible | ||
... | ||
LL | type Foo = u64; | ||
| ^^^^^^^^^^^^^^^ `b::Foo`: not accessible | ||
|
||
error[E0412]: cannot find type `Bar` in this scope | ||
--> $DIR/inaccessible_type_aliases.rs:12:12 | ||
| | ||
LL | let y: Bar = 100; | ||
| ^^^ not found in this scope | ||
| | ||
note: type alias `a::Bar` exists but is inaccessible | ||
--> $DIR/inaccessible_type_aliases.rs:3:5 | ||
| | ||
LL | type Bar = u64; | ||
| ^^^^^^^^^^^^^^^ not accessible | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0412`. |