diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-07-06 14:49:12 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-06 14:49:12 +0530 |
| commit | 41e30e3371bfc15dcdcb69dc7568e7573c80ae68 (patch) | |
| tree | 66d19a1b21f12f9c306e2eb07ee74155aca261a8 /src | |
| parent | 56667b5a0703c9fe2056a19ae161d6ac722a9bc5 (diff) | |
| parent | 503c66992737d81e64b38a123ad9ac00dd88cf38 (diff) | |
| download | rust-41e30e3371bfc15dcdcb69dc7568e7573c80ae68.tar.gz rust-41e30e3371bfc15dcdcb69dc7568e7573c80ae68.zip | |
Rollup merge of #98967 - ClementTsang:fix_inaccessible_type_alias_plural_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'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/imports/inaccessible_type_aliases.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/imports/inaccessible_type_aliases.stderr | 30 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/test/ui/imports/inaccessible_type_aliases.rs b/src/test/ui/imports/inaccessible_type_aliases.rs new file mode 100644 index 00000000000..c3d4214e282 --- /dev/null +++ b/src/test/ui/imports/inaccessible_type_aliases.rs @@ -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); +} diff --git a/src/test/ui/imports/inaccessible_type_aliases.stderr b/src/test/ui/imports/inaccessible_type_aliases.stderr new file mode 100644 index 00000000000..ef224246061 --- /dev/null +++ b/src/test/ui/imports/inaccessible_type_aliases.stderr @@ -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`. |
