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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
2.3 KiB
Plaintext
Raw Normal View History

2021-01-11 04:47:16 -06:00
warning: call to `.clone()` on a reference in this situation does nothing
2021-02-16 15:39:05 -06:00
--> $DIR/noop-method-call.rs:16:71
|
2021-02-16 15:39:05 -06:00
LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
| ^^^^^^^^ unnecessary method call
|
2022-09-18 10:55:36 -05:00
= note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
2021-02-16 15:39:05 -06:00
note: the lint level is defined here
--> $DIR/noop-method-call.rs:4:9
|
LL | #![warn(noop_method_call)]
| ^^^^^^^^^^^^^^^^
warning: call to `.deref()` on a reference in this situation does nothing
--> $DIR/noop-method-call.rs:28:63
|
LL | let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
| ^^^^^^^^ unnecessary method call
|
= note: the type `&PlainType<u32>` which `deref` is being called on is the same as the type returned from `deref`, so the method call does not do anything and can be removed
warning: call to `.borrow()` on a reference in this situation does nothing
--> $DIR/noop-method-call.rs:36:66
|
LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
| ^^^^^^^^^ unnecessary method call
|
= note: the type `&PlainType<u32>` which `borrow` is being called on is the same as the type returned from `borrow`, so the method call does not do anything and can be removed
2021-01-11 04:47:16 -06:00
warning: call to `.clone()` on a reference in this situation does nothing
--> $DIR/noop-method-call.rs:48:19
|
LL | non_clone_type.clone();
| ^^^^^^^^ unnecessary method call
|
= note: the type `&PlainType<T>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
warning: call to `.clone()` on a reference in this situation does nothing
--> $DIR/noop-method-call.rs:53:19
|
2021-02-16 08:12:19 -06:00
LL | non_clone_type.clone();
| ^^^^^^^^ unnecessary method call
2021-01-11 04:47:16 -06:00
|
2021-02-16 15:39:05 -06:00
= note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
warning: 5 warnings emitted