run-rustfix

This commit is contained in:
lengyijun 2022-05-30 01:49:46 +00:00
parent c5410150eb
commit 8430fa2a82
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
// run-rustfix
#![allow(dead_code, unused_variables)]
fn main() {}
mod should_lint {

View File

@ -1,5 +1,5 @@
error: deref on an immutable reference
--> $DIR/borrow_deref_ref.rs:6:17
--> $DIR/borrow_deref_ref.rs:10:17
|
LL | let b = &*a;
| ^^^ help: if you would like to reborrow, try removing `&*`: `a`
@ -7,7 +7,7 @@ LL | let b = &*a;
= note: `-D clippy::borrow-deref-ref` implied by `-D warnings`
error: deref on an immutable reference
--> $DIR/borrow_deref_ref.rs:9:23
--> $DIR/borrow_deref_ref.rs:13:23
|
LL | let x: &str = &*s;
| ^^^
@ -22,13 +22,13 @@ LL | let x: &str = &**s;
| ~~~~
error: deref on an immutable reference
--> $DIR/borrow_deref_ref.rs:11:22
--> $DIR/borrow_deref_ref.rs:15: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
--> $DIR/borrow_deref_ref.rs:58:23
|
LL | let addr_y = &&*x as *const _ as usize; // assert ok
| ^^^ help: if you would like to reborrow, try removing `&*`: `x`