Skip to content

Commit beeaea4

Browse files
committed
Auto merge of #28957 - GuillaumeGomez:patch-5, r=Manishearth
cc @nagisa
2 parents 17776fd + a3f9fc6 commit beeaea4

7 files changed

+12
-12
lines changed

src/doc/trpl/casting-between-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ unsafe {
8282
with:
8383

8484
```text
85-
error: transmute called on types with different sizes: [u8; 4] (32 bits) to u64
85+
error: transmute called with differently sized types: [u8; 4] (32 bits) to u64
8686
(64 bits)
8787
```
8888

src/librustc_trans/trans/intrinsic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn check_intrinsics(ccx: &CrateContext) {
135135

136136
if transmute_restriction.original_from != transmute_restriction.substituted_from {
137137
span_transmute_size_error(ccx.sess(), transmute_restriction.span,
138-
&format!("transmute called on types with potentially different sizes: \
138+
&format!("transmute called with differently sized types: \
139139
{} (could be {} bit{}) to {} (could be {} bit{})",
140140
transmute_restriction.original_from,
141141
from_type_size as usize,
@@ -145,7 +145,7 @@ pub fn check_intrinsics(ccx: &CrateContext) {
145145
if to_type_size == 1 {""} else {"s"}));
146146
} else {
147147
span_transmute_size_error(ccx.sess(), transmute_restriction.span,
148-
&format!("transmute called on types with different sizes: \
148+
&format!("transmute called with differently sized types: \
149149
{} ({} bit{}) to {} ({} bit{})",
150150
transmute_restriction.original_from,
151151
from_type_size as usize,

src/test/compile-fail/packed-struct-generic-transmute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// the error points to the start of the file, not the line with the
1414
// transmute
1515

16-
// error-pattern: transmute called on types with different size
16+
// error-pattern: transmute called with differently sized types
1717

1818
use std::mem;
1919

src/test/compile-fail/packed-struct-transmute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// the error points to the start of the file, not the line with the
1414
// transmute
1515

16-
// error-pattern: transmute called on types with different size
16+
// error-pattern: transmute called with differently sized types
1717

1818
use std::mem;
1919

src/test/compile-fail/transmute-different-sizes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ use std::mem::transmute;
1616

1717
unsafe fn f() {
1818
let _: i8 = transmute(16i16);
19-
//~^ ERROR transmute called on types with different sizes
19+
//~^ ERROR transmute called with differently sized types
2020
}
2121

2222
unsafe fn g<T>(x: &T) {
2323
let _: i8 = transmute(x);
24-
//~^ ERROR transmute called on types with potentially different sizes
24+
//~^ ERROR transmute called with differently sized types
2525
}
2626

2727
fn main() {}

src/test/compile-fail/transmute-fat-pointers.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use std::mem::transmute;
1616

1717
fn a<T, U: ?Sized>(x: &[T]) -> &U {
18-
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
18+
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
1919
}
2020

2121
fn b<T: ?Sized, U: ?Sized>(x: &T) -> &U {
22-
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
22+
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
2323
}
2424

2525
fn c<T, U>(x: &T) -> &U {
@@ -31,11 +31,11 @@ fn d<T, U>(x: &[T]) -> &[U] {
3131
}
3232

3333
fn e<T: ?Sized, U>(x: &T) -> &U {
34-
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
34+
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
3535
}
3636

3737
fn f<T, U: ?Sized>(x: &T) -> &U {
38-
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
38+
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
3939
}
4040

4141
fn main() { }

src/test/compile-fail/transmute-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<T: ?Sized> Foo<T> {
2626

2727
fn n(x: &T) -> &isize {
2828
// Not OK here, because T : Sized is not in scope.
29-
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
29+
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
3030
}
3131
}
3232

0 commit comments

Comments
 (0)