Skip to content

Commit ae5e93d

Browse files
committed
rebase and update tests
1 parent 789fdb3 commit ae5e93d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tests/ui/lint/noop-method-call.fixed

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// check-pass
2-
// run-rustfix
1+
//@check-pass
2+
//@run-rustfix
33

44
#![allow(unused)]
55

@@ -26,7 +26,6 @@ fn main() {
2626
let clone_type_ref = &CloneType(1u32);
2727
let clone_type_ref_clone: CloneType<u32> = clone_type_ref.clone();
2828

29-
3029
let non_deref_type = &PlainType(1u32);
3130
let non_deref_type_deref: &PlainType<u32> = non_deref_type;
3231
//~^ WARN call to `.deref()` on a reference in this situation does nothing

tests/ui/lint/noop-method-call.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,31 @@ LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clon
2424
= note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
2525

2626
warning: call to `.deref()` on a reference in this situation does nothing
27-
--> $DIR/noop-method-call.rs:31:63
27+
--> $DIR/noop-method-call.rs:30:63
2828
|
2929
LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
3030
| ^^^^^^^^ help: remove this redundant call
3131
|
3232
= note: the type `PlainType<u32>` does not implement `Deref`, so calling `deref` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
3333

3434
warning: call to `.borrow()` on a reference in this situation does nothing
35-
--> $DIR/noop-method-call.rs:35:66
35+
--> $DIR/noop-method-call.rs:34:66
3636
|
3737
LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
3838
| ^^^^^^^^^ help: remove this redundant call
3939
|
4040
= note: the type `PlainType<u32>` does not implement `Borrow`, so calling `borrow` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
4141

4242
warning: call to `.clone()` on a reference in this situation does nothing
43-
--> $DIR/noop-method-call.rs:44:19
43+
--> $DIR/noop-method-call.rs:43:19
4444
|
4545
LL | non_clone_type.clone();
4646
| ^^^^^^^^ help: remove this redundant call
4747
|
4848
= note: the type `PlainType<T>` does not implement `Clone`, so calling `clone` on `&PlainType<T>` copies the reference, which does not do anything and can be removed
4949

5050
warning: call to `.clone()` on a reference in this situation does nothing
51-
--> $DIR/noop-method-call.rs:49:19
51+
--> $DIR/noop-method-call.rs:48:19
5252
|
5353
LL | non_clone_type.clone();
5454
| ^^^^^^^^ help: remove this redundant call

0 commit comments

Comments
 (0)