diff options
Diffstat (limited to 'src/test/ui/inference/need_type_info')
7 files changed, 53 insertions, 12 deletions
diff --git a/src/test/ui/inference/need_type_info/concrete-impl.stderr b/src/test/ui/inference/need_type_info/concrete-impl.stderr index b79d34aff..aa3296995 100644 --- a/src/test/ui/inference/need_type_info/concrete-impl.stderr +++ b/src/test/ui/inference/need_type_info/concrete-impl.stderr @@ -3,11 +3,6 @@ error[E0282]: type annotations needed | LL | <Struct as Ambiguous<_>>::method(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `Ambiguous` - | -help: consider specifying the generic argument - | -LL | <Struct as Ambiguous::<_>>::method(); - | ~~~~~ error[E0283]: type annotations needed --> $DIR/concrete-impl.rs:13:5 @@ -22,10 +17,6 @@ LL | impl Ambiguous<One> for Struct {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl Ambiguous<Two> for Struct {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider specifying the generic argument - | -LL | <Struct as Ambiguous::<_>>::method(); - | ~~~~~ error: aborting due to 2 previous errors diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs new file mode 100644 index 000000000..3084f6eac --- /dev/null +++ b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs @@ -0,0 +1,11 @@ +enum OhNo<T, U> { + A(T), + B(U), + C, +} + +fn uwu() { + OhNo::C::<u32, _>; //~ ERROR type annotations needed +} + +fn main() {} diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr new file mode 100644 index 000000000..2ad35ab03 --- /dev/null +++ b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/do-not-suggest-generic-arguments-for-turbofish.rs:8:5 + | +LL | OhNo::C::<u32, _>; + | ^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the enum `OhNo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs index bcd29bb4e..b0c0d3397 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs +++ b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs @@ -1,5 +1,3 @@ -#![feature(generic_associated_types)] - trait Foo { type Output<T>; diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr index 65a75b68c..cbc2477de 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr +++ b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/expr-struct-type-relative-gat.rs:17:9 + --> $DIR/expr-struct-type-relative-gat.rs:15:9 | LL | Self::Output::Simple {}; | ^^^^^^^^^^^^ cannot infer type for type parameter `T` declared on the associated type `Output` diff --git a/src/test/ui/inference/need_type_info/issue-103053.rs b/src/test/ui/inference/need_type_info/issue-103053.rs new file mode 100644 index 000000000..05169666f --- /dev/null +++ b/src/test/ui/inference/need_type_info/issue-103053.rs @@ -0,0 +1,18 @@ +trait TypeMapper { + type MapType; +} + +type Mapped<T> = <T as TypeMapper>::MapType; + +struct Test {} + +impl TypeMapper for () { + type MapType = Test; +} + +fn test() { + Mapped::<()> {}; + None; //~ ERROR type annotations needed +} + +fn main() {} diff --git a/src/test/ui/inference/need_type_info/issue-103053.stderr b/src/test/ui/inference/need_type_info/issue-103053.stderr new file mode 100644 index 000000000..84f0475d8 --- /dev/null +++ b/src/test/ui/inference/need_type_info/issue-103053.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/issue-103053.rs:15:5 + | +LL | None; + | ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option` + | +help: consider specifying the generic argument + | +LL | None::<T>; + | +++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. |