diff options
| author | Jakub Kądziołka <kuba@kadziolka.net> | 2021-11-08 18:39:22 +0100 |
|---|---|---|
| committer | Jakub Kądziołka <kuba@kadziolka.net> | 2021-11-08 19:49:41 +0100 |
| commit | 048e1c942d21a143d1faf8077a6fee9c43dc8de1 (patch) | |
| tree | eda0fd922b64c54b44cf356f6bd81a9a7bf036cf | |
| parent | 3e3890c9d4064253aaa8c51f5d5458d2dc6dab77 (diff) | |
| download | rust-048e1c942d21a143d1faf8077a6fee9c43dc8de1.tar.gz rust-048e1c942d21a143d1faf8077a6fee9c43dc8de1.zip | |
Add a note about feature(explicit_generic_args_with_impl_trait) to the relevant error message
6 files changed, 32 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs index 84327a2880e..2f187997b55 100644 --- a/compiler/rustc_typeck/src/astconv/generics.rs +++ b/compiler/rustc_typeck/src/astconv/generics.rs @@ -672,6 +672,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { err.span_label(span, "explicit generic argument not allowed"); } + err.note( + "see issue #83701 <https://github.com/rust-lang/rust/issues/83701> \ + for more information", + ); + if tcx.sess.is_nightly_build() { + err.help( + "add `#![feature(explicit_generic_args_with_impl_trait)]` \ + to the crate attributes to enable", + ); + } + err.emit(); } diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr index 6268a564b06..87e4ad50040 100644 --- a/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr @@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use | LL | assert_eq!(f::<4usize>(Usizable), 20usize); | ^^^^^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr index 6adc4e6b239..a25c85faf4e 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr @@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use | LL | foo::<str>("".to_string()); | ^^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/impl-trait/issues/universal-issue-48703.stderr b/src/test/ui/impl-trait/issues/universal-issue-48703.stderr index 6800b37b5b1..90c252537ef 100644 --- a/src/test/ui/impl-trait/issues/universal-issue-48703.stderr +++ b/src/test/ui/impl-trait/issues/universal-issue-48703.stderr @@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use | LL | foo::<String>('a'); | ^^^^^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/impl-trait/issues/universal-turbofish-in-method-issue-50950.stderr b/src/test/ui/impl-trait/issues/universal-turbofish-in-method-issue-50950.stderr index db66d461095..84b98f71f4f 100644 --- a/src/test/ui/impl-trait/issues/universal-turbofish-in-method-issue-50950.stderr +++ b/src/test/ui/impl-trait/issues/universal-turbofish-in-method-issue-50950.stderr @@ -5,6 +5,9 @@ LL | evt.handle_event::<TestEvent, fn(TestEvent)>(|_evt| { | ^^^^^^^^^ ^^^^^^^^^^^^^ explicit generic argument not allowed | | | explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/synthetic-param.stderr b/src/test/ui/synthetic-param.stderr index 101132d05fa..5cb9ad31fbf 100644 --- a/src/test/ui/synthetic-param.stderr +++ b/src/test/ui/synthetic-param.stderr @@ -3,18 +3,27 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use | LL | func::<u8>(42); | ^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position --> $DIR/synthetic-param.rs:23:17 | LL | Foo::func::<u8>(42); | ^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position --> $DIR/synthetic-param.rs:26:23 | LL | Bar::<i8>::func::<u8>(42); | ^^ explicit generic argument not allowed + | + = note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information + = help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable error: aborting due to 3 previous errors |
