]> git.lizzy.rs Git - rust.git/blob - tests/ui/mut_from_ref.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / mut_from_ref.stderr
1 error: mutable borrow from immutable input(s)
2   --> $DIR/mut_from_ref.rs:7:39
3    |
4 LL |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
5    |                                       ^^^^^^^^
6    |
7    = note: `-D clippy::mut-from-ref` implied by `-D warnings`
8 note: immutable borrow here
9   --> $DIR/mut_from_ref.rs:7:29
10    |
11 LL |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
12    |                             ^^^^^
13
14 error: mutable borrow from immutable input(s)
15   --> $DIR/mut_from_ref.rs:13:25
16    |
17 LL |     fn ouch(x: &Foo) -> &mut Foo;
18    |                         ^^^^^^^^
19    |
20 note: immutable borrow here
21   --> $DIR/mut_from_ref.rs:13:16
22    |
23 LL |     fn ouch(x: &Foo) -> &mut Foo;
24    |                ^^^^
25
26 error: mutable borrow from immutable input(s)
27   --> $DIR/mut_from_ref.rs:22:21
28    |
29 LL | fn fail(x: &u32) -> &mut u16 {
30    |                     ^^^^^^^^
31    |
32 note: immutable borrow here
33   --> $DIR/mut_from_ref.rs:22:12
34    |
35 LL | fn fail(x: &u32) -> &mut u16 {
36    |            ^^^^
37
38 error: mutable borrow from immutable input(s)
39   --> $DIR/mut_from_ref.rs:26:50
40    |
41 LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
42    |                                                  ^^^^^^^^^^^
43    |
44 note: immutable borrow here
45   --> $DIR/mut_from_ref.rs:26:25
46    |
47 LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
48    |                         ^^^^^^^
49
50 error: mutable borrow from immutable input(s)
51   --> $DIR/mut_from_ref.rs:30:67
52    |
53 LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
54    |                                                                   ^^^^^^^^^^^
55    |
56 note: immutable borrow here
57   --> $DIR/mut_from_ref.rs:30:27
58    |
59 LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
60    |                           ^^^^^^^     ^^^^^^^
61
62 error: aborting due to 5 previous errors
63