Update test error compilation message for E0512

This commit is contained in:
Guillaume Gomez 2015-10-13 10:25:31 +02:00
parent 2624772c68
commit 35f8184f7d
2 changed files with 5 additions and 5 deletions

View File

@ -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() { }

View File

@ -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
} }
} }