Rollup merge of #81481 - lcnr:cast-tests, r=jackh726

move some tests
This commit is contained in:
Jonas Schievink 2021-02-02 12:14:54 +01:00 committed by GitHub
commit e6e76c7669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 9 deletions

View File

@ -0,0 +1,5 @@
struct A;
fn main() {
println!("{:?}", 1.0 as *const A); //~ERROR casting `f64` as `*const A` is invalid
}

View File

@ -1,7 +1,7 @@
error[E0606]: casting `f64` as `*const A` is invalid
--> $DIR/unsupported-cast.rs:6:20
--> $DIR/unsupported-cast.rs:4:20
|
LL | println!("{:?}", 1.0 as *const A); // Can't cast float to foreign.
LL | println!("{:?}", 1.0 as *const A);
| ^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -1,7 +0,0 @@
// error-pattern:casting
struct A;
fn main() {
println!("{:?}", 1.0 as *const A); // Can't cast float to foreign.
}