]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25757.rs
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
[rust.git] / src / test / ui / issues / issue-25757.rs
1 // run-pass
2 struct Foo {
3     a: u32
4 }
5
6 impl Foo {
7     fn x(&mut self) {
8         self.a = 5;
9     }
10 }
11
12 const FUNC: &'static dyn Fn(&mut Foo) -> () = &Foo::x;
13
14 fn main() {
15     let mut foo = Foo { a: 137 };
16     FUNC(&mut foo);
17     assert_eq!(foo.a, 5);
18 }