2017-02-12 08:10:25 -06:00
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:7:39
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
2018-10-06 11:18:06 -05:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
2017-02-12 08:10:25 -06:00
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:7:29
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn this_wont_hurt_a_bit(&self) -> &mut Foo {
|
2018-10-06 11:18:06 -05:00
|
|
|
| ^^^^^
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::mut-from-ref` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::mut_from_ref)]`
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:14:25
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn ouch(x: &Foo) -> &mut Foo;
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:14:16
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn ouch(x: &Foo) -> &mut Foo;
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:24:21
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail(x: &u32) -> &mut u16 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:24:12
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail(x: &u32) -> &mut u16 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:29:50
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:29:25
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail_lifetime<'a>(x: &'a u32, y: &mut u32) -> &'a mut u32 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:34:67
|
2017-02-12 08:10:25 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:34:27
|
2017-02-10 17:32:12 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | fn fail_double<'a, 'b>(x: &'a u32, y: &'a u32, z: &'b mut u32) -> &'a mut u32 {
|
2017-02-12 08:10:25 -06:00
|
|
|
| ^^^^^^^ ^^^^^^^
|
2017-02-10 12:39:03 -06:00
|
|
|
|
2022-05-05 09:12:52 -05:00
|
|
|
error: mutable borrow from immutable input(s)
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:49:35
|
2022-05-05 09:12:52 -05:00
|
|
|
|
|
|
|
|
LL | unsafe fn also_broken(x: &u32) -> &mut u32 {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: immutable borrow here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/mut_from_ref.rs:49:26
|
2022-05-05 09:12:52 -05:00
|
|
|
|
|
|
|
|
LL | unsafe fn also_broken(x: &u32) -> &mut u32 {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|