11error: this relaxed bound is not permitted here
2- --> $DIR/more_maybe_bounds.rs:23 :37
2+ --> $DIR/more_maybe_bounds.rs:21 :37
33 |
44LL | fn baz<T>() where T: Iterator<Item: ?Trait1> {}
55 | ^^^^^^^
66 |
77 = note: in this context, relaxed bounds are only allowed on type parameters defined on the closest item
88
99error: this relaxed bound is not permitted here
10- --> $DIR/more_maybe_bounds.rs:29 :21
10+ --> $DIR/more_maybe_bounds.rs:28 :21
1111 |
1212LL | fn f() where T: ?Trait1 {}
1313 | ^^^^^^^
@@ -22,29 +22,69 @@ LL | struct S2<T>(T) where for<'a> T: ?Trait5<'a>;
2222 |
2323 = note: in this context, relaxed bounds are only allowed on type parameters defined on the closest item
2424
25- error: bound modifier `?` can only be applied to default traits like `Sized`
26- --> $DIR/more_maybe_bounds.rs:17:20
25+ error: bound modifier `?` can only be applied to default traits
26+ --> $DIR/more_maybe_bounds.rs:6:15
27+ |
28+ LL | trait Trait3: ?Trait1 {}
29+ | ^^^^^^^
30+
31+ error: bound modifier `?` can only be applied to default traits
32+ --> $DIR/more_maybe_bounds.rs:6:15
33+ |
34+ LL | trait Trait3: ?Trait1 {}
35+ | ^^^^^^^
36+ |
37+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
38+
39+ error: bound modifier `?` can only be applied to default traits
40+ --> $DIR/more_maybe_bounds.rs:6:15
41+ |
42+ LL | trait Trait3: ?Trait1 {}
43+ | ^^^^^^^
44+ |
45+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
46+
47+ error: bound modifier `?` can only be applied to default traits
48+ --> $DIR/more_maybe_bounds.rs:13:29
49+ |
50+ LL | fn foo(_: Box<(dyn Trait3 + ?Trait2)>) {}
51+ | ^^^^^^^
52+
53+ error: bound modifier `?` can only be applied to default traits
54+ --> $DIR/more_maybe_bounds.rs:16:20
2755 |
2856LL | fn bar<T: ?Sized + ?Trait2 + ?Trait1 + ?Trait4>(_: &T) {}
2957 | ^^^^^^^
3058
31- error: bound modifier `?` can only be applied to default traits like `Sized`
32- --> $DIR/more_maybe_bounds.rs:17 :30
59+ error: bound modifier `?` can only be applied to default traits
60+ --> $DIR/more_maybe_bounds.rs:16 :30
3361 |
3462LL | fn bar<T: ?Sized + ?Trait2 + ?Trait1 + ?Trait4>(_: &T) {}
3563 | ^^^^^^^
3664
37- error: bound modifier `?` can only be applied to default traits like `Sized`
38- --> $DIR/more_maybe_bounds.rs:17 :40
65+ error: bound modifier `?` can only be applied to default traits
66+ --> $DIR/more_maybe_bounds.rs:16 :40
3967 |
4068LL | fn bar<T: ?Sized + ?Trait2 + ?Trait1 + ?Trait4>(_: &T) {}
4169 | ^^^^^^^
4270
43- error: bound modifier `?` can only be applied to default traits like `Sized`
71+ error: bound modifier `?` can only be applied to default traits
72+ --> $DIR/more_maybe_bounds.rs:21:37
73+ |
74+ LL | fn baz<T>() where T: Iterator<Item: ?Trait1> {}
75+ | ^^^^^^^
76+
77+ error: bound modifier `?` can only be applied to default traits
4478 --> $DIR/more_maybe_bounds.rs:35:34
4579 |
4680LL | struct S2<T>(T) where for<'a> T: ?Trait5<'a>;
4781 | ^^^^^^^^^^^
4882
49- error: aborting due to 7 previous errors
83+ error: bound modifier `?` can only be applied to default traits
84+ --> $DIR/more_maybe_bounds.rs:28:21
85+ |
86+ LL | fn f() where T: ?Trait1 {}
87+ | ^^^^^^^
88+
89+ error: aborting due to 13 previous errors
5090
0 commit comments