Skip to content

Commit 7997ff6

Browse files
committed
update tests
1 parent 0a4403a commit 7997ff6

23 files changed

+157
-429
lines changed

tests/ui/const-generics/issues/issue-88119.stderr

+79-8
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,101 @@ LL | #![feature(const_trait_impl, generic_const_exprs)]
66
|
77
= help: remove one of these features
88

9-
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
9+
error: the type `[(); name_len::<T>()]` is not well-formed
10+
--> $DIR/issue-88119.rs:19:49
11+
|
12+
LL | impl<T: ?Sized + ConstName> const ConstName for &T
13+
| ^^
14+
|
15+
note: required by a bound in `<&T as ConstName>`
16+
--> $DIR/issue-88119.rs:21:5
17+
|
18+
LL | [(); name_len::<T>()]:,
19+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
20+
21+
error: the type `[(); name_len::<T>()]` is not well-formed
1022
--> $DIR/issue-88119.rs:21:5
1123
|
1224
LL | [(); name_len::<T>()]:,
13-
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
25+
| ^^^^^^^^^^^^^^^^^^^^^
1426
|
1527
note: required by a bound in `<&T as ConstName>`
28+
--> $DIR/issue-88119.rs:21:5
29+
|
30+
LL | [(); name_len::<T>()]:,
31+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
32+
33+
error: the type `[(); name_len::<T>()]` is not well-formed
1634
--> $DIR/issue-88119.rs:21:10
1735
|
1836
LL | [(); name_len::<T>()]:,
19-
| ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
37+
| ^^^^^^^^^^^^^^^
38+
|
39+
note: required by a bound in `<&T as ConstName>`
40+
--> $DIR/issue-88119.rs:21:5
41+
|
42+
LL | [(); name_len::<T>()]:,
43+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
44+
45+
error: the type `[(); name_len::<T>()]` is not well-formed
46+
--> $DIR/issue-88119.rs:26:49
47+
|
48+
LL | impl<T: ?Sized + ConstName> const ConstName for &mut T
49+
| ^^^^^^
50+
|
51+
note: required by a bound in `<&mut T as ConstName>`
52+
--> $DIR/issue-88119.rs:28:5
53+
|
54+
LL | [(); name_len::<T>()]:,
55+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
2056

21-
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
57+
error: the type `[(); name_len::<T>()]` is not well-formed
2258
--> $DIR/issue-88119.rs:28:5
2359
|
2460
LL | [(); name_len::<T>()]:,
25-
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
61+
| ^^^^^^^^^^^^^^^^^^^^^
2662
|
2763
note: required by a bound in `<&mut T as ConstName>`
64+
--> $DIR/issue-88119.rs:28:5
65+
|
66+
LL | [(); name_len::<T>()]:,
67+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
68+
69+
error: the type `[(); name_len::<T>()]` is not well-formed
2870
--> $DIR/issue-88119.rs:28:10
2971
|
3072
LL | [(); name_len::<T>()]:,
31-
| ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
73+
| ^^^^^^^^^^^^^^^
74+
|
75+
note: required by a bound in `<&mut T as ConstName>`
76+
--> $DIR/issue-88119.rs:28:5
77+
|
78+
LL | [(); name_len::<T>()]:,
79+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
80+
81+
error: the type `[(); name_len::<T>()]` is not well-formed
82+
--> $DIR/issue-88119.rs:33:34
83+
|
84+
LL | pub const ICE_1: &'static [u8] = <&&mut u8 as ConstName>::NAME_BYTES;
85+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86+
|
87+
note: required by a bound in `<&mut T as ConstName>`
88+
--> $DIR/issue-88119.rs:28:5
89+
|
90+
LL | [(); name_len::<T>()]:,
91+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
92+
93+
error: the type `[(); name_len::<T>()]` is not well-formed
94+
--> $DIR/issue-88119.rs:34:34
95+
|
96+
LL | pub const ICE_2: &'static [u8] = <&mut &u8 as ConstName>::NAME_BYTES;
97+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+
|
99+
note: required by a bound in `<&T as ConstName>`
100+
--> $DIR/issue-88119.rs:21:5
101+
|
102+
LL | [(); name_len::<T>()]:,
103+
| ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
32104

33-
error: aborting due to 3 previous errors
105+
error: aborting due to 9 previous errors
34106

35-
For more information about this error, try `rustc --explain E0284`.

tests/ui/higher-ranked/trait-bounds/issue-95230.next.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow evaluating the requirement `for<'a> &'a mut Bar well-formed`
1+
error: the type `&'a mut Bar` is not well-formed
22
--> $DIR/issue-95230.rs:9:13
33
|
44
LL | for<'a> &'a mut Self:;
@@ -15,4 +15,3 @@ LL | for<'a> &'a mut Self:;
1515

1616
error: aborting due to 1 previous error
1717

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

tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0275]: overflow evaluating the requirement `Loop == _`
1+
error[E0271]: type mismatch resolving `Loop normalizes-to _`
22
--> $DIR/inherent-impls-overflow.rs:10:6
33
|
44
LL | impl Loop {}
5-
| ^^^^
5+
| ^^^^ types differ
66

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

3737
error: aborting due to 4 previous errors
3838

39-
For more information about this error, try `rustc --explain E0275`.
39+
Some errors have detailed explanations: E0271, E0275.
40+
For more information about an error, try `rustc --explain E0271`.

tests/ui/lazy-type-alias/inherent-impls-overflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Loop = Loop; //[current]~ ERROR overflow normalizing the type alias `Loop`
99

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

1414
type Poly0<T> = Poly1<(T,)>;
1515
//[current]~^ ERROR overflow normalizing the type alias `Poly0<(((((((...,),),),),),),)>`

tests/ui/traits/next-solver/alias-bound-unsound.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ trait Foo {
1616

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

2222
fn main() {
2323
let x = String::from("hello, world");
2424
drop(<() as Foo>::copy_me(&x));
25-
//~^ ERROR overflow evaluating the requirement `String <: <() as Foo>::Item`
26-
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item well-formed`
27-
//~| ERROR overflow evaluating the requirement `&<() as Foo>::Item well-formed`
28-
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
29-
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
30-
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
31-
//~| ERROR overflow evaluating the requirement `<() as Foo>::Item == _`
25+
//~^ ERROR type mismatch resolving `<() as Foo>::Item normalizes-to String`
26+
//~| ERROR mismatched types
27+
//~| ERROR type mismatch resolving `<() as Foo>::Item normalizes-to String`
3228
println!("{x}");
3329
}
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,59 @@
1-
error[E0275]: overflow evaluating the requirement `String: Copy`
1+
error[E0276]: impl has stricter requirements than trait
22
--> $DIR/alias-bound-unsound.rs:18:38
33
|
4-
LL | type Item = String where String: Copy;
5-
| ^^^^
6-
|
7-
note: the requirement `String: Copy` appears on the `impl`'s associated type `Item` but not on the corresponding trait's associated type
8-
--> $DIR/alias-bound-unsound.rs:8:10
9-
|
10-
LL | trait Foo {
11-
| --- in this trait
124
LL | type Item: Copy
13-
| ^^^^ this trait's associated type doesn't have the requirement `String: Copy`
5+
| --------------- definition of `Item` from trait
6+
...
7+
LL | type Item = String where String: Copy;
8+
| ^^^^ impl has extra requirement `String: Copy`
149

15-
error[E0275]: overflow evaluating the requirement `String <: <() as Foo>::Item`
10+
error[E0271]: type mismatch resolving `<() as Foo>::Item normalizes-to String`
1611
--> $DIR/alias-bound-unsound.rs:24:31
1712
|
1813
LL | drop(<() as Foo>::copy_me(&x));
19-
| ^^
20-
21-
error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
22-
--> $DIR/alias-bound-unsound.rs:24:10
23-
|
24-
LL | drop(<() as Foo>::copy_me(&x));
25-
| ^^^^^^^^^^^^^^^^^^^^^^^^
26-
27-
error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
28-
--> $DIR/alias-bound-unsound.rs:24:10
14+
| ^^ types differ
2915
|
30-
LL | drop(<() as Foo>::copy_me(&x));
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^
16+
note: required by a bound in `Foo::Item`
17+
--> $DIR/alias-bound-unsound.rs:10:30
3218
|
33-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
19+
LL | type Item: Copy
20+
| ---- required by a bound in this associated type
21+
LL | where
22+
LL | <Self as Foo>::Item: Copy;
23+
| ^^^^ required by this bound in `Foo::Item`
3424

35-
error[E0275]: overflow evaluating the requirement `&<() as Foo>::Item well-formed`
25+
error[E0308]: mismatched types
3626
--> $DIR/alias-bound-unsound.rs:24:31
3727
|
3828
LL | drop(<() as Foo>::copy_me(&x));
39-
| ^^
40-
41-
error[E0275]: overflow evaluating the requirement `<() as Foo>::Item well-formed`
42-
--> $DIR/alias-bound-unsound.rs:24:10
29+
| -------------------- ^^ types differ
30+
| |
31+
| arguments to this function are incorrect
4332
|
44-
LL | drop(<() as Foo>::copy_me(&x));
45-
| ^^^^^^^^^^^^^^^^^^^^^^^^
33+
= note: expected reference `&<() as Foo>::Item`
34+
found reference `&String`
35+
note: associated function defined here
36+
--> $DIR/alias-bound-unsound.rs:12:8
37+
|
38+
LL | fn copy_me(x: &Self::Item) -> Self::Item {
39+
| ^^^^^^^ --------------
4640

47-
error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
41+
error[E0271]: type mismatch resolving `<() as Foo>::Item normalizes-to String`
4842
--> $DIR/alias-bound-unsound.rs:24:10
4943
|
5044
LL | drop(<() as Foo>::copy_me(&x));
51-
| ^^^^^^^^^^^^^^^^^^^^^^^^
45+
| ^^^^^^^^^^^^^^^^^^^^^^^^ types differ
5246
|
53-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
54-
55-
error[E0275]: overflow evaluating the requirement `<() as Foo>::Item == _`
56-
--> $DIR/alias-bound-unsound.rs:24:31
47+
note: required by a bound in `Foo::Item`
48+
--> $DIR/alias-bound-unsound.rs:10:30
5749
|
58-
LL | drop(<() as Foo>::copy_me(&x));
59-
| ^^
50+
LL | type Item: Copy
51+
| ---- required by a bound in this associated type
52+
LL | where
53+
LL | <Self as Foo>::Item: Copy;
54+
| ^^^^ required by this bound in `Foo::Item`
6055

61-
error: aborting due to 8 previous errors
56+
error: aborting due to 4 previous errors
6257

63-
For more information about this error, try `rustc --explain E0275`.
58+
Some errors have detailed explanations: E0271, E0276, E0308.
59+
For more information about an error, try `rustc --explain E0271`.

tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ trait Overflow {
88
}
99
impl<T> Overflow for T {
1010
type Assoc = <T as Overflow>::Assoc;
11-
//~^ ERROR: overflow
11+
//~^ ERROR: type mismatch resolving `<T as Overflow>::Assoc normalizes-to _`
1212
}
1313

1414

Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
error[E0275]: overflow evaluating the requirement `<T as Overflow>::Assoc: Sized`
1+
error[E0271]: type mismatch resolving `<T as Overflow>::Assoc normalizes-to _`
22
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:10:18
33
|
44
LL | type Assoc = <T as Overflow>::Assoc;
5-
| ^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^ types differ
66
|
77
note: required by a bound in `Overflow::Assoc`
88
--> $DIR/trait_ref_is_knowable-norm-overflow.rs:7:5
99
|
1010
LL | type Assoc;
1111
| ^^^^^^^^^^^ required by this bound in `Overflow::Assoc`
12-
help: consider relaxing the implicit `Sized` restriction
13-
|
14-
LL | type Assoc: ?Sized;
15-
| ++++++++
1612

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

2622
error: aborting due to 2 previous errors
2723

28-
Some errors have detailed explanations: E0119, E0275.
24+
Some errors have detailed explanations: E0119, E0271.
2925
For more information about an error, try `rustc --explain E0119`.

tests/ui/traits/next-solver/cycles/cycle-modulo-ambig-aliases.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ fn foo<T: Typed>() {}
8585

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

137
error: aborting due to 1 previous error
148

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

tests/ui/traits/next-solver/cycles/double-cycle-inductive-coinductive.rs

-37
This file was deleted.

0 commit comments

Comments
 (0)