From a95b342f0283dd213ef0248bc1a42e158dbef603 Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Sun, 14 Mar 2021 20:11:37 +0100 Subject: Test `-Zthir-unsafeck` for unsafe function calls --- src/test/ui/error-codes/E0133.mir.stderr | 11 +++++++++++ src/test/ui/error-codes/E0133.rs | 3 +++ src/test/ui/error-codes/E0133.stderr | 11 ----------- src/test/ui/error-codes/E0133.thir.stderr | 11 +++++++++++ 4 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 src/test/ui/error-codes/E0133.mir.stderr delete mode 100644 src/test/ui/error-codes/E0133.stderr create mode 100644 src/test/ui/error-codes/E0133.thir.stderr (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0133.mir.stderr b/src/test/ui/error-codes/E0133.mir.stderr new file mode 100644 index 00000000000..b11d5e2c2fc --- /dev/null +++ b/src/test/ui/error-codes/E0133.mir.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/E0133.rs:7:5 + | +LL | f(); + | ^^^ 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`. diff --git a/src/test/ui/error-codes/E0133.rs b/src/test/ui/error-codes/E0133.rs index 52494ce6078..dee1475ba21 100644 --- a/src/test/ui/error-codes/E0133.rs +++ b/src/test/ui/error-codes/E0133.rs @@ -1,3 +1,6 @@ +// revisions: mir thir +// [thir]compile-flags: -Z thir-unsafeck + unsafe fn f() { return; } fn main() { diff --git a/src/test/ui/error-codes/E0133.stderr b/src/test/ui/error-codes/E0133.stderr deleted file mode 100644 index 1eb696506f3..00000000000 --- a/src/test/ui/error-codes/E0133.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/E0133.rs:4:5 - | -LL | f(); - | ^^^ 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`. diff --git a/src/test/ui/error-codes/E0133.thir.stderr b/src/test/ui/error-codes/E0133.thir.stderr new file mode 100644 index 00000000000..b11d5e2c2fc --- /dev/null +++ b/src/test/ui/error-codes/E0133.thir.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/E0133.rs:7:5 + | +LL | f(); + | ^^^ 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`. -- cgit 1.4.1-3-g733a5