Skip to content

Commit

Permalink
Add test case that evals to EvaluatedToOkModuloRegions
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed Dec 4, 2021
1 parent 98e9b32 commit 6fe13f6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/test/ui/traits/issue-85360-eval-obligation-ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ fn main() {
test::<MaskedStorage<GenericComp<Pos>>>(make());
//~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)
//~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOk)

test::<MaskedStorage<GenericComp2<Pos>>>(make());
//~^ ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
//~| ERROR evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
}

#[rustc_evaluate_where_clauses]
Expand Down Expand Up @@ -52,6 +56,15 @@ struct GenericComp<T> {
impl<T: 'static> Component for GenericComp<T> {
type Storage = VecStorage;
}

struct GenericComp2<T> {
_t: T,
}

impl<T: 'static> Component for GenericComp2<T> where for<'a> &'a bool: 'a {
type Storage = VecStorage;
}

struct ReadData {
pos_interpdata: ReadStorage<GenericComp<Pos>>,
}
Expand Down
20 changes: 19 additions & 1 deletion src/test/ui/traits/issue-85360-eval-obligation-ice.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,23 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| ----- predicate

error: aborting due to 2 previous errors
error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
|
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | fn test<T: Sized>(_: T) {}
| - predicate

error: evaluate(Binder(TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), [])) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
|
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | fn test<T: Sized>(_: T) {}
| ----- predicate

error: aborting due to 4 previous errors

0 comments on commit 6fe13f6

Please sign in to comment.