Add a couple tests for normalize under binder issues

This commit is contained in:
jackh726 2021-10-18 10:46:59 -04:00
parent 5dab47dcd8
commit 347d503333
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// check-pass
fn foo<T>(t: T) -> usize
where
for<'a> &'a T: IntoIterator,
for<'a> <&'a T as IntoIterator>::IntoIter: ExactSizeIterator,
{
t.into_iter().len()
}
fn main() {
foo::<Vec<u32>>(vec![]);
}

View File

@ -0,0 +1,15 @@
// check-pass
use std::ops::Deref;
struct Data {
boxed: Box<&'static i32>
}
impl Data {
fn use_data(&self, user: impl for <'a> FnOnce(<Box<&'a i32> as Deref>::Target)) {
user(*self.boxed)
}
}
fn main() {}