Skip to content

Commit 16dae9c

Browse files
committed
simplify test case and add revisions for both solvers
1 parent e891c61 commit 16dae9c

4 files changed

Lines changed: 56 additions & 107 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0277]: the trait bound `i32: PointeeSized` is not satisfied
2+
--> $DIR/pointee-sized-next-solver-ice.rs:19:21
3+
|
4+
LL | require_trait::<i32>();
5+
| ^^^ the trait `PointeeSized` is not implemented for `i32`
6+
|
7+
help: this trait has no implementations, consider adding one
8+
--> $DIR/pointee-sized-next-solver-ice.rs:14:1
9+
|
10+
LL | trait PointeeSized {}
11+
| ^^^^^^^^^^^^^^^^^^
12+
note: required by a bound in `require_trait`
13+
--> $DIR/pointee-sized-next-solver-ice.rs:16:21
14+
|
15+
LL | fn require_trait<T: PointeeSized>() {}
16+
| ^^^^^^^^^^^^ required by this bound in `require_trait`
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0277]: the trait bound `i32: PointeeSized` is not satisfied
2+
--> $DIR/pointee-sized-next-solver-ice.rs:19:21
3+
|
4+
LL | require_trait::<i32>();
5+
| ^^^ the trait `PointeeSized` is not implemented for `i32`
6+
|
7+
help: this trait has no implementations, consider adding one
8+
--> $DIR/pointee-sized-next-solver-ice.rs:14:1
9+
|
10+
LL | trait PointeeSized {}
11+
| ^^^^^^^^^^^^^^^^^^
12+
note: required by a bound in `require_trait`
13+
--> $DIR/pointee-sized-next-solver-ice.rs:16:21
14+
|
15+
LL | fn require_trait<T: PointeeSized>() {}
16+
| ^^^^^^^^^^^^ required by this bound in `require_trait`
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
//@ compile-flags: -Znext-solver=globally
1+
//@ revisions: current next
2+
//@[next] compile-flags: -Znext-solver
3+
//@ ignore-compare-mode-next-solver (explicit revisions)
24

35
// Regression test for https://github.com/rust-lang/rust/issues/151957
6+
//
7+
// When a user-defined trait shares the name `PointeeSized` with
8+
// `core::marker::PointeeSized`, error reporting tries to check whether
9+
// the type implements the lang-item `PointeeSized` trait via
10+
// `predicate_must_hold_modulo_regions`. This creates a `PointeeSized`
11+
// solver obligation which causes an ICE. We avoid this by skipping the
12+
// `PointeeSized` lang item during the "similarly named trait" suggestion.
413

5-
trait PointeeSized {
6-
type Undefined;
7-
}
8-
9-
struct T;
14+
trait PointeeSized {}
1015

11-
impl PointeeSized for T
12-
//~^ ERROR not all trait items implemented, missing: `Undefined`
13-
//~| ERROR the trait bound `T: PointeeSized` is not satisfied
14-
where
15-
<T as PointeeSized>::Undefined: PointeeSized,
16-
//~^ ERROR the trait bound `T: PointeeSized` is not satisfied
17-
//~| ERROR the trait bound `T: PointeeSized` is not satisfied
18-
{}
16+
fn require_trait<T: PointeeSized>() {}
1917

20-
fn main() {}
18+
fn main() {
19+
require_trait::<i32>();
20+
//~^ ERROR the trait bound `i32: PointeeSized` is not satisfied
21+
}

tests/ui/cycle-trait/pointee-sized-next-solver-ice.stderr

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)