blob: 61b7993d2ae4d8383e99aa6b574633e71bc5d105 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
warning: unused return value of `need_to_use_this_value` that must be used
--> $DIR/fn_must_use.rs:55:5
|
LL | need_to_use_this_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/fn_must_use.rs:3:9
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
= note: it's important
warning: unused return value of `MyStruct::need_to_use_this_method_value` that must be used
--> $DIR/fn_must_use.rs:60:5
|
LL | m.need_to_use_this_method_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused return value of `EvenNature::is_even` that must be used
--> $DIR/fn_must_use.rs:61:5
|
LL | m.is_even(); // trait method!
| ^^^^^^^^^^^^
|
= note: no side effects
warning: unused return value of `MyStruct::need_to_use_this_associated_function_value` that must be used
--> $DIR/fn_must_use.rs:64:5
|
LL | MyStruct::need_to_use_this_associated_function_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
--> $DIR/fn_must_use.rs:70:5
|
LL | 2.eq(&3);
| ^^^^^^^^^
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
--> $DIR/fn_must_use.rs:71:5
|
LL | m.eq(&n);
| ^^^^^^^^^
warning: unused comparison that must be used
--> $DIR/fn_must_use.rs:74:5
|
LL | 2 == 3;
| ^^^^^^ the comparison produces a value
|
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 2 == 3;
| +++++++
warning: unused comparison that must be used
--> $DIR/fn_must_use.rs:75:5
|
LL | m == n;
| ^^^^^^ the comparison produces a value
|
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = m == n;
| +++++++
warning: 8 warnings emitted
|