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 \ + 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 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::("".to_string()); | ^^^ explicit generic argument not allowed + | + = note: see issue #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::('a'); | ^^^^^^ explicit generic argument not allowed + | + = note: see issue #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::(|_evt| { | ^^^^^^^^^ ^^^^^^^^^^^^^ explicit generic argument not allowed | | | explicit generic argument not allowed + | + = note: see issue #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::(42); | ^^ explicit generic argument not allowed + | + = note: see issue #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::(42); | ^^ explicit generic argument not allowed + | + = note: see issue #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::::func::(42); | ^^ explicit generic argument not allowed + | + = note: see issue #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