fork/rust

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

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

master
4.9 KiB164 linesraw
1error: trivial numeric cast: `i32` as `i32`
2  --> $DIR/trivial_casts.rs:16:13
3   |
4LL |     let _ = 42_i32 as i32;
5   |             ^^^^^^^^^^^^^
6   |
7   = help: cast can be replaced by coercion; this might require a temporary variable
8note: the lint level is defined here
9  --> $DIR/trivial_casts.rs:4:24
10   |
11LL | #![deny(trivial_casts, trivial_numeric_casts)]
12   |                        ^^^^^^^^^^^^^^^^^^^^^
13
14error: trivial numeric cast: `u8` as `u8`
15  --> $DIR/trivial_casts.rs:19:13
16   |
17LL |     let _ = 42_u8 as u8;
18   |             ^^^^^^^^^^^
19   |
20   = help: cast can be replaced by coercion; this might require a temporary variable
21
22error: trivial cast: `&u32` as `*const u32`
23  --> $DIR/trivial_casts.rs:24:13
24   |
25LL |     let _ = x as *const u32;
26   |             ^^^^^^^^^^^^^^^
27   |
28   = help: cast can be replaced by coercion; this might require a temporary variable
29note: the lint level is defined here
30  --> $DIR/trivial_casts.rs:4:9
31   |
32LL | #![deny(trivial_casts, trivial_numeric_casts)]
33   |         ^^^^^^^^^^^^^
34
35error: trivial cast: `&mut u32` as `*mut u32`
36  --> $DIR/trivial_casts.rs:28:13
37   |
38LL |     let _ = x as *mut u32;
39   |             ^^^^^^^^^^^^^
40   |
41   = help: cast can be replaced by coercion; this might require a temporary variable
42
43error: trivial cast: `&[u32; 3]` as `&[u32]`
44  --> $DIR/trivial_casts.rs:33:13
45   |
46LL |     let _ = x as &[u32];
47   |             ^^^^^^^^^^^
48   |
49   = help: cast can be replaced by coercion; this might require a temporary variable
50
51error: trivial cast: `&[u32; 3]` as `*const [u32]`
52  --> $DIR/trivial_casts.rs:34:13
53   |
54LL |     let _ = x as *const [u32];
55   |             ^^^^^^^^^^^^^^^^^
56   |
57   = help: cast can be replaced by coercion; this might require a temporary variable
58
59error: trivial cast: `&mut [u32; 3]` as `&mut [u32]`
60  --> $DIR/trivial_casts.rs:39:13
61   |
62LL |     let _ = x as &mut [u32];
63   |             ^^^^^^^^^^^^^^^
64   |
65   = help: cast can be replaced by coercion; this might require a temporary variable
66
67error: trivial cast: `&mut [u32; 3]` as `*mut [u32]`
68  --> $DIR/trivial_casts.rs:40:13
69   |
70LL |     let _ = x as *mut [u32];
71   |             ^^^^^^^^^^^^^^^
72   |
73   = help: cast can be replaced by coercion; this might require a temporary variable
74
75error: trivial cast: `Box<[u32; 3]>` as `Box<[u32]>`
76  --> $DIR/trivial_casts.rs:45:13
77   |
78LL |     let _ = x as Box<[u32]>;
79   |             ^^^^^^^^^^^^^^^
80   |
81   = help: cast can be replaced by coercion; this might require a temporary variable
82
83error: trivial cast: `&Bar` as `&dyn Foo`
84  --> $DIR/trivial_casts.rs:52:13
85   |
86LL |     let _ = x as &dyn Foo;
87   |             ^^^^^^^^^^^^^
88   |
89   = help: cast can be replaced by coercion; this might require a temporary variable
90
91error: trivial cast: `&Bar` as `*const dyn Foo`
92  --> $DIR/trivial_casts.rs:53:13
93   |
94LL |     let _ = x as *const dyn Foo;
95   |             ^^^^^^^^^^^^^^^^^^^
96   |
97   = help: cast can be replaced by coercion; this might require a temporary variable
98
99error: trivial cast: `&mut Bar` as `&mut dyn Foo`
100  --> $DIR/trivial_casts.rs:58:13
101   |
102LL |     let _ = x as &mut dyn Foo;
103   |             ^^^^^^^^^^^^^^^^^
104   |
105   = help: cast can be replaced by coercion; this might require a temporary variable
106
107error: trivial cast: `&mut Bar` as `*mut dyn Foo`
108  --> $DIR/trivial_casts.rs:59:13
109   |
110LL |     let _ = x as *mut dyn Foo;
111   |             ^^^^^^^^^^^^^^^^^
112   |
113   = help: cast can be replaced by coercion; this might require a temporary variable
114
115error: trivial cast: `Box<Bar>` as `Box<dyn Foo>`
116  --> $DIR/trivial_casts.rs:64:13
117   |
118LL |     let _ = x as Box<dyn Foo>;
119   |             ^^^^^^^^^^^^^^^^^
120   |
121   = help: cast can be replaced by coercion; this might require a temporary variable
122
123error: trivial cast: `&fn(i32) {baz}` as `&dyn Fn(i32)`
124  --> $DIR/trivial_casts.rs:70:13
125   |
126LL |     let _ = &baz as &dyn Fn(i32);
127   |             ^^^^^^^^^^^^^^^^^^^^
128   |
129   = help: cast can be replaced by coercion; this might require a temporary variable
130
131error: trivial cast: `&{closure@$DIR/trivial_casts.rs:72:13: 72:22}` as `&dyn Fn(i32)`
132  --> $DIR/trivial_casts.rs:73:13
133   |
134LL |     let _ = &x as &dyn Fn(i32);
135   |             ^^^^^^^^^^^^^^^^^^
136   |
137   = help: cast can be replaced by coercion; this might require a temporary variable
138
139error: trivial cast: `&'a Bar` as `&'a Bar`
140  --> $DIR/trivial_casts.rs:79:13
141   |
142LL |     let _ = a as &'a Bar;
143   |             ^^^^^^^^^^^^
144   |
145   = help: cast can be replaced by coercion; this might require a temporary variable
146
147error: trivial cast: `&'b Bar` as `&'a Bar`
148  --> $DIR/trivial_casts.rs:81:13
149   |
150LL |     let _ = b as &'a Bar;
151   |             ^^^^^^^^^^^^
152   |
153   = help: cast can be replaced by coercion; this might require a temporary variable
154
155error: trivial cast: `&'b Bar` as `&'b Bar`
156  --> $DIR/trivial_casts.rs:83:13
157   |
158LL |     let _ = b as &'b Bar;
159   |             ^^^^^^^^^^^^
160   |
161   = help: cast can be replaced by coercion; this might require a temporary variable
162
163error: aborting due to 19 previous errors
164