Skip to content

Commit fda5a39

Browse files
author
Lukas Markeffsky
committed
oh no
1 parent 92742a5 commit fda5a39

File tree

40 files changed

+927
-99
lines changed

40 files changed

+927
-99
lines changed

tests/ui/associated-types/hr-associated-type-bound-1.stderr

+39-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,43 @@ LL | where
1414
LL | for<'b> <Self as X<'b>>::U: Clone,
1515
| ^^^^^ required by this bound in `X`
1616

17-
error: aborting due to 1 previous error
17+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
18+
--> $DIR/hr-associated-type-bound-1.rs:11:6
19+
|
20+
LL | impl X<'_> for i32 {
21+
| ^^^^^ expected `()`, found `usize`
22+
|
23+
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Thin`
24+
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Sized`
25+
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Clone`
26+
note: required by a bound in `X`
27+
--> $DIR/hr-associated-type-bound-1.rs:3:33
28+
|
29+
LL | trait X<'a>
30+
| - required by a bound in this trait
31+
LL | where
32+
LL | for<'b> <Self as X<'b>>::U: Clone,
33+
| ^^^^^ required by this bound in `X`
34+
35+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
36+
--> $DIR/hr-associated-type-bound-1.rs:12:14
37+
|
38+
LL | type U = str;
39+
| ^^^ expected `()`, found `usize`
40+
|
41+
= note: required for `str` to implement `Thin`
42+
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Sized`
43+
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Clone`
44+
note: required by a bound in `X`
45+
--> $DIR/hr-associated-type-bound-1.rs:3:33
46+
|
47+
LL | trait X<'a>
48+
| - required by a bound in this trait
49+
LL | where
50+
LL | for<'b> <Self as X<'b>>::U: Clone,
51+
| ^^^^^ required by this bound in `X`
52+
53+
error: aborting due to 3 previous errors
1854

19-
For more information about this error, try `rustc --explain E0277`.
55+
Some errors have detailed explanations: E0271, E0277.
56+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/hr-associated-type-bound-param-1.stderr

+39-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,43 @@ LL | trait Y<'a, T: ?Sized>
1414
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
1515
| ^^^^^ required by this bound in `Y`
1616

17-
error: aborting due to 1 previous error
17+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
18+
--> $DIR/hr-associated-type-bound-param-1.rs:13:10
19+
|
20+
LL | impl<'a> Y<'a, u8> for u8 {
21+
| ^^^^^^^^^ expected `()`, found `usize`
22+
|
23+
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Thin`
24+
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Sized`
25+
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Clone`
26+
note: required by a bound in `Y`
27+
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
28+
|
29+
LL | trait Y<'a, T: ?Sized>
30+
| - required by a bound in this trait
31+
...
32+
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
33+
| ^^^^^ required by this bound in `Y`
34+
35+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
36+
--> $DIR/hr-associated-type-bound-param-1.rs:14:14
37+
|
38+
LL | type V = str;
39+
| ^^^ expected `()`, found `usize`
40+
|
41+
= note: required for `str` to implement `Thin`
42+
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Sized`
43+
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Clone`
44+
note: required by a bound in `Y`
45+
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
46+
|
47+
LL | trait Y<'a, T: ?Sized>
48+
| - required by a bound in this trait
49+
...
50+
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
51+
| ^^^^^ required by this bound in `Y`
52+
53+
error: aborting due to 3 previous errors
1854

19-
For more information about this error, try `rustc --explain E0277`.
55+
Some errors have detailed explanations: E0271, E0277.
56+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/hr-associated-type-bound-param-2.stderr

+39-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,42 @@ LL | trait Z<'a, T: ?Sized>
3030
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
3131
| ^^^^^ required by this bound in `Z`
3232

33+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
34+
--> $DIR/hr-associated-type-bound-param-2.rs:14:10
35+
|
36+
LL | impl<'a> Z<'a, u16> for u16 {
37+
| ^^^^^^^^^^ expected `()`, found `usize`
38+
|
39+
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Thin`
40+
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Sized`
41+
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Clone`
42+
note: required by a bound in `Z`
43+
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
44+
|
45+
LL | trait Z<'a, T: ?Sized>
46+
| - required by a bound in this trait
47+
...
48+
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
49+
| ^^^^^ required by this bound in `Z`
50+
51+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
52+
--> $DIR/hr-associated-type-bound-param-2.rs:15:14
53+
|
54+
LL | type W = str;
55+
| ^^^ expected `()`, found `usize`
56+
|
57+
= note: required for `str` to implement `Thin`
58+
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Sized`
59+
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Clone`
60+
note: required by a bound in `Z`
61+
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
62+
|
63+
LL | trait Z<'a, T: ?Sized>
64+
| - required by a bound in this trait
65+
...
66+
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
67+
| ^^^^^ required by this bound in `Z`
68+
3369
error[E0277]: the trait bound `str: Clone` is not satisfied
3470
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
3571
|
@@ -47,6 +83,7 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
4783
| ^^^^^ required by this bound in `Z`
4884
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4985

50-
error: aborting due to 3 previous errors
86+
error: aborting due to 5 previous errors
5187

52-
For more information about this error, try `rustc --explain E0277`.
88+
Some errors have detailed explanations: E0271, E0277.
89+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/hr-associated-type-bound-param-3.stderr

+39-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,43 @@ LL | trait X<'a, T>
1414
LL | for<'b> <T as X<'b, T>>::U: Clone,
1515
| ^^^^^ required by this bound in `X`
1616

17-
error: aborting due to 1 previous error
17+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
18+
--> $DIR/hr-associated-type-bound-param-3.rs:12:12
19+
|
20+
LL | impl<S, T> X<'_, (T,)> for (S,) {
21+
| ^^^^^^^^^^^ expected `()`, found `usize`
22+
|
23+
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Thin`
24+
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Sized`
25+
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Clone`
26+
note: required by a bound in `X`
27+
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
28+
|
29+
LL | trait X<'a, T>
30+
| - required by a bound in this trait
31+
...
32+
LL | for<'b> <T as X<'b, T>>::U: Clone,
33+
| ^^^^^ required by this bound in `X`
34+
35+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
36+
--> $DIR/hr-associated-type-bound-param-3.rs:13:14
37+
|
38+
LL | type U = str;
39+
| ^^^ expected `()`, found `usize`
40+
|
41+
= note: required for `str` to implement `Thin`
42+
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Sized`
43+
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Clone`
44+
note: required by a bound in `X`
45+
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
46+
|
47+
LL | trait X<'a, T>
48+
| - required by a bound in this trait
49+
...
50+
LL | for<'b> <T as X<'b, T>>::U: Clone,
51+
| ^^^^^ required by this bound in `X`
52+
53+
error: aborting due to 3 previous errors
1854

19-
For more information about this error, try `rustc --explain E0277`.
55+
Some errors have detailed explanations: E0271, E0277.
56+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/hr-associated-type-bound-param-4.stderr

+39-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,43 @@ LL | trait X<'a, T>
1414
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
1515
| ^^^^^ required by this bound in `X`
1616

17-
error: aborting due to 1 previous error
17+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
18+
--> $DIR/hr-associated-type-bound-param-4.rs:12:12
19+
|
20+
LL | impl<S, T> X<'_, T> for (S,) {
21+
| ^^^^^^^^ expected `()`, found `usize`
22+
|
23+
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Thin`
24+
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Sized`
25+
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Clone`
26+
note: required by a bound in `X`
27+
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
28+
|
29+
LL | trait X<'a, T>
30+
| - required by a bound in this trait
31+
...
32+
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
33+
| ^^^^^ required by this bound in `X`
34+
35+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
36+
--> $DIR/hr-associated-type-bound-param-4.rs:13:14
37+
|
38+
LL | type U = str;
39+
| ^^^ expected `()`, found `usize`
40+
|
41+
= note: required for `str` to implement `Thin`
42+
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Sized`
43+
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Clone`
44+
note: required by a bound in `X`
45+
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
46+
|
47+
LL | trait X<'a, T>
48+
| - required by a bound in this trait
49+
...
50+
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
51+
| ^^^^^ required by this bound in `X`
52+
53+
error: aborting due to 3 previous errors
1854

19-
For more information about this error, try `rustc --explain E0277`.
55+
Some errors have detailed explanations: E0271, E0277.
56+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/hr-associated-type-bound-param-5.stderr

+111-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,60 @@ LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
1414
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
1515
| ^^^^^ required by this bound in `X`
1616

17+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
18+
--> $DIR/hr-associated-type-bound-param-5.rs:25:12
19+
|
20+
LL | impl<S, T> X<'_, Vec<T>> for S {
21+
| ^^^^^^^^^^^^^ expected `()`, found `usize`
22+
|
23+
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Thin`
24+
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
25+
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
26+
note: required by a bound in `X`
27+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
28+
|
29+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
30+
| - required by a bound in this trait
31+
...
32+
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
33+
| ^^^^^ required by this bound in `X`
34+
35+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
36+
--> $DIR/hr-associated-type-bound-param-5.rs:25:12
37+
|
38+
LL | impl<S, T> X<'_, Vec<T>> for S {
39+
| ^^^^^^^^^^^^^ expected `()`, found `usize`
40+
|
41+
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Thin`
42+
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Sized`
43+
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Clone`
44+
note: required by a bound in `X`
45+
--> $DIR/hr-associated-type-bound-param-5.rs:15:33
46+
|
47+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
48+
| - required by a bound in this trait
49+
LL | where
50+
LL | for<'b> <T as X<'b, T>>::U: Clone,
51+
| ^^^^^ required by this bound in `X`
52+
53+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
54+
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
55+
|
56+
LL | type U = str;
57+
| ^^^ expected `()`, found `usize`
58+
|
59+
= note: required for `str` to implement `Thin`
60+
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
61+
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
62+
note: required by a bound in `X`
63+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
64+
|
65+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
66+
| - required by a bound in this trait
67+
...
68+
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
69+
| ^^^^^ required by this bound in `X`
70+
1771
error[E0277]: the trait bound `str: Clone` is not satisfied
1872
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
1973
|
@@ -30,6 +84,61 @@ LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
3084
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
3185
| ^^^^^ required by this bound in `X`
3286

33-
error: aborting due to 2 previous errors
87+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
88+
--> $DIR/hr-associated-type-bound-param-5.rs:30:12
89+
|
90+
LL | impl<S, T> X<'_, Box<T>> for S {
91+
| ^^^^^^^^^^^^^ expected `()`, found `usize`
92+
|
93+
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Thin`
94+
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
95+
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
96+
note: required by a bound in `X`
97+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
98+
|
99+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
100+
| - required by a bound in this trait
101+
...
102+
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
103+
| ^^^^^ required by this bound in `X`
104+
105+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
106+
--> $DIR/hr-associated-type-bound-param-5.rs:30:12
107+
|
108+
LL | impl<S, T> X<'_, Box<T>> for S {
109+
| ^^^^^^^^^^^^^ expected `()`, found `usize`
110+
|
111+
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Thin`
112+
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Sized`
113+
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Clone`
114+
note: required by a bound in `X`
115+
--> $DIR/hr-associated-type-bound-param-5.rs:15:33
116+
|
117+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
118+
| - required by a bound in this trait
119+
LL | where
120+
LL | for<'b> <T as X<'b, T>>::U: Clone,
121+
| ^^^^^ required by this bound in `X`
122+
123+
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
124+
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
125+
|
126+
LL | type U = str;
127+
| ^^^ expected `()`, found `usize`
128+
|
129+
= note: required for `str` to implement `Thin`
130+
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
131+
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
132+
note: required by a bound in `X`
133+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
134+
|
135+
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
136+
| - required by a bound in this trait
137+
...
138+
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
139+
| ^^^^^ required by this bound in `X`
140+
141+
error: aborting due to 8 previous errors
34142

35-
For more information about this error, try `rustc --explain E0277`.
143+
Some errors have detailed explanations: E0271, E0277.
144+
For more information about an error, try `rustc --explain E0271`.

tests/ui/associated-types/issue-43924.stderr

+20-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,30 @@ note: required by a bound in `Foo::Out`
1010
LL | type Out: Default + ToString + ?Sized = dyn ToString;
1111
| ^^^^^^^ required by this bound in `Foo::Out`
1212

13+
error[E0271]: type mismatch resolving `<dyn ToString as Pointee>::Metadata == ()`
14+
--> $DIR/issue-43924.rs:7:45
15+
|
16+
LL | type Out: Default + ToString + ?Sized = dyn ToString;
17+
| ^^^^^^^^^^^^ expected `()`, found `DynMetadata<dyn ToString>`
18+
|
19+
= note: expected unit type `()`
20+
found struct `DynMetadata<(dyn ToString + 'static)>`
21+
= note: required for `<Self as Foo<T>>::Out` to implement `Thin`
22+
= note: required for `<Self as Foo<T>>::Out` to implement `Sized`
23+
= note: required for `<Self as Foo<T>>::Out` to implement `Default`
24+
note: required by a bound in `Foo::Out`
25+
--> $DIR/issue-43924.rs:7:15
26+
|
27+
LL | type Out: Default + ToString + ?Sized = dyn ToString;
28+
| ^^^^^^^ required by this bound in `Foo::Out`
29+
1330
error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
1431
--> $DIR/issue-43924.rs:14:39
1532
|
1633
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
1734
| ^^^^^^^ function or associated item not found in `dyn ToString`
1835

19-
error: aborting due to 2 previous errors
36+
error: aborting due to 3 previous errors
2037

21-
Some errors have detailed explanations: E0277, E0599.
22-
For more information about an error, try `rustc --explain E0277`.
38+
Some errors have detailed explanations: E0271, E0277, E0599.
39+
For more information about an error, try `rustc --explain E0271`.

0 commit comments

Comments
 (0)