Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Feb 12, 2025
1 parent 0a4403a commit b55f9c8
Show file tree
Hide file tree
Showing 23 changed files with 157 additions and 429 deletions.
87 changes: 79 additions & 8 deletions tests/ui/const-generics/issues/issue-88119.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,101 @@ LL | #![feature(const_trait_impl, generic_const_exprs)]
|
= help: remove one of these features

error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:19:49
|
LL | impl<T: ?Sized + ConstName> const ConstName for &T
| ^^
|
note: required by a bound in `<&T as ConstName>`
--> $DIR/issue-88119.rs:21:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:21:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
| ^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `<&T as ConstName>`
--> $DIR/issue-88119.rs:21:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:21:10
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
| ^^^^^^^^^^^^^^^
|
note: required by a bound in `<&T as ConstName>`
--> $DIR/issue-88119.rs:21:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:26:49
|
LL | impl<T: ?Sized + ConstName> const ConstName for &mut T
| ^^^^^^
|
note: required by a bound in `<&mut T as ConstName>`
--> $DIR/issue-88119.rs:28:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`

error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:28:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
| ^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `<&mut T as ConstName>`
--> $DIR/issue-88119.rs:28:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:28:10
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
| ^^^^^^^^^^^^^^^
|
note: required by a bound in `<&mut T as ConstName>`
--> $DIR/issue-88119.rs:28:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:33:34
|
LL | pub const ICE_1: &'static [u8] = <&&mut u8 as ConstName>::NAME_BYTES;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `<&mut T as ConstName>`
--> $DIR/issue-88119.rs:28:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`

error: the type `[(); name_len::<T>()]` is not well-formed
--> $DIR/issue-88119.rs:34:34
|
LL | pub const ICE_2: &'static [u8] = <&mut &u8 as ConstName>::NAME_BYTES;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `<&T as ConstName>`
--> $DIR/issue-88119.rs:21:5
|
LL | [(); name_len::<T>()]:,
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`

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

For more information about this error, try `rustc --explain E0284`.
3 changes: 1 addition & 2 deletions tests/ui/higher-ranked/trait-bounds/issue-95230.next.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
error: the type `&'a mut Bar` is not well-formed
--> $DIR/issue-95230.rs:9:13
|
LL | for<'a> &'a mut Self:;
Expand All @@ -15,4 +15,3 @@ LL | for<'a> &'a mut Self:;

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0275`.
7 changes: 4 additions & 3 deletions tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `Loop == _`
error[E0271]: type mismatch resolving `Loop normalizes-to _`
--> $DIR/inherent-impls-overflow.rs:10:6
|
LL | impl Loop {}
| ^^^^
| ^^^^ types differ

error: type parameter `T` is only used recursively
--> $DIR/inherent-impls-overflow.rs:14:24
Expand Down Expand Up @@ -36,4 +36,5 @@ LL | impl Poly0<()> {}

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0275`.
Some errors have detailed explanations: E0271, E0275.
For more information about an error, try `rustc --explain E0271`.
2 changes: 1 addition & 1 deletion tests/ui/lazy-type-alias/inherent-impls-overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Loop = Loop; //[current]~ ERROR overflow normalizing the type alias `Loop`

impl Loop {}
//[current]~^ ERROR overflow normalizing the type alias `Loop`
//[next]~^^ ERROR overflow evaluating the requirement `Loop == _`
//[next]~^^ ERROR type mismatch resolving `Loop normalizes-to _

type Poly0<T> = Poly1<(T,)>;
//[current]~^ ERROR overflow normalizing the type alias `Poly0<(((((((...,),),),),),),)>`
Expand Down
12 changes: 4 additions & 8 deletions tests/ui/traits/next-solver/alias-bound-unsound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ trait Foo {

impl Foo for () {
type Item = String where String: Copy;
//~^ ERROR overflow evaluating the requirement `String: Copy`
//~^ ERROR impl has stricter requirements than trait
}

fn main() {
let x = String::from("hello, world");
drop(<() as Foo>::copy_me(&x));
//~^ ERROR overflow evaluating the requirement `String <: <() as Foo>::Item`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item well-formed`
//~| ERROR overflow evaluating the requirement `&<() as Foo>::Item well-formed`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
//~^ ERROR type mismatch resolving `<() as Foo>::Item normalizes-to String`
//~| ERROR mismatched types
//~| ERROR type mismatch resolving `<() as Foo>::Item normalizes-to String`
println!("{x}");
}
78 changes: 37 additions & 41 deletions tests/ui/traits/next-solver/alias-bound-unsound.stderr
Original file line number Diff line number Diff line change
@@ -1,63 +1,59 @@
error[E0275]: overflow evaluating the requirement `String: Copy`
error[E0276]: impl has stricter requirements than trait
--> $DIR/alias-bound-unsound.rs:18:38
|
LL | type Item = String where String: Copy;
| ^^^^
|
note: the requirement `String: Copy` appears on the `impl`'s associated type `Item` but not on the corresponding trait's associated type
--> $DIR/alias-bound-unsound.rs:8:10
|
LL | trait Foo {
| --- in this trait
LL | type Item: Copy
| ^^^^ this trait's associated type doesn't have the requirement `String: Copy`
| --------------- definition of `Item` from trait
...
LL | type Item = String where String: Copy;
| ^^^^ impl has extra requirement `String: Copy`

error[E0275]: overflow evaluating the requirement `String <: <() as Foo>::Item`
error[E0271]: type mismatch resolving `<() as Foo>::Item normalizes-to String`
--> $DIR/alias-bound-unsound.rs:24:31
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
--> $DIR/alias-bound-unsound.rs:24:10
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
--> $DIR/alias-bound-unsound.rs:24:10
| ^^ types differ
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `Foo::Item`
--> $DIR/alias-bound-unsound.rs:10:30
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
LL | type Item: Copy
| ---- required by a bound in this associated type
LL | where
LL | <Self as Foo>::Item: Copy;
| ^^^^ required by this bound in `Foo::Item`

error[E0275]: overflow evaluating the requirement `&<() as Foo>::Item well-formed`
error[E0308]: mismatched types
--> $DIR/alias-bound-unsound.rs:24:31
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item well-formed`
--> $DIR/alias-bound-unsound.rs:24:10
| -------------------- ^^ types differ
| |
| arguments to this function are incorrect
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: expected reference `&<() as Foo>::Item`
found reference `&String`
note: associated function defined here
--> $DIR/alias-bound-unsound.rs:12:8
|
LL | fn copy_me(x: &Self::Item) -> Self::Item {
| ^^^^^^^ --------------

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
error[E0271]: type mismatch resolving `<() as Foo>::Item normalizes-to String`
--> $DIR/alias-bound-unsound.rs:24:10
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^ types differ
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
--> $DIR/alias-bound-unsound.rs:24:31
note: required by a bound in `Foo::Item`
--> $DIR/alias-bound-unsound.rs:10:30
|
LL | drop(<() as Foo>::copy_me(&x));
| ^^
LL | type Item: Copy
| ---- required by a bound in this associated type
LL | where
LL | <Self as Foo>::Item: Copy;
| ^^^^ required by this bound in `Foo::Item`

error: aborting due to 8 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0275`.
Some errors have detailed explanations: E0271, E0276, E0308.
For more information about an error, try `rustc --explain E0271`.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trait Overflow {
}
impl<T> Overflow for T {
type Assoc = <T as Overflow>::Assoc;
//~^ ERROR: overflow
//~^ ERROR: type mismatch resolving `<T as Overflow>::Assoc normalizes-to _`
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
error[E0275]: overflow evaluating the requirement `<T as Overflow>::Assoc: Sized`
error[E0271]: type mismatch resolving `<T as Overflow>::Assoc normalizes-to _`
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:10:18
|
LL | type Assoc = <T as Overflow>::Assoc;
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^ types differ
|
note: required by a bound in `Overflow::Assoc`
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:7:5
|
LL | type Assoc;
| ^^^^^^^^^^^ required by this bound in `Overflow::Assoc`
help: consider relaxing the implicit `Sized` restriction
|
LL | type Assoc: ?Sized;
| ++++++++

error[E0119]: conflicting implementations of trait `Trait`
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:18:1
Expand All @@ -25,5 +21,5 @@ LL | impl Trait for <LocalTy as Overflow>::Assoc {}

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0119, E0275.
Some errors have detailed explanations: E0119, E0271.
For more information about an error, try `rustc --explain E0119`.
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ fn foo<T: Typed>() {}

fn main() {
foo::<&_>();
//~^ ERROR overflow evaluating the requirement `&_: Typed`
//~^ ERROR type annotations needed
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
error[E0275]: overflow evaluating the requirement `&_: Typed`
--> $DIR/cycle-modulo-ambig-aliases.rs:87:11
error[E0282]: type annotations needed
--> $DIR/cycle-modulo-ambig-aliases.rs:87:5
|
LL | foo::<&_>();
| ^^
|
note: required by a bound in `foo`
--> $DIR/cycle-modulo-ambig-aliases.rs:84:11
|
LL | fn foo<T: Typed>() {}
| ^^^^^ required by this bound in `foo`
| ^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `foo`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0275`.
For more information about this error, try `rustc --explain E0282`.

This file was deleted.

Loading

0 comments on commit b55f9c8

Please sign in to comment.