From a81dfca190e1b8556f8c94db1d5856840645c1f9 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Thu, 1 Oct 2015 11:25:45 -0400 Subject: [PATCH] Add test for #25439 Closes #25439. --- src/test/run-pass/issue-25439.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/run-pass/issue-25439.rs diff --git a/src/test/run-pass/issue-25439.rs b/src/test/run-pass/issue-25439.rs new file mode 100644 index 0000000000000..88c48f42c513c --- /dev/null +++ b/src/test/run-pass/issue-25439.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Helper<'a, F: 'a>(&'a F); + +fn fix(f: F) -> i32 where F: Fn(Helper, i32) -> i32 { + f(Helper(&f), 8) +} + +fn main() { + fix(|_, x| x); +}