2017-02-12 08:10:25 -06:00
|
|
|
error: mutable borrow from immutable input(s)
|
|
|
|
--> $DIR/mut_from_ref.rs:9:39
|
|
|
|
|
|
|
|
|
9 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/mut_from_ref.rs:4:9
|
|
|
|
|
|
|
|
|
4 | #![deny(mut_from_ref)]
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
note: immutable borrow here
|
|
|
|
--> $DIR/mut_from_ref.rs:9:29
|
|
|
|
|
|
|
|
|
9 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
|
|
--> $DIR/mut_from_ref.rs:15:25
|
|
|
|
|
|
|
|
|
15 | fn ouch(x: &Foo) -> &mut Foo;
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
|
|
|
--> $DIR/mut_from_ref.rs:15:16
|
|
|
|
|
|
|
|
|
15 | fn ouch(x: &Foo) -> &mut Foo;
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
|
|
--> $DIR/mut_from_ref.rs:24:21
|
|
|
|
|
|
|
|
|
24 | fn fail(x: &u32) -> &mut u16 {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
|
|
|
--> $DIR/mut_from_ref.rs:24:12
|
|
|
|
|
|
|
|
|
24 | fn fail(x: &u32) -> &mut u16 {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
|
|
--> $DIR/mut_from_ref.rs:28:50
|
|
|
|
|
|
|
|
|
28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
|
|
|
--> $DIR/mut_from_ref.rs:28:25
|
|
|
|
|
|
|
|
|
28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
|
|
--> $DIR/mut_from_ref.rs:32:67
|
|
|
|
|
|
|
|
|
32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
|
|
|
--> $DIR/mut_from_ref.rs:32:27
|
2017-02-10 17:32:12 -06:00
|
|
|
|
|
2017-02-12 08:10:25 -06:00
|
|
|
32 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
|
|
|
|
| ^^^^^^^ ^^^^^^^
|
2017-02-10 12:39:03 -06:00
|
|
|
|
2017-02-12 08:10:25 -06:00
|
|
|
error: aborting due to 5 previous errors
|
2017-02-10 18:41:49 -06:00
|
|
|
|