Skip to content

Commit

Permalink
run-rustfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lengyijun committed May 30, 2022
1 parent c541015 commit 8430fa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions tests/ui/borrow_deref_ref.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// run-rustfix

#![allow(dead_code, unused_variables)]

fn main() {}

mod should_lint {
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/borrow_deref_ref.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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`
|
= 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;
| ^^^
Expand All @@ -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`
Expand Down

0 comments on commit 8430fa2

Please sign in to comment.