Skip to content

Commit 63aaa51

Browse files
committed
tests: update tests with unconstrained parameters
With the addition of new bounds to the unconstrained parameters, there are more errors which just need blessed.
1 parent 9fa979b commit 63aaa51

8 files changed

+56
-9
lines changed

tests/ui/layout/unconstrained-param-ice-137308.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ impl<C: ?Sized> A for u8 { //~ ERROR: the type parameter `C` is not constrained
1515
}
1616

1717
#[rustc_layout(debug)]
18-
struct S([u8; <u8 as A>::B]); //~ ERROR: the type has an unknown layout
18+
struct S([u8; <u8 as A>::B]);
19+
//~^ ERROR: the type has an unknown layout
20+
//~| ERROR: type annotations needed

tests/ui/layout/unconstrained-param-ice-137308.stderr

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ error[E0207]: the type parameter `C` is not constrained by the impl trait, self
44
LL | impl<C: ?Sized> A for u8 {
55
| ^ unconstrained type parameter
66

7+
error[E0282]: type annotations needed
8+
--> $DIR/unconstrained-param-ice-137308.rs:18:16
9+
|
10+
LL | struct S([u8; <u8 as A>::B]);
11+
| ^^ cannot infer type for type parameter `C`
12+
713
error: the type has an unknown layout
814
--> $DIR/unconstrained-param-ice-137308.rs:18:1
915
|
1016
LL | struct S([u8; <u8 as A>::B]);
1117
| ^^^^^^^^
1218

13-
error: aborting due to 2 previous errors
19+
error: aborting due to 3 previous errors
1420

15-
For more information about this error, try `rustc --explain E0207`.
21+
Some errors have detailed explanations: E0207, E0282.
22+
For more information about an error, try `rustc --explain E0207`.

tests/ui/traits/resolve-impl-before-constrain-check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use foo::*;
1515

1616
fn test() -> impl Sized {
1717
<() as Callable>::call()
18+
//~^ ERROR: type annotations needed
1819
}
1920

2021
fn main() {}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/resolve-impl-before-constrain-check.rs:17:6
3+
|
4+
LL | <() as Callable>::call()
5+
| ^^ cannot infer type for type parameter `V`
6+
17
error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates
28
--> $DIR/resolve-impl-before-constrain-check.rs:9:10
39
|
410
LL | impl<V: ?Sized> Callable for () {
511
| ^ unconstrained type parameter
612

7-
error: aborting due to 1 previous error
13+
error: aborting due to 2 previous errors
814

9-
For more information about this error, try `rustc --explain E0207`.
15+
Some errors have detailed explanations: E0207, E0282.
16+
For more information about an error, try `rustc --explain E0207`.

tests/ui/traits/unconstrained-projection-normalization-2.next.stderr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
44
LL | impl<T: ?Sized> Every for Thing {
55
| ^ unconstrained type parameter
66

7-
error: aborting due to 1 previous error
7+
error[E0282]: type annotations needed
8+
--> $DIR/unconstrained-projection-normalization-2.rs:19:11
9+
|
10+
LL | fn foo(_: <Thing as Every>::Assoc) {}
11+
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
12+
13+
error[E0282]: type annotations needed
14+
--> $DIR/unconstrained-projection-normalization-2.rs:19:11
15+
|
16+
LL | fn foo(_: <Thing as Every>::Assoc) {}
17+
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for associated type `<Thing as Every>::Assoc`
18+
19+
error: aborting due to 3 previous errors
820

9-
For more information about this error, try `rustc --explain E0207`.
21+
Some errors have detailed explanations: E0207, E0282.
22+
For more information about an error, try `rustc --explain E0207`.

tests/ui/traits/unconstrained-projection-normalization-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ impl<T: ?Sized> Every for Thing {
1717
}
1818

1919
fn foo(_: <Thing as Every>::Assoc) {}
20+
//[next]~^ ERROR: type annotations needed
21+
//[next]~| ERROR: type annotations needed
2022

2123
fn main() {}

tests/ui/traits/unconstrained-projection-normalization.next.stderr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self
44
LL | impl<T: ?Sized> Every for Thing {
55
| ^ unconstrained type parameter
66

7-
error: aborting due to 1 previous error
7+
error[E0282]: type annotations needed
8+
--> $DIR/unconstrained-projection-normalization.rs:18:11
9+
|
10+
LL | static I: <Thing as Every>::Assoc = 3;
11+
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
12+
13+
error[E0282]: type annotations needed
14+
--> $DIR/unconstrained-projection-normalization.rs:18:37
15+
|
16+
LL | static I: <Thing as Every>::Assoc = 3;
17+
| ^ cannot infer type
18+
19+
error: aborting due to 3 previous errors
820

9-
For more information about this error, try `rustc --explain E0207`.
21+
Some errors have detailed explanations: E0207, E0282.
22+
For more information about an error, try `rustc --explain E0207`.

tests/ui/traits/unconstrained-projection-normalization.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ impl<T: ?Sized> Every for Thing {
1616
}
1717

1818
static I: <Thing as Every>::Assoc = 3;
19+
//[next]~^ ERROR: type annotations needed
20+
//[next]~| ERROR: type annotations needed
1921

2022
fn main() {}

0 commit comments

Comments
 (0)