Skip to content

Commit

Permalink
Fixing eta with respect to lazy evaluation.
Browse files Browse the repository at this point in the history
  • Loading branch information
projedi authored and Grzegorz committed Jun 11, 2019
1 parent 059fce8 commit 3a92723
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/ui/eta.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ fn make_lazy(f: impl Fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
// If the closure is removed, f will be called when make_lazy itself is
// called. This changes semantics, so the closure must stay.
Box::new(move |x| f()(x))
}

fn call<F: FnOnce(&mut String) -> String>(f: F) -> String {
f(&mut "Hello".to_owned())
Expand All @@ -200,5 +201,5 @@ impl std::ops::Deref for Bar {
}

fn test_deref_with_trait_method() {
let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();;
let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();
}

0 comments on commit 3a92723

Please sign in to comment.