mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-17 02:08:28 +00:00
38 lines
1.1 KiB
Text
38 lines
1.1 KiB
Text
|
error: deref on an immutable reference
|
||
|
--> $DIR/borrow_deref_ref.rs:6:17
|
||
|
|
|
||
|
LL | let b = &*a;
|
||
|
| ^^^ help: if you would like to reborrow, try removing `&*`: `a`
|
||
|
|
|
||
|
= note: `-D clippy::borrow-deref-ref` implied by `-D warnings`
|
||
|
|
||
|
error: deref on an immutable reference
|
||
|
--> $DIR/borrow_deref_ref.rs:9:23
|
||
|
|
|
||
|
LL | let x: &str = &*s;
|
||
|
| ^^^
|
||
|
|
|
||
|
help: if you would like to reborrow, try removing `&*`
|
||
|
|
|
||
|
LL | let x: &str = s;
|
||
|
| ~
|
||
|
help: if you would like to deref, try using `&**`
|
||
|
|
|
||
|
LL | let x: &str = &**s;
|
||
|
| ~~~~
|
||
|
|
||
|
error: deref on an immutable reference
|
||
|
--> $DIR/borrow_deref_ref.rs:11:22
|
||
|
|
|
||
|
LL | let b = &mut &*bar(&12);
|
||
|
| ^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `bar(&12)`
|
||
|
|
||
|
error: deref on an immutable reference
|
||
|
--> $DIR/borrow_deref_ref.rs:54:23
|
||
|
|
|
||
|
LL | let addr_y = &&*x as *const _ as usize; // assert ok
|
||
|
| ^^^ help: if you would like to reborrow, try removing `&*`: `x`
|
||
|
|
||
|
error: aborting due to 4 previous errors
|
||
|
|