diff options
| author | bors <bors@rust-lang.org> | 2022-02-02 09:39:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-02 09:39:18 +0000 |
| commit | 250384edc5d78533e993f38c60d64e42b21684b2 (patch) | |
| tree | ccf15ae68cfe680aa65f11310e7006faf94401ae /src/test/ui | |
| parent | d5f9c40e6a9ecc62432e71e886cef83a4c2c9b98 (diff) | |
| parent | 344bb595302b1c20c212598e84c74f28030da3ad (diff) | |
| download | rust-250384edc5d78533e993f38c60d64e42b21684b2.tar.gz rust-250384edc5d78533e993f38c60d64e42b21684b2.zip | |
Auto merge of #93573 - matthiaskrgr:rollup-nrjmygz, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #92758 (librustdoc: impl core::fmt::Write for rustdoc::html::render::Buffer) - #92788 (Detect `::` -> `:` typo in type argument) - #93420 (Improve wrapping on settings page) - #93493 (Document valid values of the char type) - #93531 (Fix incorrect panic message in example) - #93559 (Add missing | between print options) - #93560 (Fix two incorrect "it's" (typos in comments)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr | 46 |
2 files changed, 60 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs new file mode 100644 index 00000000000..48d19f6dd4e --- /dev/null +++ b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.rs @@ -0,0 +1,14 @@ +enum A { + B, +} + +fn main() { + let _: Vec<A:B> = A::B; + //~^ ERROR cannot find trait `B` in this scope + //~| HELP you might have meant to write a path instead of an associated type bound + //~| ERROR associated type bounds are unstable + //~| HELP add `#![feature(associated_type_bounds)]` to the crate attributes to enable + //~| ERROR struct takes at least 1 generic argument but 0 generic arguments were supplied + //~| HELP add missing generic argument + //~| ERROR associated type bindings are not allowed here +} diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr new file mode 100644 index 00000000000..951ff23d635 --- /dev/null +++ b/src/test/ui/suggestions/type-ascription-instead-of-path-in-type.stderr @@ -0,0 +1,46 @@ +error[E0405]: cannot find trait `B` in this scope + --> $DIR/type-ascription-instead-of-path-in-type.rs:6:18 + | +LL | let _: Vec<A:B> = A::B; + | ^ not found in this scope + | +help: you might have meant to write a path instead of an associated type bound + | +LL | let _: Vec<A::B> = A::B; + | ~~ + +error[E0658]: associated type bounds are unstable + --> $DIR/type-ascription-instead-of-path-in-type.rs:6:16 + | +LL | let _: Vec<A:B> = A::B; + | ^^^ + | + = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information + = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable + +error[E0107]: this struct takes at least 1 generic argument but 0 generic arguments were supplied + --> $DIR/type-ascription-instead-of-path-in-type.rs:6:12 + | +LL | let _: Vec<A:B> = A::B; + | ^^^ expected at least 1 generic argument + | +note: struct defined here, with at least 1 generic parameter: `T` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | +LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> { + | ^^^ - +help: add missing generic argument + | +LL | let _: Vec<T, A:B> = A::B; + | ++ + +error[E0229]: associated type bindings are not allowed here + --> $DIR/type-ascription-instead-of-path-in-type.rs:6:16 + | +LL | let _: Vec<A:B> = A::B; + | ^^^ associated type not allowed here + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0107, E0229, E0405, E0658. +For more information about an error, try `rustc --explain E0107`. |
