40ae34194c
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
12 lines
239 B
Rust
12 lines
239 B
Rust
// run-pass
|
|
fn make_adder(x: isize) -> Box<dyn FnMut(isize)->isize + 'static> {
|
|
Box::new(move |y| { x + y })
|
|
}
|
|
|
|
pub fn main() {
|
|
let mut adder = make_adder(3);
|
|
let z = (*adder)(2);
|
|
println!("{}", z);
|
|
assert_eq!(z, 5);
|
|
}
|