Skip to content

Commit 107807d

Browse files
committed
Safe Transmute: lowercase diagnostics
1 parent dc35339 commit 107807d

21 files changed

+157
-157
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,20 +3082,20 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
30823082
}
30833083

30843084
rustc_transmute::Reason::DstIsBitIncompatible => {
3085-
format!("At least one value of `{src}` isn't a bit-valid value of `{dst}`")
3085+
format!("at least one value of `{src}` isn't a bit-valid value of `{dst}`")
30863086
}
30873087

30883088
rustc_transmute::Reason::DstMayHaveSafetyInvariants => {
30893089
format!("`{dst}` may carry safety invariants")
30903090
}
30913091
rustc_transmute::Reason::DstIsTooBig => {
3092-
format!("The size of `{src}` is smaller than the size of `{dst}`")
3092+
format!("the size of `{src}` is smaller than the size of `{dst}`")
30933093
}
30943094
rustc_transmute::Reason::DstRefIsTooBig { src, dst } => {
30953095
let src_size = src.size;
30963096
let dst_size = dst.size;
30973097
format!(
3098-
"The referent size of `{src}` ({src_size} bytes) is smaller than that of `{dst}` ({dst_size} bytes)"
3098+
"the referent size of `{src}` ({src_size} bytes) is smaller than that of `{dst}` ({dst_size} bytes)"
30993099
)
31003100
}
31013101
rustc_transmute::Reason::SrcSizeOverflow => {
@@ -3113,7 +3113,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
31133113
dst_min_align,
31143114
} => {
31153115
format!(
3116-
"The minimum alignment of `{src}` ({src_min_align}) should be greater than that of `{dst}` ({dst_min_align})"
3116+
"the minimum alignment of `{src}` ({src_min_align}) should be greater than that of `{dst}` ({dst_min_align})"
31173117
)
31183118
}
31193119
rustc_transmute::Reason::DstIsMoreUnique => {

tests/ui/transmutability/alignment/align-fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]`
22
--> $DIR/align-fail.rs:21:55
33
|
44
LL | ...tatic [u8; 0], &'static [u16; 0]>();
5-
| ^^^^^^^^^^^^^^^^^ The minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2)
5+
| ^^^^^^^^^^^^^^^^^ the minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2)
66
|
77
note: required by a bound in `is_maybe_transmutable`
88
--> $DIR/align-fail.rs:9:14

tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `Zst` cannot be safely transmuted into `V0i8`
22
--> $DIR/primitive_reprs_should_have_correct_length.rs:46:44
33
|
44
LL | assert::is_transmutable::<Smaller, Current>();
5-
| ^^^^^^^ The size of `Zst` is smaller than the size of `V0i8`
5+
| ^^^^^^^ the size of `Zst` is smaller than the size of `V0i8`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -24,7 +24,7 @@ error[E0277]: `V0i8` cannot be safely transmuted into `u16`
2424
--> $DIR/primitive_reprs_should_have_correct_length.rs:48:44
2525
|
2626
LL | assert::is_transmutable::<Current, Larger>();
27-
| ^^^^^^ The size of `V0i8` is smaller than the size of `u16`
27+
| ^^^^^^ the size of `V0i8` is smaller than the size of `u16`
2828
|
2929
note: required by a bound in `is_transmutable`
3030
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -46,7 +46,7 @@ error[E0277]: `Zst` cannot be safely transmuted into `V0u8`
4646
--> $DIR/primitive_reprs_should_have_correct_length.rs:54:44
4747
|
4848
LL | assert::is_transmutable::<Smaller, Current>();
49-
| ^^^^^^^ The size of `Zst` is smaller than the size of `V0u8`
49+
| ^^^^^^^ the size of `Zst` is smaller than the size of `V0u8`
5050
|
5151
note: required by a bound in `is_transmutable`
5252
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -68,7 +68,7 @@ error[E0277]: `V0u8` cannot be safely transmuted into `u16`
6868
--> $DIR/primitive_reprs_should_have_correct_length.rs:56:44
6969
|
7070
LL | assert::is_transmutable::<Current, Larger>();
71-
| ^^^^^^ The size of `V0u8` is smaller than the size of `u16`
71+
| ^^^^^^ the size of `V0u8` is smaller than the size of `u16`
7272
|
7373
note: required by a bound in `is_transmutable`
7474
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -90,7 +90,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0i16`
9090
--> $DIR/primitive_reprs_should_have_correct_length.rs:68:44
9191
|
9292
LL | assert::is_transmutable::<Smaller, Current>();
93-
| ^^^^^^^ The size of `u8` is smaller than the size of `V0i16`
93+
| ^^^^^^^ the size of `u8` is smaller than the size of `V0i16`
9494
|
9595
note: required by a bound in `is_transmutable`
9696
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -112,7 +112,7 @@ error[E0277]: `V0i16` cannot be safely transmuted into `u32`
112112
--> $DIR/primitive_reprs_should_have_correct_length.rs:70:44
113113
|
114114
LL | assert::is_transmutable::<Current, Larger>();
115-
| ^^^^^^ The size of `V0i16` is smaller than the size of `u32`
115+
| ^^^^^^ the size of `V0i16` is smaller than the size of `u32`
116116
|
117117
note: required by a bound in `is_transmutable`
118118
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -134,7 +134,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0u16`
134134
--> $DIR/primitive_reprs_should_have_correct_length.rs:76:44
135135
|
136136
LL | assert::is_transmutable::<Smaller, Current>();
137-
| ^^^^^^^ The size of `u8` is smaller than the size of `V0u16`
137+
| ^^^^^^^ the size of `u8` is smaller than the size of `V0u16`
138138
|
139139
note: required by a bound in `is_transmutable`
140140
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -156,7 +156,7 @@ error[E0277]: `V0u16` cannot be safely transmuted into `u32`
156156
--> $DIR/primitive_reprs_should_have_correct_length.rs:78:44
157157
|
158158
LL | assert::is_transmutable::<Current, Larger>();
159-
| ^^^^^^ The size of `V0u16` is smaller than the size of `u32`
159+
| ^^^^^^ the size of `V0u16` is smaller than the size of `u32`
160160
|
161161
note: required by a bound in `is_transmutable`
162162
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -178,7 +178,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0i32`
178178
--> $DIR/primitive_reprs_should_have_correct_length.rs:90:44
179179
|
180180
LL | assert::is_transmutable::<Smaller, Current>();
181-
| ^^^^^^^ The size of `u16` is smaller than the size of `V0i32`
181+
| ^^^^^^^ the size of `u16` is smaller than the size of `V0i32`
182182
|
183183
note: required by a bound in `is_transmutable`
184184
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -200,7 +200,7 @@ error[E0277]: `V0i32` cannot be safely transmuted into `u64`
200200
--> $DIR/primitive_reprs_should_have_correct_length.rs:92:44
201201
|
202202
LL | assert::is_transmutable::<Current, Larger>();
203-
| ^^^^^^ The size of `V0i32` is smaller than the size of `u64`
203+
| ^^^^^^ the size of `V0i32` is smaller than the size of `u64`
204204
|
205205
note: required by a bound in `is_transmutable`
206206
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -222,7 +222,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0u32`
222222
--> $DIR/primitive_reprs_should_have_correct_length.rs:98:44
223223
|
224224
LL | assert::is_transmutable::<Smaller, Current>();
225-
| ^^^^^^^ The size of `u16` is smaller than the size of `V0u32`
225+
| ^^^^^^^ the size of `u16` is smaller than the size of `V0u32`
226226
|
227227
note: required by a bound in `is_transmutable`
228228
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -244,7 +244,7 @@ error[E0277]: `V0u32` cannot be safely transmuted into `u64`
244244
--> $DIR/primitive_reprs_should_have_correct_length.rs:100:44
245245
|
246246
LL | assert::is_transmutable::<Current, Larger>();
247-
| ^^^^^^ The size of `V0u32` is smaller than the size of `u64`
247+
| ^^^^^^ the size of `V0u32` is smaller than the size of `u64`
248248
|
249249
note: required by a bound in `is_transmutable`
250250
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -266,7 +266,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0i64`
266266
--> $DIR/primitive_reprs_should_have_correct_length.rs:112:44
267267
|
268268
LL | assert::is_transmutable::<Smaller, Current>();
269-
| ^^^^^^^ The size of `u32` is smaller than the size of `V0i64`
269+
| ^^^^^^^ the size of `u32` is smaller than the size of `V0i64`
270270
|
271271
note: required by a bound in `is_transmutable`
272272
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -288,7 +288,7 @@ error[E0277]: `V0i64` cannot be safely transmuted into `u128`
288288
--> $DIR/primitive_reprs_should_have_correct_length.rs:114:44
289289
|
290290
LL | assert::is_transmutable::<Current, Larger>();
291-
| ^^^^^^ The size of `V0i64` is smaller than the size of `u128`
291+
| ^^^^^^ the size of `V0i64` is smaller than the size of `u128`
292292
|
293293
note: required by a bound in `is_transmutable`
294294
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -310,7 +310,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0u64`
310310
--> $DIR/primitive_reprs_should_have_correct_length.rs:120:44
311311
|
312312
LL | assert::is_transmutable::<Smaller, Current>();
313-
| ^^^^^^^ The size of `u32` is smaller than the size of `V0u64`
313+
| ^^^^^^^ the size of `u32` is smaller than the size of `V0u64`
314314
|
315315
note: required by a bound in `is_transmutable`
316316
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -332,7 +332,7 @@ error[E0277]: `V0u64` cannot be safely transmuted into `u128`
332332
--> $DIR/primitive_reprs_should_have_correct_length.rs:122:44
333333
|
334334
LL | assert::is_transmutable::<Current, Larger>();
335-
| ^^^^^^ The size of `V0u64` is smaller than the size of `u128`
335+
| ^^^^^^ the size of `V0u64` is smaller than the size of `u128`
336336
|
337337
note: required by a bound in `is_transmutable`
338338
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -354,7 +354,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0isize`
354354
--> $DIR/primitive_reprs_should_have_correct_length.rs:134:44
355355
|
356356
LL | assert::is_transmutable::<Smaller, Current>();
357-
| ^^^^^^^ The size of `u8` is smaller than the size of `V0isize`
357+
| ^^^^^^^ the size of `u8` is smaller than the size of `V0isize`
358358
|
359359
note: required by a bound in `is_transmutable`
360360
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -376,7 +376,7 @@ error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]`
376376
--> $DIR/primitive_reprs_should_have_correct_length.rs:136:44
377377
|
378378
LL | assert::is_transmutable::<Current, Larger>();
379-
| ^^^^^^ The size of `V0isize` is smaller than the size of `[usize; 2]`
379+
| ^^^^^^ the size of `V0isize` is smaller than the size of `[usize; 2]`
380380
|
381381
note: required by a bound in `is_transmutable`
382382
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -398,7 +398,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0usize`
398398
--> $DIR/primitive_reprs_should_have_correct_length.rs:142:44
399399
|
400400
LL | assert::is_transmutable::<Smaller, Current>();
401-
| ^^^^^^^ The size of `u8` is smaller than the size of `V0usize`
401+
| ^^^^^^^ the size of `u8` is smaller than the size of `V0usize`
402402
|
403403
note: required by a bound in `is_transmutable`
404404
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
@@ -420,7 +420,7 @@ error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]`
420420
--> $DIR/primitive_reprs_should_have_correct_length.rs:144:44
421421
|
422422
LL | assert::is_transmutable::<Current, Larger>();
423-
| ^^^^^^ The size of `V0usize` is smaller than the size of `[usize; 2]`
423+
| ^^^^^^ the size of `V0usize` is smaller than the size of `[usize; 2]`
424424
|
425425
note: required by a bound in `is_transmutable`
426426
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14

tests/ui/transmutability/enums/should_pad_variants.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst`
22
--> $DIR/should_pad_variants.rs:43:36
33
|
44
LL | assert::is_transmutable::<Src, Dst>();
5-
| ^^^ The size of `Src` is smaller than the size of `Dst`
5+
| ^^^ the size of `Src` is smaller than the size of `Dst`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/should_pad_variants.rs:13:14

tests/ui/transmutability/enums/should_respect_endianness.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `Src` cannot be safely transmuted into `Unexpected`
22
--> $DIR/should_respect_endianness.rs:35:36
33
|
44
LL | assert::is_transmutable::<Src, Unexpected>();
5-
| ^^^^^^^^^^ At least one value of `Src` isn't a bit-valid value of `Unexpected`
5+
| ^^^^^^^^^^ at least one value of `Src` isn't a bit-valid value of `Unexpected`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/should_respect_endianness.rs:13:14

tests/ui/transmutability/primitives/bool-mut.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool`
22
--> $DIR/bool-mut.rs:15:50
33
|
44
LL | assert::is_transmutable::<&'static mut bool, &'static mut u8>()
5-
| ^^^^^^^^^^^^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
5+
| ^^^^^^^^^^^^^^^ at least one value of `u8` isn't a bit-valid value of `bool`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/bool-mut.rs:10:14

tests/ui/transmutability/primitives/bool.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool`
22
--> $DIR/bool.rs:21:35
33
|
44
LL | assert::is_transmutable::<u8, bool>();
5-
| ^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
5+
| ^^^^ at least one value of `u8` isn't a bit-valid value of `bool`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/bool.rs:11:14

tests/ui/transmutability/primitives/bool.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool`
22
--> $DIR/bool.rs:21:35
33
|
44
LL | assert::is_transmutable::<u8, bool>();
5-
| ^^^^ At least one value of `u8` isn't a bit-valid value of `bool`
5+
| ^^^^ at least one value of `u8` isn't a bit-valid value of `bool`
66
|
77
note: required by a bound in `is_transmutable`
88
--> $DIR/bool.rs:11:14

0 commit comments

Comments
 (0)