fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.0 KiB127 linesraw
1warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
2  --> $DIR/dropping_references.rs:8:5
3   |
4LL |     drop(&SomeStruct);
5   |     ^^^^^-----------^
6   |          |
7   |          argument has type `&SomeStruct`
8   |
9   = note: use `let _ = ...` to ignore the expression or result
10note: the lint level is defined here
11  --> $DIR/dropping_references.rs:3:9
12   |
13LL | #![warn(dropping_references)]
14   |         ^^^^^^^^^^^^^^^^^^^
15
16warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
17  --> $DIR/dropping_references.rs:11:5
18   |
19LL |     drop(&owned1);
20   |     ^^^^^-------^
21   |          |
22   |          argument has type `&SomeStruct`
23   |
24   = note: use `let _ = ...` to ignore the expression or result
25
26warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
27  --> $DIR/dropping_references.rs:12:5
28   |
29LL |     drop(&&owned1);
30   |     ^^^^^--------^
31   |          |
32   |          argument has type `&&SomeStruct`
33   |
34   = note: use `let _ = ...` to ignore the expression or result
35
36warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
37  --> $DIR/dropping_references.rs:13:5
38   |
39LL |     drop(&mut owned1);
40   |     ^^^^^-----------^
41   |          |
42   |          argument has type `&mut SomeStruct`
43   |
44   = note: use `let _ = ...` to ignore the expression or result
45
46warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
47  --> $DIR/dropping_references.rs:17:5
48   |
49LL |     drop(reference1);
50   |     ^^^^^----------^
51   |          |
52   |          argument has type `&SomeStruct`
53   |
54   = note: use `let _ = ...` to ignore the expression or result
55
56warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
57  --> $DIR/dropping_references.rs:20:5
58   |
59LL |     drop(reference2);
60   |     ^^^^^----------^
61   |          |
62   |          argument has type `&mut SomeStruct`
63   |
64   = note: use `let _ = ...` to ignore the expression or result
65
66warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
67  --> $DIR/dropping_references.rs:23:5
68   |
69LL |     drop(reference3);
70   |     ^^^^^----------^
71   |          |
72   |          argument has type `&SomeStruct`
73   |
74   = note: use `let _ = ...` to ignore the expression or result
75
76warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
77  --> $DIR/dropping_references.rs:28:5
78   |
79LL |     drop(&val);
80   |     ^^^^^----^
81   |          |
82   |          argument has type `&T`
83   |
84   = note: use `let _ = ...` to ignore the expression or result
85
86warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
87  --> $DIR/dropping_references.rs:36:5
88   |
89LL |     std::mem::drop(&SomeStruct);
90   |     ^^^^^^^^^^^^^^^-----------^
91   |                    |
92   |                    argument has type `&SomeStruct`
93   |
94   = note: use `let _ = ...` to ignore the expression or result
95
96warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
97  --> $DIR/dropping_references.rs:91:13
98   |
99LL |             drop(println_and(&13));
100   |             ^^^^^----------------^
101   |                  |
102   |                  argument has type `&i32`
103   |
104   = note: use `let _ = ...` to ignore the expression or result
105
106warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
107  --> $DIR/dropping_references.rs:94:14
108   |
109LL |         3 if drop(println_and(&14)) == () => (),
110   |              ^^^^^----------------^
111   |                   |
112   |                   argument has type `&i32`
113   |
114   = note: use `let _ = ...` to ignore the expression or result
115
116warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
117  --> $DIR/dropping_references.rs:96:14
118   |
119LL |         4 => drop(&2),
120   |              ^^^^^--^
121   |                   |
122   |                   argument has type `&i32`
123   |
124   = note: use `let _ = ...` to ignore the expression or result
125
126warning: 12 warnings emitted
127