Skip to content

Commit 472747e

Browse files
Fix tests in tests/ui/transmute
Signed-off-by: FedericoBruzzone <[email protected]>
1 parent ec20898 commit 472747e

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

compiler/rustc_hir_typeck/src/intrinsicck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
144144
err.emit();
145145
} else {
146146
err.note(format!("source type: `{}` ({})", from, skeleton_string(from, sk_from)))
147-
.note(format!("target type: `{}` ({})", to, skeleton_string(to, sk_to)));
147+
.note(format!("target type: `{}` ({})", to, skeleton_string(to, sk_to)));
148148
if let Err(LayoutError::ReferencesError(_)) = sk_from {
149149
err.delay_as_bug();
150150
} else if let Err(LayoutError::ReferencesError(_)) = sk_to {

compiler/rustc_middle/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ middle_strict_coherence_needs_negative_coherence =
101101
.label = due to this attribute
102102
103103
middle_too_generic =
104-
cannot determine the layout of the type `{$ty}`; too generic
104+
`{$ty}` is too generic to determine the layout
105105
106106
middle_type_length_limit = reached the type-length limit while instantiating `{$shrunk}`
107107

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> {
276276
match *self {
277277
LayoutError::Unknown(ty) => write!(f, "the type `{ty}` has an unknown layout"),
278278
LayoutError::TooGeneric(ty) => {
279-
write!(f, "cannot determine the layout for the type `{ty}`; too generic")
279+
write!(f, "`{ty}` is too generic to determine the layout")
280280
}
281281
LayoutError::SizeOverflow(ty) => {
282282
write!(f, "values of the type `{ty}` are too big for the target architecture")

tests/ui/transmute/transmute-different-sizes.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | transmute(x)
2323
| ^^^^^^^^^
2424
|
2525
= note: source type: `u16` (N bits)
26-
= note: target type: `<T as Specializable>::Output` (this type does not have a fixed size)
26+
= note: target type: `<T as Specializable>::Output` (`<T as Specializable>::Output` is too generic to determine the layout)
2727

2828
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2929
--> $DIR/transmute-different-sizes.rs:38:5
@@ -32,7 +32,7 @@ LL | transmute(from)
3232
| ^^^^^^^^^
3333
|
3434
= note: source type: `*mut T` (pointer to `T`)
35-
= note: target type: `PtrAndOverAlignZST<T>` (size can vary because of <T as Pointee>::Metadata)
35+
= note: target type: `PtrAndOverAlignZST<T>` (`<T as Pointee>::Metadata` is too generic to determine the layout)
3636

3737
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
3838
--> $DIR/transmute-different-sizes.rs:47:5
@@ -41,7 +41,7 @@ LL | std::mem::transmute(from)
4141
| ^^^^^^^^^^^^^^^^^^^
4242
|
4343
= note: source type: `*mut T` (pointer to `T`)
44-
= note: target type: `PtrAndEmptyArray<T>` (size can vary because of <T as Pointee>::Metadata)
44+
= note: target type: `PtrAndEmptyArray<T>` (`<T as Pointee>::Metadata` is too generic to determine the layout)
4545

4646
error: aborting due to 5 previous errors
4747

tests/ui/transmute/transmute-type-parameters.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
44
LL | let _: i32 = transmute(x);
55
| ^^^^^^^^^
66
|
7-
= note: source type: `T` (this type does not have a fixed size)
7+
= note: source type: `T` (`T` is too generic to determine the layout)
88
= note: target type: `i32` (32 bits)
99

1010
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
@@ -13,7 +13,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
1313
LL | let _: i32 = transmute(x);
1414
| ^^^^^^^^^
1515
|
16-
= note: source type: `(T, i32)` (size can vary because of T)
16+
= note: source type: `(T, i32)` (`T` is too generic to determine the layout)
1717
= note: target type: `i32` (32 bits)
1818

1919
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
@@ -22,7 +22,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
2222
LL | let _: i32 = transmute(x);
2323
| ^^^^^^^^^
2424
|
25-
= note: source type: `[T; 10]` (size can vary because of T)
25+
= note: source type: `[T; 10]` (`T` is too generic to determine the layout)
2626
= note: target type: `i32` (32 bits)
2727

2828
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
@@ -31,7 +31,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
3131
LL | let _: i32 = transmute(x);
3232
| ^^^^^^^^^
3333
|
34-
= note: source type: `Bad<T>` (size can vary because of T)
34+
= note: source type: `Bad<T>` (`T` is too generic to determine the layout)
3535
= note: target type: `i32` (32 bits)
3636

3737
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
@@ -40,7 +40,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
4040
LL | let _: i32 = transmute(x);
4141
| ^^^^^^^^^
4242
|
43-
= note: source type: `Worse<T>` (size can vary because of T)
43+
= note: source type: `Worse<T>` (`T` is too generic to determine the layout)
4444
= note: target type: `i32` (32 bits)
4545

4646
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
@@ -49,7 +49,7 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
4949
LL | let _: i32 = transmute(x);
5050
| ^^^^^^^^^
5151
|
52-
= note: source type: `Option<T>` (size can vary because of T)
52+
= note: source type: `Option<T>` (`T` is too generic to determine the layout)
5353
= note: target type: `i32` (32 bits)
5454

5555
error: aborting due to 6 previous errors

0 commit comments

Comments
 (0)