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