fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB76 linesraw
1error: mutable borrow from immutable input(s)
2  --> $DIR/mut_from_ref.rs:7:39
3   |
4LL |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
5   |                                       ^^^^^^^^
6   |
7note: immutable borrow here
8  --> $DIR/mut_from_ref.rs:7:29
9   |
10LL |     fn this_wont_hurt_a_bit(&self) -> &mut Foo {
11   |                             ^^^^^
12   = note: `-D clippy::mut-from-ref` implied by `-D warnings`
13   = help: to override `-D warnings` add `#[allow(clippy::mut_from_ref)]`
14
15error: mutable borrow from immutable input(s)
16  --> $DIR/mut_from_ref.rs:14:25
17   |
18LL |     fn ouch(x: &Foo) -> &mut Foo;
19   |                         ^^^^^^^^
20   |
21note: immutable borrow here
22  --> $DIR/mut_from_ref.rs:14:16
23   |
24LL |     fn ouch(x: &Foo) -> &mut Foo;
25   |                ^^^^
26
27error: mutable borrow from immutable input(s)
28  --> $DIR/mut_from_ref.rs:24:21
29   |
30LL | fn fail(x: &u32) -> &mut u16 {
31   |                     ^^^^^^^^
32   |
33note: immutable borrow here
34  --> $DIR/mut_from_ref.rs:24:12
35   |
36LL | fn fail(x: &u32) -> &mut u16 {
37   |            ^^^^
38
39error: mutable borrow from immutable input(s)
40  --> $DIR/mut_from_ref.rs:29:50
41   |
42LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
43   |                                                  ^^^^^^^^^^^
44   |
45note: immutable borrow here
46  --> $DIR/mut_from_ref.rs:29:25
47   |
48LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
49   |                         ^^^^^^^
50
51error: mutable borrow from immutable input(s)
52  --> $DIR/mut_from_ref.rs:34:67
53   |
54LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
55   |                                                                   ^^^^^^^^^^^
56   |
57note: immutable borrow here
58  --> $DIR/mut_from_ref.rs:34:27
59   |
60LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
61   |                           ^^^^^^^     ^^^^^^^
62
63error: mutable borrow from immutable input(s)
64  --> $DIR/mut_from_ref.rs:49:35
65   |
66LL | unsafe fn also_broken(x: &u32) -> &mut u32 {
67   |                                   ^^^^^^^^
68   |
69note: immutable borrow here
70  --> $DIR/mut_from_ref.rs:49:26
71   |
72LL | unsafe fn also_broken(x: &u32) -> &mut u32 {
73   |                          ^^^^
74
75error: aborting due to 6 previous errors
76