2 #![warn(clippy::mut_from_ref)]
7 fn this_wont_hurt_a_bit(&self) -> &mut Foo {
13 fn ouch(x: &Foo) -> &mut Foo;
17 fn ouch(x: &Foo) -> &mut Foo {
22 fn fail(x: &u32) -> &mut u16 {
26 fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
30 fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
34 // this is OK, because the result borrows y
35 fn works<'a>(x: &u32, y: &'a mut u32) -> &'a mut u32 {
39 // this is also OK, because the result could borrow y
40 fn also_works<'a>(x: &'a u32, y: &'a mut u32) -> &'a mut u32 {