]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/mut_from_ref.stderr
iterate List by value
[rust.git] / tests / ui / mut_from_ref.stderr
index 799adb0071464d07e4e1d90b307ca4e60505ebfe..4787999920bc219fde94225fd530ba3fba2c3253 100644 (file)
@@ -1,31 +1,63 @@
-error: this function takes an immutable ref to return a mutable one
- --> tests/ui/mut_from_ref.rs:9:39
-  |
-9 |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
-  |                                       ^^^^^^^^
-  |
-note: lint level defined here
- --> tests/ui/mut_from_ref.rs:4:9
-  |
-4 | #![deny(mut_from_ref)]
-  |         ^^^^^^^^^^^^
+error: mutable borrow from immutable input(s)
+  --> $DIR/mut_from_ref.rs:7:39
+   |
+LL |     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:7:29
+   |
+LL |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
+   |                             ^^^^^
 
-error: this function takes an immutable ref to return a mutable one
-  --> tests/ui/mut_from_ref.rs:15:25
+error: mutable borrow from immutable input(s)
+  --> $DIR/mut_from_ref.rs:13:25
    |
-15 |     fn ouch(x: &Foo) -> &mut Foo;
+LL |     fn ouch(x: &Foo) -> &mut Foo;
    |                         ^^^^^^^^
+   |
+note: immutable borrow here
+  --> $DIR/mut_from_ref.rs:13:16
+   |
+LL |     fn ouch(x: &Foo) -> &mut Foo;
+   |                ^^^^
 
-error: this function takes an immutable ref to return a mutable one
-  --> tests/ui/mut_from_ref.rs:24:21
+error: mutable borrow from immutable input(s)
+  --> $DIR/mut_from_ref.rs:22:21
    |
-24 | fn fail(x: &u32) -> &mut u16 {
+LL | fn fail(x: &u32) -> &mut u16 {
    |                     ^^^^^^^^
+   |
+note: immutable borrow here
+  --> $DIR/mut_from_ref.rs:22:12
+   |
+LL | fn fail(x: &u32) -> &mut u16 {
+   |            ^^^^
 
-error: this function takes an immutable ref to return a mutable one
-  --> tests/ui/mut_from_ref.rs:28:50
+error: mutable borrow from immutable input(s)
+  --> $DIR/mut_from_ref.rs:26:50
    |
-28 | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
+LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
    |                                                  ^^^^^^^^^^^
+   |
+note: immutable borrow here
+  --> $DIR/mut_from_ref.rs:26:25
+   |
+LL | 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:30:67
+   |
+LL | 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:30:27
+   |
+LL | 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
 
-error: aborting due to 4 previous errors