Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions compiler/rustc_typeck/src/astconv/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions src/test/ui/impl-trait/issues/universal-issue-48703.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions src/test/ui/synthetic-param.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down