Skip to content

Commit

Permalink
oh no
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Markeffsky committed Feb 6, 2024
1 parent 92742a5 commit fda5a39
Show file tree
Hide file tree
Showing 40 changed files with 927 additions and 99 deletions.
41 changes: 39 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,43 @@ LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 1 previous error
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-1.rs:11:6
|
LL | impl X<'_> for i32 {
| ^^^^^ expected `()`, found `usize`
|
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Thin`
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Sized`
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-1.rs:3:33
|
LL | trait X<'a>
| - required by a bound in this trait
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-1.rs:12:14
|
LL | type U = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Sized`
= note: required for `<i32 as X<'b>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-1.rs:3:33
|
LL | trait X<'a>
| - required by a bound in this trait
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
41 changes: 39 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-param-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,43 @@ LL | trait Y<'a, T: ?Sized>
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
| ^^^^^ required by this bound in `Y`

error: aborting due to 1 previous error
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-1.rs:13:10
|
LL | impl<'a> Y<'a, u8> for u8 {
| ^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Thin`
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Sized`
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Clone`
note: required by a bound in `Y`
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
|
LL | trait Y<'a, T: ?Sized>
| - required by a bound in this trait
...
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
| ^^^^^ required by this bound in `Y`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-1.rs:14:14
|
LL | type V = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Sized`
= note: required for `<u8 as Y<'b, u8>>::V` to implement `for<'b> Clone`
note: required by a bound in `Y`
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
|
LL | trait Y<'a, T: ?Sized>
| - required by a bound in this trait
...
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
| ^^^^^ required by this bound in `Y`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
41 changes: 39 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-param-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,42 @@ LL | trait Z<'a, T: ?Sized>
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-2.rs:14:10
|
LL | impl<'a> Z<'a, u16> for u16 {
| ^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Thin`
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Sized`
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Clone`
note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this trait
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-2.rs:15:14
|
LL | type W = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Sized`
= note: required for `<u16 as Z<'b, u16>>::W` to implement `for<'b> Clone`
note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this trait
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
|
Expand All @@ -47,6 +83,7 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 3 previous errors
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
41 changes: 39 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-param-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,43 @@ LL | trait X<'a, T>
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 1 previous error
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-3.rs:12:12
|
LL | impl<S, T> X<'_, (T,)> for (S,) {
| ^^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Thin`
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Sized`
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
|
LL | trait X<'a, T>
| - required by a bound in this trait
...
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-3.rs:13:14
|
LL | type U = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Sized`
= note: required for `<(T,) as X<'b, (T,)>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
|
LL | trait X<'a, T>
| - required by a bound in this trait
...
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
41 changes: 39 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-param-4.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,43 @@ LL | trait X<'a, T>
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 1 previous error
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-4.rs:12:12
|
LL | impl<S, T> X<'_, T> for (S,) {
| ^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Thin`
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Sized`
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
|
LL | trait X<'a, T>
| - required by a bound in this trait
...
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-4.rs:13:14
|
LL | type U = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Sized`
= note: required for `<(T,) as X<'b, T>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
|
LL | trait X<'a, T>
| - required by a bound in this trait
...
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
113 changes: 111 additions & 2 deletions tests/ui/associated-types/hr-associated-type-bound-param-5.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,60 @@ LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:25:12
|
LL | impl<S, T> X<'_, Vec<T>> for S {
| ^^^^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Thin`
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:25:12
|
LL | impl<S, T> X<'_, Vec<T>> for S {
| ^^^^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Thin`
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Sized`
= note: required for `<Vec<T> as X<'b, Vec<T>>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:15:33
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
LL | where
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
|
LL | type U = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
= note: required for `<<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
|
Expand All @@ -30,6 +84,61 @@ LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 2 previous errors
error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:30:12
|
LL | impl<S, T> X<'_, Box<T>> for S {
| ^^^^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Thin`
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:30:12
|
LL | impl<S, T> X<'_, Box<T>> for S {
| ^^^^^^^^^^^^^ expected `()`, found `usize`
|
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Thin`
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Sized`
= note: required for `<Box<T> as X<'b, Box<T>>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:15:33
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
LL | where
LL | for<'b> <T as X<'b, T>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0271]: type mismatch resolving `<str as Pointee>::Metadata == ()`
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
|
LL | type U = str;
| ^^^ expected `()`, found `usize`
|
= note: required for `str` to implement `Thin`
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Sized`
= note: required for `<<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U` to implement `for<'b> Clone`
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this trait
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error: aborting due to 8 previous errors

For more information about this error, try `rustc --explain E0277`.
Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
23 changes: 20 additions & 3 deletions tests/ui/associated-types/issue-43924.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@ note: required by a bound in `Foo::Out`
LL | type Out: Default + ToString + ?Sized = dyn ToString;
| ^^^^^^^ required by this bound in `Foo::Out`

error[E0271]: type mismatch resolving `<dyn ToString as Pointee>::Metadata == ()`
--> $DIR/issue-43924.rs:7:45
|
LL | type Out: Default + ToString + ?Sized = dyn ToString;
| ^^^^^^^^^^^^ expected `()`, found `DynMetadata<dyn ToString>`
|
= note: expected unit type `()`
found struct `DynMetadata<(dyn ToString + 'static)>`
= note: required for `<Self as Foo<T>>::Out` to implement `Thin`
= note: required for `<Self as Foo<T>>::Out` to implement `Sized`
= note: required for `<Self as Foo<T>>::Out` to implement `Default`
note: required by a bound in `Foo::Out`
--> $DIR/issue-43924.rs:7:15
|
LL | type Out: Default + ToString + ?Sized = dyn ToString;
| ^^^^^^^ required by this bound in `Foo::Out`

error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
--> $DIR/issue-43924.rs:14:39
|
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
| ^^^^^^^ function or associated item not found in `dyn ToString`

error: aborting due to 2 previous errors
error: aborting due to 3 previous errors

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

0 comments on commit fda5a39

Please sign in to comment.