Skip to content

Commit 9399216

Browse files
authored
Rollup merge of #90708 - NieDzejkob:feature-note, r=jackh726
Add a note about feature(explicit_generic_args_with_impl_trait) to the relevant error message Fixes #90615
2 parents ba55589 + 048e1c9 commit 9399216

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed

compiler/rustc_typeck/src/astconv/generics.rs

+11
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
672672
err.span_label(span, "explicit generic argument not allowed");
673673
}
674674

675+
err.note(
676+
"see issue #83701 <https://github.com/rust-lang/rust/issues/83701> \
677+
for more information",
678+
);
679+
if tcx.sess.is_nightly_build() {
680+
err.help(
681+
"add `#![feature(explicit_generic_args_with_impl_trait)]` \
682+
to the crate attributes to enable",
683+
);
684+
}
685+
675686
err.emit();
676687
}
677688

src/test/ui/const-generics/impl-trait-with-const-arguments.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use
33
|
44
LL | assert_eq!(f::<4usize>(Usizable), 20usize);
55
| ^^^^^^ explicit generic argument not allowed
6+
|
7+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
8+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
69

710
error: aborting due to previous error
811

src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use
33
|
44
LL | foo::<str>("".to_string());
55
| ^^^ explicit generic argument not allowed
6+
|
7+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
8+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
69

710
error: aborting due to previous error
811

src/test/ui/impl-trait/issues/universal-issue-48703.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use
33
|
44
LL | foo::<String>('a');
55
| ^^^^^^ explicit generic argument not allowed
6+
|
7+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
8+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
69

710
error: aborting due to previous error
811

src/test/ui/impl-trait/issues/universal-turbofish-in-method-issue-50950.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LL | evt.handle_event::<TestEvent, fn(TestEvent)>(|_evt| {
55
| ^^^^^^^^^ ^^^^^^^^^^^^^ explicit generic argument not allowed
66
| |
77
| explicit generic argument not allowed
8+
|
9+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
10+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
811

912
error: aborting due to previous error
1013

src/test/ui/synthetic-param.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is use
33
|
44
LL | func::<u8>(42);
55
| ^^ explicit generic argument not allowed
6+
|
7+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
8+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
69

710
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
811
--> $DIR/synthetic-param.rs:23:17
912
|
1013
LL | Foo::func::<u8>(42);
1114
| ^^ explicit generic argument not allowed
15+
|
16+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
17+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
1218

1319
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
1420
--> $DIR/synthetic-param.rs:26:23
1521
|
1622
LL | Bar::<i8>::func::<u8>(42);
1723
| ^^ explicit generic argument not allowed
24+
|
25+
= note: see issue #83701 <https://github.com/rust-lang/rust/issues/83701> for more information
26+
= help: add `#![feature(explicit_generic_args_with_impl_trait)]` to the crate attributes to enable
1827

1928
error: aborting due to 3 previous errors
2029

0 commit comments

Comments
 (0)