diff options
| author | Nick Cameron <nrc@ncameron.org> | 2022-05-09 15:14:43 +0100 |
|---|---|---|
| committer | Nick Cameron <nrc@ncameron.org> | 2022-06-06 12:21:49 +0100 |
| commit | 640a46138839dbb5d9bf8df0e8b9cbec1d8e5ded (patch) | |
| tree | 282ba19f552fc560473f4e940e664826af212ce2 /src/test/ui/impl-trait/explicit-generic-args-with-impl-trait | |
| parent | 12872b6807dbfca49e903ba13e375b960e0bdd4d (diff) | |
| download | rust-640a46138839dbb5d9bf8df0e8b9cbec1d8e5ded.tar.gz rust-640a46138839dbb5d9bf8df0e8b9cbec1d8e5ded.zip | |
Deactivate feature gate explicit_generic_args_with_impl_trait
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Diffstat (limited to 'src/test/ui/impl-trait/explicit-generic-args-with-impl-trait')
9 files changed, 25 insertions, 31 deletions
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/const-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/const-args.rs new file mode 100644 index 00000000000..1aa23c60823 --- /dev/null +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/const-args.rs @@ -0,0 +1,21 @@ +// check-pass + +trait Usizer { + fn m(self) -> usize; +} + +fn f<const N: usize>(u: impl Usizer) -> usize { + N + u.m() +} + +struct Usizable; + +impl Usizer for Usizable { + fn m(self) -> usize { + 16 + } +} + +fn main() { + assert_eq!(f::<4usize>(Usizable), 20usize); +} diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs index 832a3e3b7b1..3b1024d6126 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs @@ -1,5 +1,3 @@ -#![feature(explicit_generic_args_with_impl_trait)] - fn foo<T: ?Sized>(_f: impl AsRef<T>) {} fn main() { diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr index 2ae7745c725..c8b82783ea8 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr @@ -1,5 +1,5 @@ error[E0107]: this function takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/explicit-generic-args-for-impl.rs:6:5 + --> $DIR/explicit-generic-args-for-impl.rs:4:5 | LL | foo::<str, String>("".to_string()); | ^^^ ------ help: remove this generic argument @@ -7,7 +7,7 @@ LL | foo::<str, String>("".to_string()); | expected 1 generic argument | note: function defined here, with 1 generic parameter: `T` - --> $DIR/explicit-generic-args-for-impl.rs:3:4 + --> $DIR/explicit-generic-args-for-impl.rs:1:4 | LL | fn foo<T: ?Sized>(_f: impl AsRef<T>) {} | ^^^ - diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs index a6585bcf848..99e0931ab95 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(explicit_generic_args_with_impl_trait)] - fn foo<T: ?Sized>(_f: impl AsRef<T>) {} fn main() { diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs deleted file mode 100644 index 0e4d6986d46..00000000000 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs +++ /dev/null @@ -1,7 +0,0 @@ -// gate-test-explicit_generic_args_with_impl_trait - -fn foo<T: ?Sized>(_f: impl AsRef<T>) {} - -fn main() { - foo::<str>("".to_string()); //~ ERROR E0632 -} 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 deleted file mode 100644 index a25c85faf4e..00000000000 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position - --> $DIR/feature-gate.rs:6:11 - | -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 - -For more information about this error, try `rustc --explain E0632`. diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs index e2ee63821ae..987df499734 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(explicit_generic_args_with_impl_trait)] - fn f<T: ?Sized>(_: impl AsRef<T>, _: impl AsRef<T>) {} fn main() { diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs index ffb0582fe8d..7249a36f5fe 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs @@ -1,5 +1,3 @@ -#![feature(explicit_generic_args_with_impl_trait)] - fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {} fn main() { diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr index b6701b68fd6..9d6db88d364 100644 --- a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr +++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr @@ -1,5 +1,5 @@ error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied - --> $DIR/not-enough-args.rs:6:5 + --> $DIR/not-enough-args.rs:4:5 | LL | f::<[u8]>("a", b"a"); | ^ ---- supplied 1 generic argument @@ -7,7 +7,7 @@ LL | f::<[u8]>("a", b"a"); | expected 2 generic arguments | note: function defined here, with 2 generic parameters: `T`, `U` - --> $DIR/not-enough-args.rs:3:4 + --> $DIR/not-enough-args.rs:1:4 | LL | fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {} | ^ - - |
