diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 559874641c3d5..ce76c2cba939c 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -735,9 +735,9 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
sess.time("MIR_borrow_checking", || {
tcx.hir().par_body_owners(|def_id| {
- // Run THIR unsafety check because it's responsible for stealing
- // and deallocating THIR when enabled.
- tcx.ensure().thir_check_unsafety(def_id);
+ // Run unsafety check because it's responsible for stealing and
+ // deallocating THIR.
+ tcx.ensure().check_unsafety(def_id);
tcx.ensure().mir_borrowck(def_id)
});
});
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index c4a1f3a0e510b..75410db1e364c 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -822,7 +822,7 @@ fn test_unstable_options_tracking_hash() {
tracked!(stack_protector, StackProtector::All);
tracked!(teach, true);
tracked!(thinlto, Some(true));
- tracked!(thir_unsafeck, true);
+ tracked!(thir_unsafeck, false);
tracked!(tiny_const_eval_limit, true);
tracked!(tls_model, Some(TlsModel::GeneralDynamic));
tracked!(translate_remapped_path_to_local_path, false);
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 5c425fef27ebc..0a1a72b442a02 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -720,7 +720,7 @@ pub struct SourceInfo {
pub span: Span,
/// The source scope, keeping track of which bindings can be
- /// seen by debuginfo, active lint levels, `unsafe {...}`, etc.
+ /// seen by debuginfo, active lint levels, etc.
pub scope: SourceScope,
}
@@ -942,7 +942,7 @@ pub struct LocalDecl<'tcx> {
/// Extra information about a some locals that's used for diagnostics and for
/// classifying variables into local variables, statics, etc, which is needed e.g.
-/// for unsafety checking.
+/// for borrow checking.
///
/// Not used for non-StaticRef temporaries, the return place, or anonymous
/// function parameters.
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 2810182c0a0dc..bf5e59ba78d13 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -869,15 +869,14 @@ rustc_queries! {
desc { |tcx| "collecting all inherent impls for `{:?}`", key }
}
- /// The result of unsafety-checking this `LocalDefId`.
- query unsafety_check_result(key: LocalDefId) -> &'tcx mir::UnsafetyCheckResult {
+ /// The result of unsafety-checking this `LocalDefId` with the old checker.
+ query mir_unsafety_check_result(key: LocalDefId) -> &'tcx mir::UnsafetyCheckResult {
desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
cache_on_disk_if { true }
}
- /// Unsafety-check this `LocalDefId` with THIR unsafeck. This should be
- /// used with `-Zthir-unsafeck`.
- query thir_check_unsafety(key: LocalDefId) {
+ /// Unsafety-check this `LocalDefId`.
+ query check_unsafety(key: LocalDefId) {
desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
cache_on_disk_if { true }
}
diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs
index 2e8b6c19ec784..b4a02fae4544b 100644
--- a/compiler/rustc_mir_build/src/check_unsafety.rs
+++ b/compiler/rustc_mir_build/src/check_unsafety.rs
@@ -14,7 +14,7 @@ use rustc_session::lint::builtin::{UNSAFE_OP_IN_UNSAFE_FN, UNUSED_UNSAFE};
use rustc_session::lint::Level;
use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::symbol::Symbol;
-use rustc_span::Span;
+use rustc_span::{sym, Span};
use std::mem;
use std::ops::Bound;
@@ -144,11 +144,17 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
let hir_context = self.tcx.local_def_id_to_hir_id(def);
let safety_context = mem::replace(&mut self.safety_context, SafetyContext::Safe);
let mut inner_visitor = UnsafetyVisitor {
+ tcx: self.tcx,
thir: inner_thir,
hir_context,
safety_context,
+ body_target_features: self.body_target_features,
+ assignment_info: self.assignment_info,
+ in_union_destructure: false,
+ param_env: self.param_env,
+ inside_adt: false,
warnings: self.warnings,
- ..*self
+ suggest_unsafe_block: self.suggest_unsafe_block,
};
inner_visitor.visit_expr(&inner_thir[expr]);
// Unsafe blocks can be used in the inner body, make sure to take it into account
@@ -886,14 +892,15 @@ impl UnsafeOpKind {
}
}
-pub fn thir_check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
- // THIR unsafeck is gated under `-Z thir-unsafeck`
+pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
+ // THIR unsafeck can be disabled with `-Z thir-unsafeck=off`
if !tcx.sess.opts.unstable_opts.thir_unsafeck {
return;
}
// Closures and inline consts are handled by their owner, if it has a body
- if tcx.is_typeck_child(def.to_def_id()) {
+ // Also, don't safety check custom MIR
+ if tcx.is_typeck_child(def.to_def_id()) || tcx.has_attr(def, sym::custom_mir) {
return;
}
diff --git a/compiler/rustc_mir_build/src/lib.rs b/compiler/rustc_mir_build/src/lib.rs
index a776e917de57a..430c4ee3da780 100644
--- a/compiler/rustc_mir_build/src/lib.rs
+++ b/compiler/rustc_mir_build/src/lib.rs
@@ -31,7 +31,7 @@ pub fn provide(providers: &mut Providers) {
providers.mir_built = build::mir_built;
providers.closure_saved_names_of_captured_variables =
build::closure_saved_names_of_captured_variables;
- providers.thir_check_unsafety = check_unsafety::thir_check_unsafety;
+ providers.check_unsafety = check_unsafety::check_unsafety;
providers.thir_body = thir::cx::thir_body;
providers.thir_tree = thir::print::thir_tree;
providers.thir_flat = thir::print::thir_flat;
diff --git a/compiler/rustc_mir_transform/src/check_unsafety.rs b/compiler/rustc_mir_transform/src/check_unsafety.rs
index d94d96c1115ca..582c2c0c6b60b 100644
--- a/compiler/rustc_mir_transform/src/check_unsafety.rs
+++ b/compiler/rustc_mir_transform/src/check_unsafety.rs
@@ -131,7 +131,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
&AggregateKind::Closure(def_id, _) | &AggregateKind::Coroutine(def_id, _) => {
let def_id = def_id.expect_local();
let UnsafetyCheckResult { violations, used_unsafe_blocks, .. } =
- self.tcx.unsafety_check_result(def_id);
+ self.tcx.mir_unsafety_check_result(def_id);
self.register_violations(violations, used_unsafe_blocks.items().copied());
}
},
@@ -153,7 +153,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
if self.tcx.def_kind(def_id) == DefKind::InlineConst {
let local_def_id = def_id.expect_local();
let UnsafetyCheckResult { violations, used_unsafe_blocks, .. } =
- self.tcx.unsafety_check_result(local_def_id);
+ self.tcx.mir_unsafety_check_result(local_def_id);
self.register_violations(violations, used_unsafe_blocks.items().copied());
}
}
@@ -390,7 +390,7 @@ impl<'tcx> UnsafetyChecker<'_, 'tcx> {
}
pub(crate) fn provide(providers: &mut Providers) {
- *providers = Providers { unsafety_check_result, ..*providers };
+ *providers = Providers { mir_unsafety_check_result, ..*providers };
}
/// Context information for [`UnusedUnsafeVisitor`] traversal,
@@ -490,7 +490,7 @@ fn check_unused_unsafe(
unused_unsafes
}
-fn unsafety_check_result(tcx: TyCtxt<'_>, def: LocalDefId) -> &UnsafetyCheckResult {
+fn mir_unsafety_check_result(tcx: TyCtxt<'_>, def: LocalDefId) -> &UnsafetyCheckResult {
debug!("unsafety_violations({:?})", def);
// N.B., this borrow is valid because all the consumers of
@@ -538,7 +538,8 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: LocalDefId) {
return;
}
- let UnsafetyCheckResult { violations, unused_unsafes, .. } = tcx.unsafety_check_result(def_id);
+ let UnsafetyCheckResult { violations, unused_unsafes, .. } =
+ tcx.mir_unsafety_check_result(def_id);
// Only suggest wrapping the entire function body in an unsafe block once
let mut suggest_unsafe_block = true;
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index 5562ae7f3bdef..164b6b9c4f5cc 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -285,9 +285,9 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: LocalDefId) -> ConstQualifs {
/// FIXME(oli-obk): it's unclear whether we still need this phase (and its corresponding query).
/// We used to have this for pre-miri MIR based const eval.
fn mir_const(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal
> {
- // Unsafety check uses the raw mir, so make sure it is run.
+ // MIR unsafety check uses the raw mir, so make sure it is run.
if !tcx.sess.opts.unstable_opts.thir_unsafeck {
- tcx.ensure_with_value().unsafety_check_result(def);
+ tcx.ensure_with_value().mir_unsafety_check_result(def);
}
// has_ffi_unwind_calls query uses the raw mir, so make sure it is run.
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 8274fd05bc057..0b0b67ef890b0 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -1919,8 +1919,8 @@ written to standard error output)"),
#[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
thinlto: Option = (None, parse_opt_bool, [TRACKED],
"enable ThinLTO when possible"),
- thir_unsafeck: bool = (false, parse_bool, [TRACKED],
- "use the THIR unsafety checker (default: no)"),
+ thir_unsafeck: bool = (true, parse_bool, [TRACKED],
+ "use the THIR unsafety checker (default: yes)"),
/// We default to 1 here since we want to behave like
/// a sequential compiler for now. This'll likely be adjusted
/// in the future. Note that -Zthreads=0 is the way to get
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index dfa386b49de7c..b4745d4883c55 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};
const ENTRY_LIMIT: usize = 900;
// FIXME: The following limits should be reduced eventually.
-const ISSUES_ENTRY_LIMIT: usize = 1852;
+const ISSUES_ENTRY_LIMIT: usize = 1849;
const ROOT_ENTRY_LIMIT: usize = 867;
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
diff --git a/tests/ui/asm/aarch64/const.rs b/tests/ui/asm/aarch64/const.rs
index de299bfdbdfc9..0b02c99abf662 100644
--- a/tests/ui/asm/aarch64/const.rs
+++ b/tests/ui/asm/aarch64/const.rs
@@ -1,8 +1,6 @@
// only-aarch64
// run-pass
// needs-asm-support
-// revisions: mirunsafeck thirunsafeck
-// [thirunsafeck]compile-flags: -Z thir-unsafeck
#![feature(asm_const)]
diff --git a/tests/ui/asm/bad-arch.rs b/tests/ui/asm/bad-arch.rs
index 93309899bf387..3eeb76f3d0035 100644
--- a/tests/ui/asm/bad-arch.rs
+++ b/tests/ui/asm/bad-arch.rs
@@ -1,7 +1,5 @@
// compile-flags: --target sparc-unknown-linux-gnu
// needs-llvm-components: sparc
-// revisions: mirunsafeck thirunsafeck
-// [thirunsafeck]compile-flags: -Z thir-unsafeck
#![feature(no_core, lang_items, rustc_attrs)]
#![no_core]
diff --git a/tests/ui/asm/bad-arch.mirunsafeck.stderr b/tests/ui/asm/bad-arch.stderr
similarity index 89%
rename from tests/ui/asm/bad-arch.mirunsafeck.stderr
rename to tests/ui/asm/bad-arch.stderr
index d7af296152f79..23aad9908ef02 100644
--- a/tests/ui/asm/bad-arch.mirunsafeck.stderr
+++ b/tests/ui/asm/bad-arch.stderr
@@ -1,11 +1,11 @@
error[E0472]: inline assembly is unsupported on this target
- --> $DIR/bad-arch.rs:22:9
+ --> $DIR/bad-arch.rs:20:9
|
LL | asm!("");
| ^^^^^^^^
error[E0472]: inline assembly is unsupported on this target
- --> $DIR/bad-arch.rs:27:1
+ --> $DIR/bad-arch.rs:25:1
|
LL | global_asm!("");
| ^^^^^^^^^^^^^^^
diff --git a/tests/ui/asm/bad-arch.thirunsafeck.stderr b/tests/ui/asm/bad-arch.thirunsafeck.stderr
deleted file mode 100644
index d7af296152f79..0000000000000
--- a/tests/ui/asm/bad-arch.thirunsafeck.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0472]: inline assembly is unsupported on this target
- --> $DIR/bad-arch.rs:22:9
- |
-LL | asm!("");
- | ^^^^^^^^
-
-error[E0472]: inline assembly is unsupported on this target
- --> $DIR/bad-arch.rs:27:1
- |
-LL | global_asm!("");
- | ^^^^^^^^^^^^^^^
- |
- = note: this error originates in the macro `global_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0472`.
diff --git a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64.stderr
similarity index 86%
rename from tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr
rename to tests/ui/asm/bad-template.aarch64.stderr
index b16f9a06c2abe..4ffcd2303b74f 100644
--- a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.aarch64.stderr
@@ -1,5 +1,5 @@
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:31:15
+ --> $DIR/bad-template.rs:27:15
|
LL | asm!("{}");
| ^^ from here
@@ -7,7 +7,7 @@ LL | asm!("{}");
= note: no arguments were given
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:33:15
+ --> $DIR/bad-template.rs:29:15
|
LL | asm!("{1}", in(reg) foo);
| ^^^ from here
@@ -15,7 +15,7 @@ LL | asm!("{1}", in(reg) foo);
= note: there is 1 argument
error: argument never used
- --> $DIR/bad-template.rs:33:21
+ --> $DIR/bad-template.rs:29:21
|
LL | asm!("{1}", in(reg) foo);
| ^^^^^^^^^^^ argument never used
@@ -23,13 +23,13 @@ LL | asm!("{1}", in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
error: there is no argument named `a`
- --> $DIR/bad-template.rs:36:16
+ --> $DIR/bad-template.rs:32:16
|
LL | asm!("{a}");
| ^
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:38:15
+ --> $DIR/bad-template.rs:34:15
|
LL | asm!("{}", a = in(reg) foo);
| ^^ --------------- named argument
@@ -38,13 +38,13 @@ LL | asm!("{}", a = in(reg) foo);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:38:20
+ --> $DIR/bad-template.rs:34:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^
error: named argument never used
- --> $DIR/bad-template.rs:38:20
+ --> $DIR/bad-template.rs:34:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
@@ -52,7 +52,7 @@ LL | asm!("{}", a = in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:41:15
+ --> $DIR/bad-template.rs:37:15
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^ from here
@@ -60,7 +60,7 @@ LL | asm!("{1}", a = in(reg) foo);
= note: no positional arguments were given
error: named argument never used
- --> $DIR/bad-template.rs:41:21
+ --> $DIR/bad-template.rs:37:21
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
@@ -68,7 +68,7 @@ LL | asm!("{1}", a = in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:48:15
+ --> $DIR/bad-template.rs:44:15
|
LL | asm!("{}", in("x0") foo);
| ^^ ------------ explicit register argument
@@ -77,24 +77,24 @@ LL | asm!("{}", in("x0") foo);
|
= note: no positional arguments were given
note: explicit register arguments cannot be used in the asm template
- --> $DIR/bad-template.rs:48:20
+ --> $DIR/bad-template.rs:44:20
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^
help: use the register name directly in the assembly code
- --> $DIR/bad-template.rs:48:20
+ --> $DIR/bad-template.rs:44:20
|
LL | asm!("{}", in("x0") foo);
| ^^^^^^^^^^^^
error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:50:17
+ --> $DIR/bad-template.rs:46:17
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^
error: multiple unused asm arguments
- --> $DIR/bad-template.rs:53:18
+ --> $DIR/bad-template.rs:49:18
|
LL | asm!("", in(reg) 0, in(reg) 1);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
@@ -104,7 +104,7 @@ LL | asm!("", in(reg) 0, in(reg) 1);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:59:14
+ --> $DIR/bad-template.rs:55:14
|
LL | global_asm!("{}");
| ^^ from here
@@ -112,7 +112,7 @@ LL | global_asm!("{}");
= note: no arguments were given
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:61:14
+ --> $DIR/bad-template.rs:57:14
|
LL | global_asm!("{1}", const FOO);
| ^^^ from here
@@ -120,7 +120,7 @@ LL | global_asm!("{1}", const FOO);
= note: there is 1 argument
error: argument never used
- --> $DIR/bad-template.rs:61:20
+ --> $DIR/bad-template.rs:57:20
|
LL | global_asm!("{1}", const FOO);
| ^^^^^^^^^ argument never used
@@ -128,13 +128,13 @@ LL | global_asm!("{1}", const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
error: there is no argument named `a`
- --> $DIR/bad-template.rs:64:15
+ --> $DIR/bad-template.rs:60:15
|
LL | global_asm!("{a}");
| ^
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:66:14
+ --> $DIR/bad-template.rs:62:14
|
LL | global_asm!("{}", a = const FOO);
| ^^ ------------- named argument
@@ -143,13 +143,13 @@ LL | global_asm!("{}", a = const FOO);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:66:19
+ --> $DIR/bad-template.rs:62:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^
error: named argument never used
- --> $DIR/bad-template.rs:66:19
+ --> $DIR/bad-template.rs:62:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
@@ -157,7 +157,7 @@ LL | global_asm!("{}", a = const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:69:14
+ --> $DIR/bad-template.rs:65:14
|
LL | global_asm!("{1}", a = const FOO);
| ^^^ from here
@@ -165,7 +165,7 @@ LL | global_asm!("{1}", a = const FOO);
= note: no positional arguments were given
error: named argument never used
- --> $DIR/bad-template.rs:69:20
+ --> $DIR/bad-template.rs:65:20
|
LL | global_asm!("{1}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
@@ -173,13 +173,13 @@ LL | global_asm!("{1}", a = const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:72:16
+ --> $DIR/bad-template.rs:68:16
|
LL | global_asm!("{:foo}", const FOO);
| ^^^
error: multiple unused asm arguments
- --> $DIR/bad-template.rs:74:17
+ --> $DIR/bad-template.rs:70:17
|
LL | global_asm!("", const FOO, const FOO);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
@@ -189,7 +189,7 @@ LL | global_asm!("", const FOO, const FOO);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
warning: formatting may not be suitable for sub-register argument
- --> $DIR/bad-template.rs:50:15
+ --> $DIR/bad-template.rs:46:15
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
diff --git a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr
deleted file mode 100644
index b16f9a06c2abe..0000000000000
--- a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr
+++ /dev/null
@@ -1,202 +0,0 @@
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:31:15
- |
-LL | asm!("{}");
- | ^^ from here
- |
- = note: no arguments were given
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:33:15
- |
-LL | asm!("{1}", in(reg) foo);
- | ^^^ from here
- |
- = note: there is 1 argument
-
-error: argument never used
- --> $DIR/bad-template.rs:33:21
- |
-LL | asm!("{1}", in(reg) foo);
- | ^^^^^^^^^^^ argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
-
-error: there is no argument named `a`
- --> $DIR/bad-template.rs:36:16
- |
-LL | asm!("{a}");
- | ^
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:38:15
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^ --------------- named argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:38:20
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^
-
-error: named argument never used
- --> $DIR/bad-template.rs:38:20
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:41:15
- |
-LL | asm!("{1}", a = in(reg) foo);
- | ^^^ from here
- |
- = note: no positional arguments were given
-
-error: named argument never used
- --> $DIR/bad-template.rs:41:21
- |
-LL | asm!("{1}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:48:15
- |
-LL | asm!("{}", in("x0") foo);
- | ^^ ------------ explicit register argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: explicit register arguments cannot be used in the asm template
- --> $DIR/bad-template.rs:48:20
- |
-LL | asm!("{}", in("x0") foo);
- | ^^^^^^^^^^^^
-help: use the register name directly in the assembly code
- --> $DIR/bad-template.rs:48:20
- |
-LL | asm!("{}", in("x0") foo);
- | ^^^^^^^^^^^^
-
-error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:50:17
- |
-LL | asm!("{:foo}", in(reg) foo);
- | ^^^
-
-error: multiple unused asm arguments
- --> $DIR/bad-template.rs:53:18
- |
-LL | asm!("", in(reg) 0, in(reg) 1);
- | ^^^^^^^^^ ^^^^^^^^^ argument never used
- | |
- | argument never used
- |
- = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:59:14
- |
-LL | global_asm!("{}");
- | ^^ from here
- |
- = note: no arguments were given
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:61:14
- |
-LL | global_asm!("{1}", const FOO);
- | ^^^ from here
- |
- = note: there is 1 argument
-
-error: argument never used
- --> $DIR/bad-template.rs:61:20
- |
-LL | global_asm!("{1}", const FOO);
- | ^^^^^^^^^ argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
-
-error: there is no argument named `a`
- --> $DIR/bad-template.rs:64:15
- |
-LL | global_asm!("{a}");
- | ^
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:66:14
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^ ------------- named argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:66:19
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^^^^^^^^^^^^
-
-error: named argument never used
- --> $DIR/bad-template.rs:66:19
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:69:14
- |
-LL | global_asm!("{1}", a = const FOO);
- | ^^^ from here
- |
- = note: no positional arguments were given
-
-error: named argument never used
- --> $DIR/bad-template.rs:69:20
- |
-LL | global_asm!("{1}", a = const FOO);
- | ^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:72:16
- |
-LL | global_asm!("{:foo}", const FOO);
- | ^^^
-
-error: multiple unused asm arguments
- --> $DIR/bad-template.rs:74:17
- |
-LL | global_asm!("", const FOO, const FOO);
- | ^^^^^^^^^ ^^^^^^^^^ argument never used
- | |
- | argument never used
- |
- = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
-
-warning: formatting may not be suitable for sub-register argument
- --> $DIR/bad-template.rs:50:15
- |
-LL | asm!("{:foo}", in(reg) foo);
- | ^^^^^^ --- for this argument
- |
- = help: use `{0:w}` to have the register formatted as `w0`
- = help: or use `{0:x}` to keep the default formatting of `x0`
- = note: `#[warn(asm_sub_register)]` on by default
-
-error: aborting due to 21 previous errors; 1 warning emitted
-
diff --git a/tests/ui/asm/bad-template.rs b/tests/ui/asm/bad-template.rs
index 556371747920e..a6a233a36ec38 100644
--- a/tests/ui/asm/bad-template.rs
+++ b/tests/ui/asm/bad-template.rs
@@ -1,14 +1,10 @@
-// revisions: x86_64_mirunsafeck aarch64_mirunsafeck x86_64_thirunsafeck aarch64_thirunsafeck
+// revisions: x86_64 aarch64
-// [x86_64_thirunsafeck] compile-flags: -Z thir-unsafeck --target x86_64-unknown-linux-gnu
-// [aarch64_thirunsafeck] compile-flags: -Z thir-unsafeck --target aarch64-unknown-linux-gnu
-// [x86_64_mirunsafeck] compile-flags: --target x86_64-unknown-linux-gnu
-// [aarch64_mirunsafeck] compile-flags: --target aarch64-unknown-linux-gnu
+// [x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+// [aarch64] compile-flags: --target aarch64-unknown-linux-gnu
-// [x86_64_thirunsafeck] needs-llvm-components: x86
-// [x86_64_mirunsafeck] needs-llvm-components: x86
-// [aarch64_thirunsafeck] needs-llvm-components: aarch64
-// [aarch64_mirunsafeck] needs-llvm-components: aarch64
+// [x86_64] needs-llvm-components: x86
+// [aarch64] needs-llvm-components: aarch64
#![feature(no_core, lang_items, rustc_attrs, asm_const)]
#![no_core]
@@ -41,12 +37,12 @@ fn main() {
asm!("{1}", a = in(reg) foo);
//~^ ERROR invalid reference to argument at index 1
//~^^ ERROR named argument never used
- #[cfg(any(x86_64_thirunsafeck, x86_64_mirunsafeck))]
+ #[cfg(any(x86_64))]
asm!("{}", in("eax") foo);
- //[x86_64_thirunsafeck,x86_64_mirunsafeck]~^ ERROR invalid reference to argument at index 0
- #[cfg(any(aarch64_thirunsafeck, aarch64_mirunsafeck))]
+ //[x86_64]~^ ERROR invalid reference to argument at index 0
+ #[cfg(any(aarch64))]
asm!("{}", in("x0") foo);
- //[aarch64_thirunsafeck,aarch64_mirunsafeck]~^ ERROR invalid reference to argument at index 0
+ //[aarch64]~^ ERROR invalid reference to argument at index 0
asm!("{:foo}", in(reg) foo);
//~^ ERROR asm template modifier must be a single character
//~| WARN formatting may not be suitable for sub-register argument [asm_sub_register]
diff --git a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64.stderr
similarity index 86%
rename from tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr
rename to tests/ui/asm/bad-template.x86_64.stderr
index 41ac37c33c2e0..52a7789b98cc1 100644
--- a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr
+++ b/tests/ui/asm/bad-template.x86_64.stderr
@@ -1,5 +1,5 @@
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:31:15
+ --> $DIR/bad-template.rs:27:15
|
LL | asm!("{}");
| ^^ from here
@@ -7,7 +7,7 @@ LL | asm!("{}");
= note: no arguments were given
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:33:15
+ --> $DIR/bad-template.rs:29:15
|
LL | asm!("{1}", in(reg) foo);
| ^^^ from here
@@ -15,7 +15,7 @@ LL | asm!("{1}", in(reg) foo);
= note: there is 1 argument
error: argument never used
- --> $DIR/bad-template.rs:33:21
+ --> $DIR/bad-template.rs:29:21
|
LL | asm!("{1}", in(reg) foo);
| ^^^^^^^^^^^ argument never used
@@ -23,13 +23,13 @@ LL | asm!("{1}", in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
error: there is no argument named `a`
- --> $DIR/bad-template.rs:36:16
+ --> $DIR/bad-template.rs:32:16
|
LL | asm!("{a}");
| ^
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:38:15
+ --> $DIR/bad-template.rs:34:15
|
LL | asm!("{}", a = in(reg) foo);
| ^^ --------------- named argument
@@ -38,13 +38,13 @@ LL | asm!("{}", a = in(reg) foo);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:38:20
+ --> $DIR/bad-template.rs:34:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^
error: named argument never used
- --> $DIR/bad-template.rs:38:20
+ --> $DIR/bad-template.rs:34:20
|
LL | asm!("{}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
@@ -52,7 +52,7 @@ LL | asm!("{}", a = in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:41:15
+ --> $DIR/bad-template.rs:37:15
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^ from here
@@ -60,7 +60,7 @@ LL | asm!("{1}", a = in(reg) foo);
= note: no positional arguments were given
error: named argument never used
- --> $DIR/bad-template.rs:41:21
+ --> $DIR/bad-template.rs:37:21
|
LL | asm!("{1}", a = in(reg) foo);
| ^^^^^^^^^^^^^^^ named argument never used
@@ -68,7 +68,7 @@ LL | asm!("{1}", a = in(reg) foo);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:45:15
+ --> $DIR/bad-template.rs:41:15
|
LL | asm!("{}", in("eax") foo);
| ^^ ------------- explicit register argument
@@ -77,24 +77,24 @@ LL | asm!("{}", in("eax") foo);
|
= note: no positional arguments were given
note: explicit register arguments cannot be used in the asm template
- --> $DIR/bad-template.rs:45:20
+ --> $DIR/bad-template.rs:41:20
|
LL | asm!("{}", in("eax") foo);
| ^^^^^^^^^^^^^
help: use the register name directly in the assembly code
- --> $DIR/bad-template.rs:45:20
+ --> $DIR/bad-template.rs:41:20
|
LL | asm!("{}", in("eax") foo);
| ^^^^^^^^^^^^^
error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:50:17
+ --> $DIR/bad-template.rs:46:17
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^
error: multiple unused asm arguments
- --> $DIR/bad-template.rs:53:18
+ --> $DIR/bad-template.rs:49:18
|
LL | asm!("", in(reg) 0, in(reg) 1);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
@@ -104,7 +104,7 @@ LL | asm!("", in(reg) 0, in(reg) 1);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:59:14
+ --> $DIR/bad-template.rs:55:14
|
LL | global_asm!("{}");
| ^^ from here
@@ -112,7 +112,7 @@ LL | global_asm!("{}");
= note: no arguments were given
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:61:14
+ --> $DIR/bad-template.rs:57:14
|
LL | global_asm!("{1}", const FOO);
| ^^^ from here
@@ -120,7 +120,7 @@ LL | global_asm!("{1}", const FOO);
= note: there is 1 argument
error: argument never used
- --> $DIR/bad-template.rs:61:20
+ --> $DIR/bad-template.rs:57:20
|
LL | global_asm!("{1}", const FOO);
| ^^^^^^^^^ argument never used
@@ -128,13 +128,13 @@ LL | global_asm!("{1}", const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
error: there is no argument named `a`
- --> $DIR/bad-template.rs:64:15
+ --> $DIR/bad-template.rs:60:15
|
LL | global_asm!("{a}");
| ^
error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:66:14
+ --> $DIR/bad-template.rs:62:14
|
LL | global_asm!("{}", a = const FOO);
| ^^ ------------- named argument
@@ -143,13 +143,13 @@ LL | global_asm!("{}", a = const FOO);
|
= note: no positional arguments were given
note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:66:19
+ --> $DIR/bad-template.rs:62:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^
error: named argument never used
- --> $DIR/bad-template.rs:66:19
+ --> $DIR/bad-template.rs:62:19
|
LL | global_asm!("{}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
@@ -157,7 +157,7 @@ LL | global_asm!("{}", a = const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:69:14
+ --> $DIR/bad-template.rs:65:14
|
LL | global_asm!("{1}", a = const FOO);
| ^^^ from here
@@ -165,7 +165,7 @@ LL | global_asm!("{1}", a = const FOO);
= note: no positional arguments were given
error: named argument never used
- --> $DIR/bad-template.rs:69:20
+ --> $DIR/bad-template.rs:65:20
|
LL | global_asm!("{1}", a = const FOO);
| ^^^^^^^^^^^^^ named argument never used
@@ -173,13 +173,13 @@ LL | global_asm!("{1}", a = const FOO);
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:72:16
+ --> $DIR/bad-template.rs:68:16
|
LL | global_asm!("{:foo}", const FOO);
| ^^^
error: multiple unused asm arguments
- --> $DIR/bad-template.rs:74:17
+ --> $DIR/bad-template.rs:70:17
|
LL | global_asm!("", const FOO, const FOO);
| ^^^^^^^^^ ^^^^^^^^^ argument never used
@@ -189,7 +189,7 @@ LL | global_asm!("", const FOO, const FOO);
= help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
warning: formatting may not be suitable for sub-register argument
- --> $DIR/bad-template.rs:50:15
+ --> $DIR/bad-template.rs:46:15
|
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
diff --git a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr
deleted file mode 100644
index 41ac37c33c2e0..0000000000000
--- a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr
+++ /dev/null
@@ -1,202 +0,0 @@
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:31:15
- |
-LL | asm!("{}");
- | ^^ from here
- |
- = note: no arguments were given
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:33:15
- |
-LL | asm!("{1}", in(reg) foo);
- | ^^^ from here
- |
- = note: there is 1 argument
-
-error: argument never used
- --> $DIR/bad-template.rs:33:21
- |
-LL | asm!("{1}", in(reg) foo);
- | ^^^^^^^^^^^ argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
-
-error: there is no argument named `a`
- --> $DIR/bad-template.rs:36:16
- |
-LL | asm!("{a}");
- | ^
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:38:15
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^ --------------- named argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:38:20
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^
-
-error: named argument never used
- --> $DIR/bad-template.rs:38:20
- |
-LL | asm!("{}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:41:15
- |
-LL | asm!("{1}", a = in(reg) foo);
- | ^^^ from here
- |
- = note: no positional arguments were given
-
-error: named argument never used
- --> $DIR/bad-template.rs:41:21
- |
-LL | asm!("{1}", a = in(reg) foo);
- | ^^^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:45:15
- |
-LL | asm!("{}", in("eax") foo);
- | ^^ ------------- explicit register argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: explicit register arguments cannot be used in the asm template
- --> $DIR/bad-template.rs:45:20
- |
-LL | asm!("{}", in("eax") foo);
- | ^^^^^^^^^^^^^
-help: use the register name directly in the assembly code
- --> $DIR/bad-template.rs:45:20
- |
-LL | asm!("{}", in("eax") foo);
- | ^^^^^^^^^^^^^
-
-error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:50:17
- |
-LL | asm!("{:foo}", in(reg) foo);
- | ^^^
-
-error: multiple unused asm arguments
- --> $DIR/bad-template.rs:53:18
- |
-LL | asm!("", in(reg) 0, in(reg) 1);
- | ^^^^^^^^^ ^^^^^^^^^ argument never used
- | |
- | argument never used
- |
- = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:59:14
- |
-LL | global_asm!("{}");
- | ^^ from here
- |
- = note: no arguments were given
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:61:14
- |
-LL | global_asm!("{1}", const FOO);
- | ^^^ from here
- |
- = note: there is 1 argument
-
-error: argument never used
- --> $DIR/bad-template.rs:61:20
- |
-LL | global_asm!("{1}", const FOO);
- | ^^^^^^^^^ argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"`
-
-error: there is no argument named `a`
- --> $DIR/bad-template.rs:64:15
- |
-LL | global_asm!("{a}");
- | ^
-
-error: invalid reference to argument at index 0
- --> $DIR/bad-template.rs:66:14
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^ ------------- named argument
- | |
- | from here
- |
- = note: no positional arguments were given
-note: named arguments cannot be referenced by position
- --> $DIR/bad-template.rs:66:19
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^^^^^^^^^^^^
-
-error: named argument never used
- --> $DIR/bad-template.rs:66:19
- |
-LL | global_asm!("{}", a = const FOO);
- | ^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: invalid reference to argument at index 1
- --> $DIR/bad-template.rs:69:14
- |
-LL | global_asm!("{1}", a = const FOO);
- | ^^^ from here
- |
- = note: no positional arguments were given
-
-error: named argument never used
- --> $DIR/bad-template.rs:69:20
- |
-LL | global_asm!("{1}", a = const FOO);
- | ^^^^^^^^^^^^^ named argument never used
- |
- = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"`
-
-error: asm template modifier must be a single character
- --> $DIR/bad-template.rs:72:16
- |
-LL | global_asm!("{:foo}", const FOO);
- | ^^^
-
-error: multiple unused asm arguments
- --> $DIR/bad-template.rs:74:17
- |
-LL | global_asm!("", const FOO, const FOO);
- | ^^^^^^^^^ ^^^^^^^^^ argument never used
- | |
- | argument never used
- |
- = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"`
-
-warning: formatting may not be suitable for sub-register argument
- --> $DIR/bad-template.rs:50:15
- |
-LL | asm!("{:foo}", in(reg) foo);
- | ^^^^^^ --- for this argument
- |
- = help: use `{0:e}` to have the register formatted as `eax`
- = help: or use `{0:r}` to keep the default formatting of `rax`
- = note: `#[warn(asm_sub_register)]` on by default
-
-error: aborting due to 21 previous errors; 1 warning emitted
-
diff --git a/tests/ui/asm/x86_64/const.rs b/tests/ui/asm/x86_64/const.rs
index d523ae021a5d4..f9a2ab6269fa2 100644
--- a/tests/ui/asm/x86_64/const.rs
+++ b/tests/ui/asm/x86_64/const.rs
@@ -1,8 +1,6 @@
// only-x86_64
// run-pass
// needs-asm-support
-// revisions: mirunsafeck thirunsafeck
-// [thirunsafeck]compile-flags: -Z thir-unsafeck
#![feature(asm_const)]
diff --git a/tests/ui/async-await/async-await.rs b/tests/ui/async-await/async-await.rs
index 9cabf16f8bba9..63941a7913948 100644
--- a/tests/ui/async-await/async-await.rs
+++ b/tests/ui/async-await/async-await.rs
@@ -1,8 +1,7 @@
// run-pass
-// revisions: default nomiropt thirunsafeck
+// revisions: default nomiropt
//[nomiropt]compile-flags: -Z mir-opt-level=0
-//[thirunsafeck]compile-flags: -Zthir-unsafeck
#![allow(unused)]
diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr b/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr
deleted file mode 100644
index f9e5bf675cbd9..0000000000000
--- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5
- |
-LL | S::f();
- | ^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:17:5
- |
-LL | f();
- | ^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:23:5
- |
-LL | S::f();
- | ^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:26: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 4 previous errors
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs b/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs
index 14cc0dc614fc3..7695853000d79 100644
--- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs
+++ b/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs
@@ -1,6 +1,4 @@
// edition:2018
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
struct S;
@@ -12,18 +10,14 @@ async unsafe fn f() {}
async fn g() {
S::f();
- //[mir]~^ ERROR call to unsafe function is unsafe
- //[thir]~^^ ERROR call to unsafe function `S::f` is unsafe
+ //~^ ERROR call to unsafe function `S::f` is unsafe
f();
- //[mir]~^ ERROR call to unsafe function is unsafe
- //[thir]~^^ ERROR call to unsafe function `f` is unsafe
+ //~^ ERROR call to unsafe function `f` is unsafe
}
fn main() {
S::f();
- //[mir]~^ ERROR call to unsafe function is unsafe
- //[thir]~^^ ERROR call to unsafe function `S::f` is unsafe
+ //~^ ERROR call to unsafe function `S::f` is unsafe
f();
- //[mir]~^ ERROR call to unsafe function is unsafe
- //[thir]~^^ ERROR call to unsafe function `f` is unsafe
+ //~^ ERROR call to unsafe function `f` is unsafe
}
diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr b/tests/ui/async-await/async-unsafe-fn-call-in-safe.stderr
similarity index 89%
rename from tests/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
rename to tests/ui/async-await/async-unsafe-fn-call-in-safe.stderr
index ba3303fe7939e..b25794c089235 100644
--- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
+++ b/tests/ui/async-await/async-unsafe-fn-call-in-safe.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5
+ --> $DIR/async-unsafe-fn-call-in-safe.rs:12:5
|
LL | S::f();
| ^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL | S::f();
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:17:5
+ --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5
|
LL | f();
| ^^^ call to unsafe function
@@ -15,7 +15,7 @@ LL | f();
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:23:5
+ --> $DIR/async-unsafe-fn-call-in-safe.rs:19:5
|
LL | S::f();
| ^^^^^^ call to unsafe function
@@ -23,7 +23,7 @@ LL | S::f();
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
- --> $DIR/async-unsafe-fn-call-in-safe.rs:26:5
+ --> $DIR/async-unsafe-fn-call-in-safe.rs:21:5
|
LL | f();
| ^^^ call to unsafe function
diff --git a/tests/ui/binding/issue-53114-safety-checks.stderr b/tests/ui/binding/issue-53114-safety-checks.stderr
index 349c4639a9e2d..b7d805d91718b 100644
--- a/tests/ui/binding/issue-53114-safety-checks.stderr
+++ b/tests/ui/binding/issue-53114-safety-checks.stderr
@@ -1,63 +1,3 @@
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:23:13
- |
-LL | let _ = &p.b;
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:28:17
- |
-LL | let (_,) = (&p.b,);
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:37:16
- |
-LL | let _: _ = &p.b;
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:42:20
- |
-LL | let (_,): _ = (&p.b,);
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:51:11
- |
-LL | match &p.b { _ => { } }
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
-error[E0793]: reference to packed field is unaligned
- --> $DIR/issue-53114-safety-checks.rs:56:12
- |
-LL | match (&p.b,) { (_,) => { } }
- | ^^^^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
- = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
-
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/issue-53114-safety-checks.rs:24:13
|
@@ -67,10 +7,10 @@ LL | let _ = u1.a;
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:25:13
+ --> $DIR/issue-53114-safety-checks.rs:25:14
|
LL | let _ = &u2.a;
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
@@ -83,13 +23,33 @@ LL | let (_,) = (u1.a,);
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:30:17
+ --> $DIR/issue-53114-safety-checks.rs:30:18
|
LL | let (_,) = (&u2.a,);
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:23:13
+ |
+LL | let _ = &p.b;
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:28:17
+ |
+LL | let (_,) = (&p.b,);
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/issue-53114-safety-checks.rs:38:16
|
@@ -99,10 +59,10 @@ LL | let _: _ = u1.a;
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:39:16
+ --> $DIR/issue-53114-safety-checks.rs:39:17
|
LL | let _: _ = &u2.a;
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
@@ -115,13 +75,33 @@ LL | let (_,): _ = (u1.a,);
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:44:20
+ --> $DIR/issue-53114-safety-checks.rs:44:21
|
LL | let (_,): _ = (&u2.a,);
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:37:16
+ |
+LL | let _: _ = &p.b;
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:42:20
+ |
+LL | let (_,): _ = (&p.b,);
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/issue-53114-safety-checks.rs:52:11
|
@@ -131,10 +111,10 @@ LL | match u1.a { _ => { } }
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:53:11
+ --> $DIR/issue-53114-safety-checks.rs:53:12
|
LL | match &u2.a { _ => { } }
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
@@ -147,13 +127,33 @@ LL | match (u1.a,) { (_,) => { } }
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/issue-53114-safety-checks.rs:58:12
+ --> $DIR/issue-53114-safety-checks.rs:58:13
|
LL | match (&u2.a,) { (_,) => { } }
- | ^^^^^ access to union field
+ | ^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:51:11
+ |
+LL | match &p.b { _ => { } }
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+ --> $DIR/issue-53114-safety-checks.rs:56:12
+ |
+LL | match (&p.b,) { (_,) => { } }
+ | ^^^^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+ = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
error: aborting due to 18 previous errors
Some errors have detailed explanations: E0133, E0793.
diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs
index bdb3eb23c38f8..76a0f2914103d 100644
--- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs
+++ b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
// Ensure we get unsafe function after coercion
unsafe fn add(a: i32, b: i32) -> i32 {
a + b
diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.mir.stderr b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.stderr
similarity index 86%
rename from tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.mir.stderr
rename to tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.stderr
index 2f9c7973b5a16..190b4792ebcbc 100644
--- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.mir.stderr
+++ b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:15:23
+ --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:12:23
|
LL | let result: i32 = foo(5, 5);
| ^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL | let result: i32 = foo(5, 5);
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:24:23
+ --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:21:23
|
LL | let result: i32 = foo(5, 5);
| ^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr
deleted file mode 100644
index 2f9c7973b5a16..0000000000000
--- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:15:23
- |
-LL | let result: i32 = foo(5, 5);
- | ^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:24:23
- |
-LL | let result: i32 = foo(5, 5);
- | ^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr
deleted file mode 100644
index 579227703103a..0000000000000
--- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31
- |
-LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs
index 57358fbdd8404..36777693faba0 100644
--- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs
+++ b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
fn main() {
let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
//~^ ERROR E0133
diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
similarity index 89%
rename from tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr
rename to tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
index fb237231d65a7..f5cb3e2b5f807 100644
--- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr
+++ b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `Pin::::new_unchecked` is unsafe and requires unsafe function or block
- --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31
+ --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31
|
LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/closures/thir-unsafeck-issue-85871.rs b/tests/ui/closures/thir-unsafeck-issue-85871.rs
index aea539b74dffc..a4a487c4dc2e8 100644
--- a/tests/ui/closures/thir-unsafeck-issue-85871.rs
+++ b/tests/ui/closures/thir-unsafeck-issue-85871.rs
@@ -1,6 +1,5 @@
// Tests that no ICE occurs when a closure appears inside a node
// that does not have a body when compiling with
-// compile-flags: -Zthir-unsafeck=yes
// check-pass
#![allow(dead_code)]
diff --git a/tests/ui/command/command-pre-exec.rs b/tests/ui/command/command-pre-exec.rs
index d366c5ffbfd8c..e8a909eecc14a 100644
--- a/tests/ui/command/command-pre-exec.rs
+++ b/tests/ui/command/command-pre-exec.rs
@@ -1,6 +1,4 @@
// run-pass
-// revisions: mir thir
-// [thir]compile-flags: -Zthir-unsafeck
#![allow(stable_features)]
// ignore-windows - this is a unix-specific test
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
index 6c4f0a5accf99..95fb9ef42603a 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
@@ -1,15 +1,12 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
#![feature(const_extern_fn)]
-const unsafe extern "C" fn foo() -> usize { 5 }
+const unsafe extern "C" fn foo() -> usize {
+ 5
+}
fn main() {
let a: [u8; foo()];
- //[mir]~^ call to unsafe function is unsafe and requires unsafe function or block
- //[thir]~^^ call to unsafe function `foo` is unsafe and requires unsafe function or block
+ //~^ call to unsafe function `foo` is unsafe and requires unsafe function or block
foo();
- //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
- //[thir]~^^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
+ //~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
}
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr
new file mode 100644
index 0000000000000..6f59b2f205537
--- /dev/null
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr
@@ -0,0 +1,19 @@
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
+ --> $DIR/const-extern-fn-requires-unsafe.rs:10:5
+ |
+LL | foo();
+ | ^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
+ --> $DIR/const-extern-fn-requires-unsafe.rs:8:17
+ |
+LL | let a: [u8; foo()];
+ | ^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/consts/issue-16538.mir.stderr b/tests/ui/consts/issue-16538.mir.stderr
deleted file mode 100644
index e320df4b7ad8f..0000000000000
--- a/tests/ui/consts/issue-16538.mir.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0015]: cannot call non-const fn `Y::foo` in statics
- --> $DIR/issue-16538.rs:14:23
- |
-LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: calls in statics are limited to constant functions, tuple structs and tuple variants
- = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
-
-error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-16538.rs:14:30
- |
-LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
- | ^^^^ use of extern static
- |
- = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
-
-error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/issue-16538.rs:14:21
- |
-LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
- |
- = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0015, E0133.
-For more information about an error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-16538.rs b/tests/ui/consts/issue-16538.rs
index 270fa30141427..31f334fb4054e 100644
--- a/tests/ui/consts/issue-16538.rs
+++ b/tests/ui/consts/issue-16538.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
mod Y {
pub type X = usize;
extern "C" {
diff --git a/tests/ui/consts/issue-16538.thir.stderr b/tests/ui/consts/issue-16538.stderr
similarity index 93%
rename from tests/ui/consts/issue-16538.thir.stderr
rename to tests/ui/consts/issue-16538.stderr
index 4a862869274f8..834ffa8d3a0ee 100644
--- a/tests/ui/consts/issue-16538.thir.stderr
+++ b/tests/ui/consts/issue-16538.stderr
@@ -1,5 +1,5 @@
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/issue-16538.rs:14:22
+ --> $DIR/issue-16538.rs:11:22
|
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
@@ -7,7 +7,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-16538.rs:14:30
+ --> $DIR/issue-16538.rs:11:30
|
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^ use of extern static
@@ -15,7 +15,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
error[E0015]: cannot call non-const fn `Y::foo` in statics
- --> $DIR/issue-16538.rs:14:23
+ --> $DIR/issue-16538.rs:11:23
|
LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr
deleted file mode 100644
index 11dc57bcf4673..0000000000000
--- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/issue-45729-unsafe-in-coroutine.rs:8:9
- |
-LL | *(1 as *mut u32) = 42;
- | ^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
- |
- = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs
index 7961b58597c4a..dab9c81bc8fe8 100644
--- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs
+++ b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
#![feature(coroutines)]
fn main() {
diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.thir.stderr b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.stderr
similarity index 90%
rename from tests/ui/coroutine/issue-45729-unsafe-in-coroutine.thir.stderr
rename to tests/ui/coroutine/issue-45729-unsafe-in-coroutine.stderr
index a61689a0df51e..19949b4293962 100644
--- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.thir.stderr
+++ b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.stderr
@@ -1,5 +1,5 @@
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/issue-45729-unsafe-in-coroutine.rs:8:9
+ --> $DIR/issue-45729-unsafe-in-coroutine.rs:5:9
|
LL | *(1 as *mut u32) = 42;
| ^^^^^^^^^^^^^^^^ dereference of raw pointer
diff --git a/tests/ui/coroutine/static-mut-reference-across-yield.rs b/tests/ui/coroutine/static-mut-reference-across-yield.rs
index 07f810856a72f..0ed849e0e7d10 100644
--- a/tests/ui/coroutine/static-mut-reference-across-yield.rs
+++ b/tests/ui/coroutine/static-mut-reference-across-yield.rs
@@ -1,6 +1,4 @@
// build-pass
-// revisions: mir thir
-// [thir]compile-flags: -Zthir-unsafeck
#![feature(coroutines)]
diff --git a/tests/ui/error-codes/E0133.mir.stderr b/tests/ui/error-codes/E0133.mir.stderr
deleted file mode 100644
index f8703ef06335f..0000000000000
--- a/tests/ui/error-codes/E0133.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-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 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/error-codes/E0133.rs b/tests/ui/error-codes/E0133.rs
index dee1475ba213a..52494ce6078c4 100644
--- a/tests/ui/error-codes/E0133.rs
+++ b/tests/ui/error-codes/E0133.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
unsafe fn f() { return; }
fn main() {
diff --git a/tests/ui/error-codes/E0133.thir.stderr b/tests/ui/error-codes/E0133.stderr
similarity index 93%
rename from tests/ui/error-codes/E0133.thir.stderr
rename to tests/ui/error-codes/E0133.stderr
index fd4d42bcb8b62..5e3e49fb64478 100644
--- a/tests/ui/error-codes/E0133.thir.stderr
+++ b/tests/ui/error-codes/E0133.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
- --> $DIR/E0133.rs:7:5
+ --> $DIR/E0133.rs:4:5
|
LL | f();
| ^^^ call to unsafe function
diff --git a/tests/ui/extern/issue-28324.mir.stderr b/tests/ui/extern/issue-28324.mir.stderr
deleted file mode 100644
index 9376ac35e2154..0000000000000
--- a/tests/ui/extern/issue-28324.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-28324.rs:8:24
- |
-LL | pub static BAZ: u32 = *&error_message_count;
- | ^^^^^^^^^^^^^^^^^^^^ use of extern static
- |
- = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/extern/issue-28324.rs b/tests/ui/extern/issue-28324.rs
index fbe83e325edb4..f74726e8166dc 100644
--- a/tests/ui/extern/issue-28324.rs
+++ b/tests/ui/extern/issue-28324.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
extern "C" {
static error_message_count: u32;
}
diff --git a/tests/ui/extern/issue-28324.thir.stderr b/tests/ui/extern/issue-28324.stderr
similarity index 93%
rename from tests/ui/extern/issue-28324.thir.stderr
rename to tests/ui/extern/issue-28324.stderr
index 8857f379ad189..94ff21319939a 100644
--- a/tests/ui/extern/issue-28324.thir.stderr
+++ b/tests/ui/extern/issue-28324.stderr
@@ -1,5 +1,5 @@
error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-28324.rs:8:25
+ --> $DIR/issue-28324.rs:5:25
|
LL | pub static BAZ: u32 = *&error_message_count;
| ^^^^^^^^^^^^^^^^^^^ use of extern static
diff --git a/tests/ui/inline-const/expr-unsafe-err.mir.stderr b/tests/ui/inline-const/expr-unsafe-err.mir.stderr
deleted file mode 100644
index ebd18f89d9c94..0000000000000
--- a/tests/ui/inline-const/expr-unsafe-err.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/expr-unsafe-err.rs:8:9
- |
-LL | require_unsafe();
- | ^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/inline-const/expr-unsafe-err.rs b/tests/ui/inline-const/expr-unsafe-err.rs
index adf05d352ea70..a05a294516833 100644
--- a/tests/ui/inline-const/expr-unsafe-err.rs
+++ b/tests/ui/inline-const/expr-unsafe-err.rs
@@ -1,7 +1,7 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
#![feature(inline_const)]
-const unsafe fn require_unsafe() -> usize { 1 }
+const unsafe fn require_unsafe() -> usize {
+ 1
+}
fn main() {
const {
diff --git a/tests/ui/inline-const/expr-unsafe-err.thir.stderr b/tests/ui/inline-const/expr-unsafe-err.stderr
similarity index 100%
rename from tests/ui/inline-const/expr-unsafe-err.thir.stderr
rename to tests/ui/inline-const/expr-unsafe-err.stderr
diff --git a/tests/ui/inline-const/expr-unsafe.rs b/tests/ui/inline-const/expr-unsafe.rs
index d71efd33db163..2370c58a71206 100644
--- a/tests/ui/inline-const/expr-unsafe.rs
+++ b/tests/ui/inline-const/expr-unsafe.rs
@@ -1,6 +1,5 @@
// check-pass
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
+
#![warn(unused_unsafe)]
#![feature(inline_const)]
const unsafe fn require_unsafe() -> usize { 1 }
diff --git a/tests/ui/inline-const/expr-unsafe.mir.stderr b/tests/ui/inline-const/expr-unsafe.stderr
similarity index 80%
rename from tests/ui/inline-const/expr-unsafe.mir.stderr
rename to tests/ui/inline-const/expr-unsafe.stderr
index 1ab6e42fba0a5..47334aaab8355 100644
--- a/tests/ui/inline-const/expr-unsafe.mir.stderr
+++ b/tests/ui/inline-const/expr-unsafe.stderr
@@ -1,11 +1,11 @@
warning: unnecessary `unsafe` block
- --> $DIR/expr-unsafe.rs:12:13
+ --> $DIR/expr-unsafe.rs:11:13
|
LL | unsafe {}
| ^^^^^^ unnecessary `unsafe` block
|
note: the lint level is defined here
- --> $DIR/expr-unsafe.rs:4:9
+ --> $DIR/expr-unsafe.rs:3:9
|
LL | #![warn(unused_unsafe)]
| ^^^^^^^^^^^^^
diff --git a/tests/ui/inline-const/expr-unsafe.thir.stderr b/tests/ui/inline-const/expr-unsafe.thir.stderr
deleted file mode 100644
index 1ab6e42fba0a5..0000000000000
--- a/tests/ui/inline-const/expr-unsafe.thir.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: unnecessary `unsafe` block
- --> $DIR/expr-unsafe.rs:12:13
- |
-LL | unsafe {}
- | ^^^^^^ unnecessary `unsafe` block
- |
-note: the lint level is defined here
- --> $DIR/expr-unsafe.rs:4:9
- |
-LL | #![warn(unused_unsafe)]
- | ^^^^^^^^^^^^^
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/inline-const/pat-unsafe-err.rs b/tests/ui/inline-const/pat-unsafe-err.rs
index 6df281c6d945e..0db18dd3260d0 100644
--- a/tests/ui/inline-const/pat-unsafe-err.rs
+++ b/tests/ui/inline-const/pat-unsafe-err.rs
@@ -1,6 +1,4 @@
-// revisions: mir thir
-// [mir]ignore-test This is currently broken
-// [thir]compile-flags: -Z thir-unsafeck
+// ignore-test This is currently broken
#![allow(incomplete_features)]
#![feature(inline_const_pat)]
diff --git a/tests/ui/inline-const/pat-unsafe-err.thir.stderr b/tests/ui/inline-const/pat-unsafe-err.thir.stderr
deleted file mode 100644
index 48a2cb4c704d5..0000000000000
--- a/tests/ui/inline-const/pat-unsafe-err.thir.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block
- --> $DIR/pat-unsafe-err.rs:15:13
- |
-LL | require_unsafe();
- | ^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block
- --> $DIR/pat-unsafe-err.rs:22:13
- |
-LL | require_unsafe()
- | ^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/inline-const/pat-unsafe.rs b/tests/ui/inline-const/pat-unsafe.rs
index 36f8632af6738..cfef9ad6a563e 100644
--- a/tests/ui/inline-const/pat-unsafe.rs
+++ b/tests/ui/inline-const/pat-unsafe.rs
@@ -1,7 +1,5 @@
// check-pass
-// revisions: mir thir
-// [mir]ignore-test This is currently broken
-// [thir]compile-flags: -Z thir-unsafeck
+// ignore-test This is currently broken
#![allow(incomplete_features)]
#![warn(unused_unsafe)]
diff --git a/tests/ui/inline-const/pat-unsafe.thir.stderr b/tests/ui/inline-const/pat-unsafe.thir.stderr
deleted file mode 100644
index 0318b3ff2cc6a..0000000000000
--- a/tests/ui/inline-const/pat-unsafe.thir.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-warning: unnecessary `unsafe` block
- --> $DIR/pat-unsafe.rs:19:17
- |
-LL | unsafe {}
- | ^^^^^^ unnecessary `unsafe` block
- |
-note: the lint level is defined here
- --> $DIR/pat-unsafe.rs:7:9
- |
-LL | #![warn(unused_unsafe)]
- | ^^^^^^^^^^^^^
-
-warning: unnecessary `unsafe` block
- --> $DIR/pat-unsafe.rs:26:17
- |
-LL | unsafe {}
- | ^^^^^^ unnecessary `unsafe` block
-
-warning: 2 warnings emitted
-
diff --git a/tests/ui/intrinsics/issue-28575.rs b/tests/ui/intrinsics/issue-28575.rs
index 410f664f89d44..141136d25b215 100644
--- a/tests/ui/intrinsics/issue-28575.rs
+++ b/tests/ui/intrinsics/issue-28575.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
#![feature(intrinsics)]
extern "C" {
diff --git a/tests/ui/intrinsics/issue-28575.mir.stderr b/tests/ui/intrinsics/issue-28575.stderr
similarity index 92%
rename from tests/ui/intrinsics/issue-28575.mir.stderr
rename to tests/ui/intrinsics/issue-28575.stderr
index 4b29b4c1b6a9a..8a7816f231f70 100644
--- a/tests/ui/intrinsics/issue-28575.mir.stderr
+++ b/tests/ui/intrinsics/issue-28575.stderr
@@ -1,5 +1,5 @@
error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-28575.rs:11:5
+ --> $DIR/issue-28575.rs:8:5
|
LL | FOO()
| ^^^ use of extern static
diff --git a/tests/ui/intrinsics/issue-28575.thir.stderr b/tests/ui/intrinsics/issue-28575.thir.stderr
deleted file mode 100644
index 4b29b4c1b6a9a..0000000000000
--- a/tests/ui/intrinsics/issue-28575.thir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0133]: use of extern static is unsafe and requires unsafe function or block
- --> $DIR/issue-28575.rs:11:5
- |
-LL | FOO()
- | ^^^ use of extern static
- |
- = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr b/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr
deleted file mode 100644
index 26b2f9f271311..0000000000000
--- a/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:8:15
- |
-LL | let add = std::intrinsics::unchecked_add(x, y);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:9:15
- |
-LL | let sub = std::intrinsics::unchecked_sub(x, y);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:10:15
- |
-LL | let mul = std::intrinsics::unchecked_mul(x, y);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.rs b/tests/ui/intrinsics/unchecked_math_unsafe.rs
index 98d3a11ad0276..a034b45f5308c 100644
--- a/tests/ui/intrinsics/unchecked_math_unsafe.rs
+++ b/tests/ui/intrinsics/unchecked_math_unsafe.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
#![feature(core_intrinsics)]
fn main() {
diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.thir.stderr b/tests/ui/intrinsics/unchecked_math_unsafe.stderr
similarity index 90%
rename from tests/ui/intrinsics/unchecked_math_unsafe.thir.stderr
rename to tests/ui/intrinsics/unchecked_math_unsafe.stderr
index 5c3728ccdf843..31da1a86ca135 100644
--- a/tests/ui/intrinsics/unchecked_math_unsafe.thir.stderr
+++ b/tests/ui/intrinsics/unchecked_math_unsafe.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `unchecked_add` is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:8:15
+ --> $DIR/unchecked_math_unsafe.rs:5:15
|
LL | let add = std::intrinsics::unchecked_add(x, y);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL | let add = std::intrinsics::unchecked_add(x, y);
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `unchecked_sub` is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:9:15
+ --> $DIR/unchecked_math_unsafe.rs:6:15
|
LL | let sub = std::intrinsics::unchecked_sub(x, y);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
@@ -15,7 +15,7 @@ LL | let sub = std::intrinsics::unchecked_sub(x, y);
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `unchecked_mul` is unsafe and requires unsafe function or block
- --> $DIR/unchecked_math_unsafe.rs:10:15
+ --> $DIR/unchecked_math_unsafe.rs:7:15
|
LL | let mul = std::intrinsics::unchecked_mul(x, y);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/issues/issue-11740.rs b/tests/ui/issues/issue-11740.rs
index fa80f509b3229..c3badfd9b4904 100644
--- a/tests/ui/issues/issue-11740.rs
+++ b/tests/ui/issues/issue-11740.rs
@@ -1,6 +1,4 @@
// check-pass
-// revisions: mir thir
-// [thir]compile-flags: -Zthir-unsafeck
struct Attr {
name: String,
diff --git a/tests/ui/issues/issue-28776.mir.stderr b/tests/ui/issues/issue-28776.mir.stderr
deleted file mode 100644
index e7b7ba082688c..0000000000000
--- a/tests/ui/issues/issue-28776.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-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 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/issues/issue-28776.rs b/tests/ui/issues/issue-28776.rs
index 19df3c4a4252b..e564ebcd110cb 100644
--- a/tests/ui/issues/issue-28776.rs
+++ b/tests/ui/issues/issue-28776.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
use std::ptr;
fn main() {
diff --git a/tests/ui/issues/issue-28776.thir.stderr b/tests/ui/issues/issue-28776.stderr
similarity index 93%
rename from tests/ui/issues/issue-28776.thir.stderr
rename to tests/ui/issues/issue-28776.stderr
index 63172b85424df..3db94ee181017 100644
--- a/tests/ui/issues/issue-28776.thir.stderr
+++ b/tests/ui/issues/issue-28776.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `std::ptr::write` is unsafe and requires unsafe function or block
- --> $DIR/issue-28776.rs:7:5
+ --> $DIR/issue-28776.rs:4:5
|
LL | (&ptr::write)(1 as *mut _, 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/issues/issue-39367.rs b/tests/ui/issues/issue-39367.rs
index e7beb8a0392e8..039b47ae78078 100644
--- a/tests/ui/issues/issue-39367.rs
+++ b/tests/ui/issues/issue-39367.rs
@@ -1,6 +1,4 @@
// run-pass
-// revisions: mir thir
-// [thir]compile-flags: -Zthir-unsafeck
use std::ops::Deref;
diff --git a/tests/ui/issues/issue-48131.mir.stderr b/tests/ui/issues/issue-48131.mir.stderr
deleted file mode 100644
index 6817e8830c509..0000000000000
--- a/tests/ui/issues/issue-48131.mir.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:12:9
- |
-LL | unsafe { /* unnecessary */ }
- | ^^^^^^ unnecessary `unsafe` block
- |
-note: the lint level is defined here
- --> $DIR/issue-48131.rs:6:9
- |
-LL | #![deny(unused_unsafe)]
- | ^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:23:13
- |
-LL | unsafe { /* unnecessary */ }
- | ^^^^^^ unnecessary `unsafe` block
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/issues/issue-48131.rs b/tests/ui/issues/issue-48131.rs
index df98547084d69..85664e62eaded 100644
--- a/tests/ui/issues/issue-48131.rs
+++ b/tests/ui/issues/issue-48131.rs
@@ -1,6 +1,3 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
// This note is annotated because the purpose of the test
// is to ensure that certain other notes are not generated.
#![deny(unused_unsafe)] //~ NOTE
diff --git a/tests/ui/issues/issue-48131.thir.stderr b/tests/ui/issues/issue-48131.stderr
similarity index 81%
rename from tests/ui/issues/issue-48131.thir.stderr
rename to tests/ui/issues/issue-48131.stderr
index 6817e8830c509..5acc4f16e9fc2 100644
--- a/tests/ui/issues/issue-48131.thir.stderr
+++ b/tests/ui/issues/issue-48131.stderr
@@ -1,17 +1,17 @@
error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:12:9
+ --> $DIR/issue-48131.rs:9:9
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
|
note: the lint level is defined here
- --> $DIR/issue-48131.rs:6:9
+ --> $DIR/issue-48131.rs:3:9
|
LL | #![deny(unused_unsafe)]
| ^^^^^^^^^^^^^
error: unnecessary `unsafe` block
- --> $DIR/issue-48131.rs:23:13
+ --> $DIR/issue-48131.rs:20:13
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
diff --git a/tests/ui/issues/issue-5844.mir.stderr b/tests/ui/issues/issue-5844.mir.stderr
deleted file mode 100644
index 4434f5a0ff254..0000000000000
--- a/tests/ui/issues/issue-5844.mir.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-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 1 previous error
-
-For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/issues/issue-5844.rs b/tests/ui/issues/issue-5844.rs
index 4f90a9c66451f..0db1ccf76d992 100644
--- a/tests/ui/issues/issue-5844.rs
+++ b/tests/ui/issues/issue-5844.rs
@@ -1,9 +1,7 @@
//aux-build:issue-5844-aux.rs
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
extern crate issue_5844_aux;
-fn main () {
+fn main() {
issue_5844_aux::rand(); //~ ERROR: requires unsafe
}
diff --git a/tests/ui/issues/issue-5844.thir.stderr b/tests/ui/issues/issue-5844.stderr
similarity index 93%
rename from tests/ui/issues/issue-5844.thir.stderr
rename to tests/ui/issues/issue-5844.stderr
index 6074f7d0ed4ef..bae917fa72c5d 100644
--- a/tests/ui/issues/issue-5844.thir.stderr
+++ b/tests/ui/issues/issue-5844.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `rand` is unsafe and requires unsafe function or block
- --> $DIR/issue-5844.rs:8:5
+ --> $DIR/issue-5844.rs:6:5
|
LL | issue_5844_aux::rand();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs
index b0b6b318d8f78..782c38200a06f 100644
--- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs
+++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs
@@ -6,10 +6,9 @@ use std::future::Future;
async fn wrapper(f: F)
//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
-//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
where
- F:,
- for<'a> >::Output: Future