Skip to content

Commit 2a40d32

Browse files
committed
tests: use PointeeSized to re-unconstrain params
These tests expected entirely unconstrained parameters and their `?Sized` bounds are no longer sufficient to achieve that.
1 parent 910d726 commit 2a40d32

8 files changed

+20
-13
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// Need a different module so we try to build the mir for `test`
22
// before analyzing `mod foo`.
3+
#![feature(sized_hierarchy)]
34

45
mod foo {
6+
use std::marker::PointeeSized;
7+
58
pub trait Callable {
69
fn call();
710
}
811

9-
impl<V: ?Sized> Callable for () {
12+
impl<V: PointeeSized> Callable for () {
1013
//~^ ERROR the type parameter `V` is not constrained by the impl trait, self type, or predicates
1114
fn call() {}
1215
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/resolve-impl-before-constrain-check.rs:9:10
2+
--> $DIR/resolve-impl-before-constrain-check.rs:12:10
33
|
4-
LL | impl<V: ?Sized> Callable for () {
4+
LL | impl<V: PointeeSized> Callable for () {
55
| ^ unconstrained type parameter
66

77
error: aborting due to 1 previous error

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/unconstrained-projection-normalization-2.rs:14:6
2+
--> $DIR/unconstrained-projection-normalization-2.rs:16:6
33
|
4-
LL | impl<T: ?Sized> Every for Thing {
4+
LL | impl<T: PointeeSized> Every for Thing {
55
| ^ unconstrained type parameter
66

77
error: aborting due to 1 previous error

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/unconstrained-projection-normalization-2.rs:14:6
2+
--> $DIR/unconstrained-projection-normalization-2.rs:16:6
33
|
4-
LL | impl<T: ?Sized> Every for Thing {
4+
LL | impl<T: PointeeSized> Every for Thing {
55
| ^ unconstrained type parameter
66

77
error: aborting due to 1 previous error

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
//@ revisions: current next
66
//@ ignore-compare-mode-next-solver (explicit revisions)
77
//@[next] compile-flags: -Znext-solver
8+
#![feature(sized_hierarchy)]
9+
use std::marker::PointeeSized;
810

911
struct Thing;
1012

1113
pub trait Every {
1214
type Assoc;
1315
}
14-
impl<T: ?Sized> Every for Thing {
16+
impl<T: PointeeSized> Every for Thing {
1517
//~^ ERROR the type parameter `T` is not constrained
1618
type Assoc = T;
1719
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/unconstrained-projection-normalization.rs:13:6
2+
--> $DIR/unconstrained-projection-normalization.rs:15:6
33
|
4-
LL | impl<T: ?Sized> Every for Thing {
4+
LL | impl<T: PointeeSized> Every for Thing {
55
| ^ unconstrained type parameter
66

77
error: aborting due to 1 previous error

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/unconstrained-projection-normalization.rs:13:6
2+
--> $DIR/unconstrained-projection-normalization.rs:15:6
33
|
4-
LL | impl<T: ?Sized> Every for Thing {
4+
LL | impl<T: PointeeSized> Every for Thing {
55
| ^ unconstrained type parameter
66

77
error: aborting due to 1 previous error

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
//@ revisions: current next
55
//@ ignore-compare-mode-next-solver (explicit revisions)
66
//@[next] compile-flags: -Znext-solver
7+
#![feature(sized_hierarchy)]
8+
use std::marker::PointeeSized;
79

810
struct Thing;
911

1012
pub trait Every {
1113
type Assoc;
1214
}
13-
impl<T: ?Sized> Every for Thing {
15+
impl<T: PointeeSized> Every for Thing {
1416
//~^ ERROR the type parameter `T` is not constrained
1517
type Assoc = T;
1618
}

0 commit comments

Comments
 (0)