Skip to content

Commit 6fe13f6

Browse files
committed
Add test case that evals to EvaluatedToOkModuloRegions
1 parent 98e9b32 commit 6fe13f6

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/test/ui/traits/issue-85360-eval-obligation-ice.rs

+13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ fn main() {
99
test::<MaskedStorage<GenericComp<Pos>>>(make());
1010
//~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
1111
//~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
12+
13+
test::<MaskedStorage<GenericComp2<Pos>>>(make());
14+
//~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
15+
//~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
1216
}
1317

1418
#[rustc_evaluate_where_clauses]
@@ -52,6 +56,15 @@ struct GenericComp<T> {
5256
impl<T: 'static> Component for GenericComp<T> {
5357
type Storage = VecStorage;
5458
}
59+
60+
struct GenericComp2<T> {
61+
_t: T,
62+
}
63+
64+
impl<T: 'static> Component for GenericComp2<T> where for<'a> &'a bool: 'a {
65+
type Storage = VecStorage;
66+
}
67+
5568
struct ReadData {
5669
pos_interpdata: ReadStorage<GenericComp<Pos>>,
5770
}

src/test/ui/traits/issue-85360-eval-obligation-ice.stderr

+19-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,23 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
1616
LL | fn test<T: Sized>(_: T) {}
1717
| ----- predicate
1818

19-
error: aborting due to 2 previous errors
19+
error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
20+
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
21+
|
22+
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
...
25+
LL | fn test<T: Sized>(_: T) {}
26+
| - predicate
27+
28+
error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
29+
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
30+
|
31+
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
...
34+
LL | fn test<T: Sized>(_: T) {}
35+
| ----- predicate
36+
37+
error: aborting due to 4 previous errors
2038

0 commit comments

Comments
 (0)