allow escaping bound vars when normalizing ty::Opaque

This commit is contained in:
Bastian Kauschke 2020-08-12 09:08:34 +02:00
parent c94ed5ca91
commit d2398eee0f
3 changed files with 17 additions and 9 deletions

View file

@ -0,0 +1,13 @@
// build-pass
// This used to fail MIR validation due to the types on both sides of
// an assignment not being equal.
// The failure doesn't occur with a check-only build.
fn iter_slice<'a, T>(xs: &'a [T]) -> impl Iterator<Item = &'a T> {
xs.iter()
}
fn main() {
iter_slice::<()> as fn(_) -> _;
}