Skip to content

Commit

Permalink
Rollup merge of rust-lang#90017 - jackh726:issue-tests, r=nikomatsakis
Browse files Browse the repository at this point in the history
Add a couple tests for normalize under binder issues

Closes rust-lang#56556
Closes rust-lang#76956

r? `@nikomatsakis`
  • Loading branch information
GuillaumeGomez authored Oct 25, 2021
2 parents 32f3887 + 347d503 commit 56077b5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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![]);
}
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 56077b5

Please sign in to comment.