mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 02:23:19 +00:00
63 lines
1.8 KiB
Text
63 lines
1.8 KiB
Text
error: mutable borrow from immutable input(s)
|
|
--> $DIR/mut_from_ref.rs:19:39
|
|
|
|
|
19 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
|
| ^^^^^^^^
|
|
|
|
|
= note: `-D clippy::mut-from-ref` implied by `-D warnings`
|
|
note: immutable borrow here
|
|
--> $DIR/mut_from_ref.rs:19:29
|
|
|
|
|
19 | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
|
| ^^^^^
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
--> $DIR/mut_from_ref.rs:25:25
|
|
|
|
|
25 | fn ouch(x: &Foo) -> &mut Foo;
|
|
| ^^^^^^^^
|
|
|
|
|
note: immutable borrow here
|
|
--> $DIR/mut_from_ref.rs:25:16
|
|
|
|
|
25 | fn ouch(x: &Foo) -> &mut Foo;
|
|
| ^^^^
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
--> $DIR/mut_from_ref.rs:34:21
|
|
|
|
|
34 | fn fail(x: &u32) -> &mut u16 {
|
|
| ^^^^^^^^
|
|
|
|
|
note: immutable borrow here
|
|
--> $DIR/mut_from_ref.rs:34:12
|
|
|
|
|
34 | fn fail(x: &u32) -> &mut u16 {
|
|
| ^^^^
|
|
|
|
error: mutable borrow from immutable input(s)
|
|
--> $DIR/mut_from_ref.rs:38:50
|
|
|
|
|
38 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
note: immutable borrow here
|
|
--> $DIR/mut_from_ref.rs:38:25
|
|
|
|
|
38 | 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:42:67
|
|
|
|
|
42 | 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:42:27
|
|
|
|
|
42 | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
|
|
| ^^^^^^^ ^^^^^^^
|
|
|
|
error: aborting due to 5 previous errors
|
|
|