diff options
| author | Bryanskiy <ivakin.kir@gmail.com> | 2025-08-24 21:29:26 +0300 |
|---|---|---|
| committer | Bryanskiy <ivakin.kir@gmail.com> | 2025-09-10 15:08:08 +0300 |
| commit | 3ab7b397bbd27d220d1eebc1b21963235dd26711 (patch) | |
| tree | c1fb5eea0054a90677bb1c5596ffd36363aef965 /tests/ui/traits | |
| parent | bd089e1e6e52256c0535f19f58b4b6fe9609b70c (diff) | |
| download | rust-3ab7b397bbd27d220d1eebc1b21963235dd26711.tar.gz rust-3ab7b397bbd27d220d1eebc1b21963235dd26711.zip | |
Permit `more_maybe_bounds` in supertraits and trait objects only
Diffstat (limited to 'tests/ui/traits')
| -rw-r--r-- | tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs | 7 | ||||
| -rw-r--r-- | tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.stderr | 10 |
2 files changed, 7 insertions, 10 deletions
diff --git a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs index 820132b4e54..ac4c4aca2ef 100644 --- a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs +++ b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs @@ -42,11 +42,8 @@ struct LeakS; mod supertraits { use crate::*; - trait MaybeLeakT1: ?Leak {} - trait MaybeLeakT2 where Self: ?Leak {} - - impl MaybeLeakT1 for NonLeakS {} - impl MaybeLeakT2 for NonLeakS {} + trait MaybeLeak: ?Leak {} + impl MaybeLeak for NonLeakS {} trait LeakT {} impl LeakT for NonLeakS {} diff --git a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.stderr b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.stderr index 95c77b1756c..ab62ab81b21 100644 --- a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.stderr +++ b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NonLeakS: Leak` is not satisfied - --> $DIR/maybe-bounds-in-traits.rs:52:20 + --> $DIR/maybe-bounds-in-traits.rs:49:20 | LL | impl LeakT for NonLeakS {} | ^^^^^^^^ unsatisfied trait bound @@ -10,13 +10,13 @@ help: the trait `Leak` is not implemented for `NonLeakS` LL | struct NonLeakS; | ^^^^^^^^^^^^^^^ note: required by a bound in `LeakT` - --> $DIR/maybe-bounds-in-traits.rs:51:5 + --> $DIR/maybe-bounds-in-traits.rs:48:5 | LL | trait LeakT {} | ^^^^^^^^^^^^^^ required by this bound in `LeakT` error[E0277]: the trait bound `NonLeakS: Leak` is not satisfied - --> $DIR/maybe-bounds-in-traits.rs:61:22 + --> $DIR/maybe-bounds-in-traits.rs:58:22 | LL | type Leak2 = NonLeakS; | ^^^^^^^^ unsatisfied trait bound @@ -27,13 +27,13 @@ help: the trait `Leak` is not implemented for `NonLeakS` LL | struct NonLeakS; | ^^^^^^^^^^^^^^^ note: required by a bound in `Test1::Leak2` - --> $DIR/maybe-bounds-in-traits.rs:61:9 + --> $DIR/maybe-bounds-in-traits.rs:58:9 | LL | type Leak2 = NonLeakS; | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Test1::Leak2` error[E0658]: `&mut Self` cannot be used as the type of `self` without the `arbitrary_self_types` feature - --> $DIR/maybe-bounds-in-traits.rs:80:20 + --> $DIR/maybe-bounds-in-traits.rs:77:20 | LL | fn mut_foo(&mut self) {} | ^^^^^^^^^ |
