Update test error compilation message for E0512
This commit is contained in:
parent
2624772c68
commit
35f8184f7d
2 changed files with 5 additions and 5 deletions
|
@ -15,11 +15,11 @@
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
|
|
||||||
fn a<T, U: ?Sized>(x: &[T]) -> &U {
|
fn a<T, U: ?Sized>(x: &[T]) -> &U {
|
||||||
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
|
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
|
||||||
}
|
}
|
||||||
|
|
||||||
fn b<T: ?Sized, U: ?Sized>(x: &T) -> &U {
|
fn b<T: ?Sized, U: ?Sized>(x: &T) -> &U {
|
||||||
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
|
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
|
||||||
}
|
}
|
||||||
|
|
||||||
fn c<T, U>(x: &T) -> &U {
|
fn c<T, U>(x: &T) -> &U {
|
||||||
|
@ -31,11 +31,11 @@ fn d<T, U>(x: &[T]) -> &[U] {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn e<T: ?Sized, U>(x: &T) -> &U {
|
fn e<T: ?Sized, U>(x: &T) -> &U {
|
||||||
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
|
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
|
||||||
}
|
}
|
||||||
|
|
||||||
fn f<T, U: ?Sized>(x: &T) -> &U {
|
fn f<T, U: ?Sized>(x: &T) -> &U {
|
||||||
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
|
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -26,7 +26,7 @@ impl<T: ?Sized> Foo<T> {
|
||||||
|
|
||||||
fn n(x: &T) -> &isize {
|
fn n(x: &T) -> &isize {
|
||||||
// Not OK here, because T : Sized is not in scope.
|
// Not OK here, because T : Sized is not in scope.
|
||||||
unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
|
unsafe { transmute(x) } //~ ERROR transmute called with differently sized types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue