Test -Zthir-unsafeck for unsafe function calls

This commit is contained in:
LeSeulArtichaut 2021-03-14 20:11:37 +01:00
parent 29780f43e2
commit a95b342f02
46 changed files with 422 additions and 45 deletions

View file

@ -1,5 +1,5 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-28776.rs:4:5
--> $DIR/issue-28776.rs:7:5
|
LL | (&ptr::write)(1 as *mut _, 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function

View file

@ -1,3 +1,6 @@
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
use std::ptr;
fn main() {

View file

@ -0,0 +1,11 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-28776.rs:7:5
|
LL | (&ptr::write)(1 as *mut _, 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
For more information about this error, try `rustc --explain E0133`.

View file

@ -1,5 +1,5 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-3080.rs:7:5
--> $DIR/issue-3080.rs:10:5
|
LL | X(()).with();
| ^^^^^^^^^^^^ call to unsafe function

View file

@ -1,3 +1,6 @@
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
struct X(());
impl X {
pub unsafe fn with(&self) { }

View file

@ -0,0 +1,11 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-3080.rs:10:5
|
LL | X(()).with();
| ^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
For more information about this error, try `rustc --explain E0133`.

View file

@ -1,5 +1,5 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-5844.rs:6:5
--> $DIR/issue-5844.rs:8:5
|
LL | issue_5844_aux::rand();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function

View file

@ -1,4 +1,6 @@
//aux-build:issue-5844-aux.rs
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
extern crate issue_5844_aux;

View file

@ -0,0 +1,11 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/issue-5844.rs:8:5
|
LL | issue_5844_aux::rand();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
error: aborting due to previous error
For more information about this error, try `rustc --explain E0133`.