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