]> git.lizzy.rs Git - rust.git/blob - tests/ui/mut_from_ref.stderr
New mut_from_ref lint
[rust.git] / tests / ui / mut_from_ref.stderr
1 error: this function takes an immutable ref to return a mutable one:
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
13 error: this function takes an immutable ref to return a mutable one:
14   --> $DIR/mut_from_ref.rs:15:25
15    |
16 15 |     fn ouch(x: &Foo) -> &mut Foo;
17    |                         ^^^^^^^^
18
19 error: this function takes an immutable ref to return a mutable one:
20   --> $DIR/mut_from_ref.rs:24:21
21    |
22 24 | fn fail(x: &u32) -> &mut u16 {
23    |                     ^^^^^^^^
24
25 error: aborting due to 3 previous errors
26