diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-12-04 15:08:14 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-12-04 15:08:14 +0000 |
| commit | e6a14c033640dff9a8cb39bdc39b5e62ec46fc3f (patch) | |
| tree | e02aef7f09944881c3dbe2b06276214bfd50b12d /tests/ui/rfcs | |
| parent | 0a83e43f282353398e4b22466cf1f4e3cc8c1682 (diff) | |
| download | rust-e6a14c033640dff9a8cb39bdc39b5e62ec46fc3f.tar.gz rust-e6a14c033640dff9a8cb39bdc39b5e62ec46fc3f.zip | |
Use default params until effects in desugaring
Diffstat (limited to 'tests/ui/rfcs')
3 files changed, 19 insertions, 6 deletions
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs new file mode 100644 index 00000000000..e216f687913 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/effect-param-infer.rs @@ -0,0 +1,15 @@ +// Ensure that we don't get a mismatch error when inserting the host param +// at the end of generic args when the generics have defaulted params. +// +// check-pass + +#![feature(const_trait_impl, effects)] + +#[const_trait] +pub trait Foo<Rhs: ?Sized = Self> { + /* stuff */ +} + +impl const Foo for () {} + +fn main() {} diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs index ecf45c97dcd..2c6fd83484f 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs @@ -21,8 +21,7 @@ trait Add<Rhs = Self> { fn add(self, rhs: Rhs) -> Self::Output; } -// FIXME(effects) we shouldn't need to have to specify `Rhs`. -impl const Add<i32> for i32 { +impl const Add for i32 { type Output = i32; fn add(self, rhs: i32) -> i32 { loop {} @@ -353,8 +352,7 @@ where } } -// FIXME(effects): again, this should not error without Rhs specified -impl PartialEq<str> for str { +impl PartialEq for str { fn eq(&self, other: &str) -> bool { loop {} } diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr index 461133e6c3e..3c1e6dda85c 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.stderr @@ -1,5 +1,5 @@ error[E0493]: destructor of `Self` cannot be evaluated at compile-time - --> $DIR/minicore.rs:503:9 + --> $DIR/minicore.rs:501:9 | LL | *self = source.clone() | ^^^^^ @@ -8,7 +8,7 @@ LL | *self = source.clone() | value is dropped here error[E0493]: destructor of `T` cannot be evaluated at compile-time - --> $DIR/minicore.rs:513:35 + --> $DIR/minicore.rs:511:35 | LL | const fn drop<T: ~const Destruct>(_: T) {} | ^ - value is dropped here |
