mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Auto merge of #117673 - matthewjasper:thir-unsafeck-stabilization, r=cjgillot
Stabilize THIR unsafeck - Removes `-Zthir-unsafeck`, stabilizing the behaviour of `-Zthir-unsafeck=on`. - Removes MIR unsafeck. - Union patterns are now unsafe unless the field is matched to a wildcard pattern. Opening for a crater run in case we need a compatibility lint.
This commit is contained in:
@@ -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)
|
||||
});
|
||||
});
|
||||
|
||||
@@ -822,7 +822,7 @@ macro_rules! tracked {
|
||||
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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -869,15 +869,14 @@
|
||||
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 }
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
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 @@ fn visit_inner_body(&mut self, def: LocalDefId) {
|
||||
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 @@ pub fn emit_requires_unsafe_err(
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -131,7 +131,7 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
|
||||
&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 @@ fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) {
|
||||
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 @@ fn check_target_features(&mut self, func_did: DefId) {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -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<Body<'_>> {
|
||||
// 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.
|
||||
|
||||
@@ -1919,8 +1919,8 @@ pub(crate) fn parse_function_return(slot: &mut FunctionReturn, v: Option<&str>)
|
||||
#[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
|
||||
thinlto: Option<bool> = (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
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
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] = &[
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// only-aarch64
|
||||
// run-pass
|
||||
// needs-asm-support
|
||||
// revisions: mirunsafeck thirunsafeck
|
||||
// [thirunsafeck]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(asm_const)]
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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!("");
|
||||
| ^^^^^^^^^^^^^^^
|
||||
@@ -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`.
|
||||
+26
-26
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
+26
-26
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// only-x86_64
|
||||
// run-pass
|
||||
// needs-asm-support
|
||||
// revisions: mirunsafeck thirunsafeck
|
||||
// [thirunsafeck]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(asm_const)]
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,4 @@
|
||||
// edition:2018
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
struct S;
|
||||
|
||||
@@ -12,18 +10,14 @@ impl S {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
+4
-4
@@ -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
|
||||
@@ -1,3 +1,35 @@
|
||||
error[E0133]: access to union field is unsafe and requires unsafe function or block
|
||||
--> $DIR/issue-53114-safety-checks.rs:24:13
|
||||
|
|
||||
LL | let _ = u1.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:14
|
||||
|
|
||||
LL | let _ = &u2.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:29:17
|
||||
|
|
||||
LL | let (_,) = (u1.a,);
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:18
|
||||
|
|
||||
LL | let (_,) = (&u2.a,);
|
||||
| ^^^^ 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
|
||||
|
|
||||
@@ -18,6 +50,38 @@ LL | let (_,) = (&p.b,);
|
||||
= 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
|
||||
|
|
||||
LL | let _: _ = u1.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:17
|
||||
|
|
||||
LL | let _: _ = &u2.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:43:20
|
||||
|
|
||||
LL | let (_,): _ = (u1.a,);
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:21
|
||||
|
|
||||
LL | let (_,): _ = (&u2.a,);
|
||||
| ^^^^ 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
|
||||
|
|
||||
@@ -38,6 +102,38 @@ LL | let (_,): _ = (&p.b,);
|
||||
= 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
|
||||
|
|
||||
LL | match u1.a { _ => { } }
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:12
|
||||
|
|
||||
LL | match &u2.a { _ => { } }
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:57:12
|
||||
|
|
||||
LL | match (u1.a,) { (_,) => { } }
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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:13
|
||||
|
|
||||
LL | match (&u2.a,) { (_,) => { } }
|
||||
| ^^^^ 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
|
||||
|
|
||||
@@ -58,102 +154,6 @@ LL | match (&p.b,) { (_,) => { } }
|
||||
= 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
|
||||
|
|
||||
LL | let _ = u1.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | let _ = &u2.a;
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= 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:29:17
|
||||
|
|
||||
LL | let (_,) = (u1.a,);
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | let (_,) = (&u2.a,);
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= 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:38:16
|
||||
|
|
||||
LL | let _: _ = u1.a;
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | let _: _ = &u2.a;
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= 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:43:20
|
||||
|
|
||||
LL | let (_,): _ = (u1.a,);
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | let (_,): _ = (&u2.a,);
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= 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:52:11
|
||||
|
|
||||
LL | match u1.a { _ => { } }
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | match &u2.a { _ => { } }
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= 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:57:12
|
||||
|
|
||||
LL | match (u1.a,) { (_,) => { } }
|
||||
| ^^^^ access to union field
|
||||
|
|
||||
= 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
|
||||
|
|
||||
LL | match (&u2.a,) { (_,) => { } }
|
||||
| ^^^^^ access to union field
|
||||
|
|
||||
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
||||
|
||||
error: aborting due to 18 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0133, E0793.
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
@@ -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`.
|
||||
@@ -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`.
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
error[E0133]: call to unsafe function `Pin::<P>::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
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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`.
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
mod Y {
|
||||
pub type X = usize;
|
||||
extern "C" {
|
||||
|
||||
@@ -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);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(coroutines)]
|
||||
|
||||
fn main() {
|
||||
|
||||
+1
-1
@@ -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
|
||||
@@ -1,6 +1,4 @@
|
||||
// build-pass
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
#![feature(coroutines)]
|
||||
|
||||
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
unsafe fn f() { return; }
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -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
|
||||
-11
@@ -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`.
|
||||
Vendored
-3
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
extern "C" {
|
||||
static error_message_count: u32;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
@@ -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`.
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 }
|
||||
|
||||
+2
-2
@@ -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)]
|
||||
| ^^^^^^^^^^^^^
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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`.
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(intrinsics)]
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -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
|
||||
@@ -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`.
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
fn main() {
|
||||
|
||||
+3
-3
@@ -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
|
||||
@@ -1,6 +1,4 @@
|
||||
// check-pass
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
struct Attr {
|
||||
name: String,
|
||||
|
||||
@@ -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`.
|
||||
@@ -1,6 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
use std::ptr;
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -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
|
||||
@@ -1,6 +1,4 @@
|
||||
// run-pass
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
use std::ops::Deref;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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`.
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -6,10 +6,9 @@
|
||||
async fn wrapper<F>(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> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
||||
F:,
|
||||
for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
||||
{
|
||||
//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
let mut i = 41;
|
||||
|
||||
@@ -4,11 +4,10 @@ error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
LL | / async fn wrapper<F>(f: F)
|
||||
LL | |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | where
|
||||
LL | | F:,
|
||||
LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
||||
| |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
LL | | F:,
|
||||
LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
||||
| |__________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
|
|
||||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32`
|
||||
|
||||
@@ -21,7 +20,7 @@ LL | async fn wrapper<F>(f: F)
|
||||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32`
|
||||
|
||||
error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
--> $DIR/issue-76168-hr-outlives-3.rs:13:1
|
||||
--> $DIR/issue-76168-hr-outlives-3.rs:12:1
|
||||
|
|
||||
LL | / {
|
||||
LL | |
|
||||
@@ -32,20 +31,6 @@ LL | | }
|
||||
|
|
||||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32`
|
||||
|
||||
error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
--> $DIR/issue-76168-hr-outlives-3.rs:6:1
|
||||
|
|
||||
LL | / async fn wrapper<F>(f: F)
|
||||
LL | |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | where
|
||||
LL | | F:,
|
||||
LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
||||
| |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32`
|
||||
|
|
||||
= help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// compile-flags: -C lto
|
||||
// no-prefer-dynamic
|
||||
// ignore-emscripten no threads support
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
use std::thread;
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
error: `{closure@$DIR/non-structural-match-types.rs:12:17: 12:19}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:12:9
|
||||
|
|
||||
LL | const { || {} } => {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `{async block@$DIR/non-structural-match-types.rs:15:17: 15:25}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:15:9
|
||||
|
|
||||
LL | const { async {} } => {}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// edition:2021
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![allow(unreachable_code)]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
error: `{closure@$DIR/non-structural-match-types.rs:10:17: 10:19}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:10:9
|
||||
|
|
||||
LL | const { || {} } => {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `{async block@$DIR/non-structural-match-types.rs:13:17: 13:25}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:13:9
|
||||
|
|
||||
LL | const { async {} } => {}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
error: `{closure@$DIR/non-structural-match-types.rs:12:17: 12:19}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:12:9
|
||||
|
|
||||
LL | const { || {} } => {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `{async block@$DIR/non-structural-match-types.rs:15:17: 15:25}` cannot be used in patterns
|
||||
--> $DIR/non-structural-match-types.rs:15:9
|
||||
|
|
||||
LL | const { async {} } => {}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#![crate_type="lib"]
|
||||
#![crate_type = "lib"]
|
||||
#![deny(unreachable_patterns)]
|
||||
|
||||
mod test_struct {
|
||||
@@ -26,10 +26,12 @@ pub union Punned {
|
||||
}
|
||||
|
||||
pub fn test(punned: Punned) {
|
||||
match punned {
|
||||
Punned { foo: [_] } => println!("foo"),
|
||||
Punned { bar: [_] } => println!("bar"),
|
||||
//~^ ERROR unreachable pattern [unreachable_patterns]
|
||||
unsafe {
|
||||
match punned {
|
||||
Punned { foo: [_] } => println!("foo"),
|
||||
Punned { bar: [_] } => println!("bar"),
|
||||
//~^ ERROR unreachable pattern [unreachable_patterns]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ LL | #![deny(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unreachable pattern
|
||||
--> $DIR/issue-57472.rs:31:13
|
||||
--> $DIR/issue-57472.rs:32:17
|
||||
|
|
||||
LL | Punned { bar: [_] } => println!("bar"),
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
LL | Punned { bar: [_] } => println!("bar"),
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// ignore-android
|
||||
// ignore-emscripten no processes
|
||||
// ignore-sgx no processes
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
// check-pass
|
||||
// only-x86_64
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
#![feature(target_feature_11)]
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
// Tests #73631: closures inherit `#[target_feature]` annotations
|
||||
|
||||
// check-pass
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
// only-x86_64
|
||||
|
||||
#![feature(target_feature_11)]
|
||||
|
||||
#[target_feature(enable="avx")]
|
||||
#[target_feature(enable = "avx")]
|
||||
fn also_use_avx() {
|
||||
println!("Hello from AVX")
|
||||
}
|
||||
|
||||
#[target_feature(enable="avx")]
|
||||
#[target_feature(enable = "avx")]
|
||||
fn use_avx() -> Box<dyn Fn()> {
|
||||
Box::new(|| also_use_avx())
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
// only-x86_64
|
||||
|
||||
#![feature(target_feature_11)]
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/fn-ptr.rs:9:21
|
||||
|
|
||||
LL | #[target_feature(enable = "sse2")]
|
||||
| ---------------------------------- `#[target_feature]` added here
|
||||
...
|
||||
LL | let foo: fn() = foo;
|
||||
| ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
= note: expected fn pointer `fn()`
|
||||
found fn item `fn() {foo}`
|
||||
= note: fn items are distinct from fn pointers
|
||||
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
|
||||
help: consider casting to a fn pointer
|
||||
|
|
||||
LL | let foo: fn() = foo as fn();
|
||||
| ~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
@@ -1,8 +1,6 @@
|
||||
// Tests #108655: closures in `#[target_feature]` functions can still be marked #[inline(always)]
|
||||
|
||||
// check-pass
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
// only-x86_64
|
||||
|
||||
#![feature(target_feature_11)]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
// only-x86_64
|
||||
|
||||
#![feature(target_feature_11)]
|
||||
@@ -11,7 +9,6 @@ const fn sse2() {}
|
||||
#[target_feature(enable = "fxsr")]
|
||||
const fn sse2_and_fxsr() {}
|
||||
|
||||
|
||||
#[target_feature(enable = "avx")]
|
||||
#[target_feature(enable = "bmi2")]
|
||||
fn avx_bmi2() {}
|
||||
@@ -26,62 +23,50 @@ fn avx_bmi2(&self) {}
|
||||
|
||||
fn foo() {
|
||||
sse2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
Quux.avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
}
|
||||
|
||||
#[target_feature(enable = "sse2")]
|
||||
fn bar() {
|
||||
avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
Quux.avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
}
|
||||
|
||||
#[target_feature(enable = "avx")]
|
||||
fn baz() {
|
||||
sse2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
|
||||
Quux.avx_bmi2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
|
||||
}
|
||||
|
||||
#[target_feature(enable = "avx")]
|
||||
#[target_feature(enable = "bmi2")]
|
||||
fn qux() {
|
||||
sse2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
}
|
||||
|
||||
const _: () = sse2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
|
||||
const _: () = sse2_and_fxsr();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe
|
||||
|
||||
#[deny(unsafe_op_in_unsafe_fn)]
|
||||
#[target_feature(enable = "avx")]
|
||||
#[target_feature(enable = "bmi2")]
|
||||
unsafe fn needs_unsafe_block() {
|
||||
sse2();
|
||||
//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe
|
||||
//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:25:5
|
||||
|
|
||||
LL | sse2();
|
||||
| ^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
|
||||
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
|
||||
|
||||
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:27:5
|
||||
|
|
||||
LL | avx_bmi2();
|
||||
| ^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
|
||||
|
||||
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:29:5
|
||||
|
|
||||
LL | Quux.avx_bmi2();
|
||||
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
|
||||
|
||||
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:35:5
|
||||
|
|
||||
LL | avx_bmi2();
|
||||
| ^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
|
||||
|
||||
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:37:5
|
||||
|
|
||||
LL | Quux.avx_bmi2();
|
||||
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
|
||||
|
||||
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:43:5
|
||||
|
|
||||
LL | sse2();
|
||||
| ^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
|
||||
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
|
||||
|
||||
error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:45:5
|
||||
|
|
||||
LL | avx_bmi2();
|
||||
| ^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: bmi2
|
||||
|
||||
error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:47:5
|
||||
|
|
||||
LL | Quux.avx_bmi2();
|
||||
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: bmi2
|
||||
|
||||
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:54:5
|
||||
|
|
||||
LL | sse2();
|
||||
| ^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
|
||||
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
|
||||
|
||||
error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:58:15
|
||||
|
|
||||
LL | const _: () = sse2();
|
||||
| ^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
|
||||
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
|
||||
|
||||
error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-calls.rs:61:15
|
||||
|
|
||||
LL | const _: () = sse2_and_fxsr();
|
||||
| ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target features: sse2 and fxsr
|
||||
= note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]`
|
||||
|
||||
error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133)
|
||||
--> $DIR/safe-calls.rs:68:5
|
||||
|
|
||||
LL | sse2();
|
||||
| ^^^^^^ call to function with `#[target_feature]`
|
||||
|
|
||||
= help: in order for the call to be safe, the context requires the following additional target feature: sse2
|
||||
= note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
|
||||
note: an unsafe function restricts its caller, but its body is safe by default
|
||||
--> $DIR/safe-calls.rs:67:1
|
||||
|
|
||||
LL | unsafe fn needs_unsafe_block() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: the lint level is defined here
|
||||
--> $DIR/safe-calls.rs:64:8
|
||||
|
|
||||
LL | #[deny(unsafe_op_in_unsafe_fn)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0133`.
|
||||
@@ -1,8 +1,6 @@
|
||||
// run-pass
|
||||
// ignore-emscripten spawning processes is not supported
|
||||
// ignore-sgx no processes
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
#![feature(start)]
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// run-pass
|
||||
// ignore-emscripten FIXME(#45351) hits an LLVM assert
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
#![feature(repr_simd, platform_intrinsics, concat_idents)]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
// edition:2018
|
||||
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Zthir-unsafeck
|
||||
|
||||
#![allow(dead_code)]
|
||||
#![deny(unused_unsafe)]
|
||||
|
||||
|
||||
+188
-188
@@ -1,77 +1,77 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:22:13
|
||||
--> $DIR/lint-unused-unsafe.rs:19:13
|
||||
|
|
||||
LL | fn bad1() { unsafe {} }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:10:9
|
||||
--> $DIR/lint-unused-unsafe.rs:7:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:23:13
|
||||
--> $DIR/lint-unused-unsafe.rs:20:13
|
||||
|
|
||||
LL | fn bad2() { unsafe { bad1() } }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:24:20
|
||||
--> $DIR/lint-unused-unsafe.rs:21:20
|
||||
|
|
||||
LL | unsafe fn bad3() { unsafe {} }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:25:13
|
||||
--> $DIR/lint-unused-unsafe.rs:22:13
|
||||
|
|
||||
LL | fn bad4() { unsafe { callback(||{}) } }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:28:5
|
||||
--> $DIR/lint-unused-unsafe.rs:25:5
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:35:5
|
||||
--> $DIR/lint-unused-unsafe.rs:32:5
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:70:9
|
||||
--> $DIR/lint-unused-unsafe.rs:67:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:79:9
|
||||
--> $DIR/lint-unused-unsafe.rs:76:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:80:13
|
||||
--> $DIR/lint-unused-unsafe.rs:77:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:81:13
|
||||
--> $DIR/lint-unused-unsafe.rs:78:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:86:9
|
||||
--> $DIR/lint-unused-unsafe.rs:83:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:96:13
|
||||
--> $DIR/lint-unused-unsafe.rs:93:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -80,7 +80,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:97:13
|
||||
--> $DIR/lint-unused-unsafe.rs:94:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -89,7 +89,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:98:13
|
||||
--> $DIR/lint-unused-unsafe.rs:95:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -98,7 +98,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:108:17
|
||||
--> $DIR/lint-unused-unsafe.rs:105:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -107,13 +107,13 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:106:20
|
||||
--> $DIR/lint-unused-unsafe.rs:103:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:109:17
|
||||
--> $DIR/lint-unused-unsafe.rs:106:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -122,7 +122,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:110:17
|
||||
--> $DIR/lint-unused-unsafe.rs:107:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -131,37 +131,37 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:120:9
|
||||
--> $DIR/lint-unused-unsafe.rs:117:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:130:9
|
||||
--> $DIR/lint-unused-unsafe.rs:127:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:131:13
|
||||
--> $DIR/lint-unused-unsafe.rs:128:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:132:13
|
||||
--> $DIR/lint-unused-unsafe.rs:129:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:138:9
|
||||
--> $DIR/lint-unused-unsafe.rs:135:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:149:13
|
||||
--> $DIR/lint-unused-unsafe.rs:146:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -170,7 +170,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:150:13
|
||||
--> $DIR/lint-unused-unsafe.rs:147:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -179,7 +179,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:151:13
|
||||
--> $DIR/lint-unused-unsafe.rs:148:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -188,7 +188,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:162:17
|
||||
--> $DIR/lint-unused-unsafe.rs:159:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -197,13 +197,13 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:160:20
|
||||
--> $DIR/lint-unused-unsafe.rs:157:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:163:17
|
||||
--> $DIR/lint-unused-unsafe.rs:160:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -212,7 +212,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:164:17
|
||||
--> $DIR/lint-unused-unsafe.rs:161:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -221,37 +221,37 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:174:9
|
||||
--> $DIR/lint-unused-unsafe.rs:171:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:184:9
|
||||
--> $DIR/lint-unused-unsafe.rs:181:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:185:13
|
||||
--> $DIR/lint-unused-unsafe.rs:182:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:186:13
|
||||
--> $DIR/lint-unused-unsafe.rs:183:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:192:9
|
||||
--> $DIR/lint-unused-unsafe.rs:189:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:203:13
|
||||
--> $DIR/lint-unused-unsafe.rs:200:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -260,7 +260,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:204:13
|
||||
--> $DIR/lint-unused-unsafe.rs:201:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -269,7 +269,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:205:13
|
||||
--> $DIR/lint-unused-unsafe.rs:202:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -278,7 +278,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:216:17
|
||||
--> $DIR/lint-unused-unsafe.rs:213:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -287,13 +287,13 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:214:20
|
||||
--> $DIR/lint-unused-unsafe.rs:211:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:217:17
|
||||
--> $DIR/lint-unused-unsafe.rs:214:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -302,7 +302,7 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:218:17
|
||||
--> $DIR/lint-unused-unsafe.rs:215:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -311,13 +311,13 @@ LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:238:9
|
||||
--> $DIR/lint-unused-unsafe.rs:235:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:251:13
|
||||
--> $DIR/lint-unused-unsafe.rs:248:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -325,7 +325,7 @@ LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:264:13
|
||||
--> $DIR/lint-unused-unsafe.rs:261:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -333,37 +333,37 @@ LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:282:20
|
||||
--> $DIR/lint-unused-unsafe.rs:279:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:291:20
|
||||
--> $DIR/lint-unused-unsafe.rs:288:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:292:24
|
||||
--> $DIR/lint-unused-unsafe.rs:289:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:293:24
|
||||
--> $DIR/lint-unused-unsafe.rs:290:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:298:20
|
||||
--> $DIR/lint-unused-unsafe.rs:295:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:308:24
|
||||
--> $DIR/lint-unused-unsafe.rs:305:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -372,7 +372,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:309:24
|
||||
--> $DIR/lint-unused-unsafe.rs:306:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -381,7 +381,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:310:24
|
||||
--> $DIR/lint-unused-unsafe.rs:307:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -390,7 +390,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:320:28
|
||||
--> $DIR/lint-unused-unsafe.rs:317:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -399,13 +399,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:318:20
|
||||
--> $DIR/lint-unused-unsafe.rs:315:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:321:28
|
||||
--> $DIR/lint-unused-unsafe.rs:318:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -414,7 +414,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:322:28
|
||||
--> $DIR/lint-unused-unsafe.rs:319:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -423,37 +423,37 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:332:20
|
||||
--> $DIR/lint-unused-unsafe.rs:329:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:342:20
|
||||
--> $DIR/lint-unused-unsafe.rs:339:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:343:24
|
||||
--> $DIR/lint-unused-unsafe.rs:340:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:344:24
|
||||
--> $DIR/lint-unused-unsafe.rs:341:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:350:20
|
||||
--> $DIR/lint-unused-unsafe.rs:347:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:361:24
|
||||
--> $DIR/lint-unused-unsafe.rs:358:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -462,7 +462,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:362:24
|
||||
--> $DIR/lint-unused-unsafe.rs:359:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -471,7 +471,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:363:24
|
||||
--> $DIR/lint-unused-unsafe.rs:360:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -480,7 +480,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:374:28
|
||||
--> $DIR/lint-unused-unsafe.rs:371:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -489,13 +489,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:372:20
|
||||
--> $DIR/lint-unused-unsafe.rs:369:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:375:28
|
||||
--> $DIR/lint-unused-unsafe.rs:372:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -504,7 +504,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:376:28
|
||||
--> $DIR/lint-unused-unsafe.rs:373:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -513,37 +513,37 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:386:20
|
||||
--> $DIR/lint-unused-unsafe.rs:383:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:396:20
|
||||
--> $DIR/lint-unused-unsafe.rs:393:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:397:24
|
||||
--> $DIR/lint-unused-unsafe.rs:394:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:398:24
|
||||
--> $DIR/lint-unused-unsafe.rs:395:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:404:20
|
||||
--> $DIR/lint-unused-unsafe.rs:401:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:415:24
|
||||
--> $DIR/lint-unused-unsafe.rs:412:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -552,7 +552,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:416:24
|
||||
--> $DIR/lint-unused-unsafe.rs:413:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -561,7 +561,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:417:24
|
||||
--> $DIR/lint-unused-unsafe.rs:414:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -570,7 +570,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:428:28
|
||||
--> $DIR/lint-unused-unsafe.rs:425:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -579,13 +579,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:426:20
|
||||
--> $DIR/lint-unused-unsafe.rs:423:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:429:28
|
||||
--> $DIR/lint-unused-unsafe.rs:426:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -594,7 +594,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:430:28
|
||||
--> $DIR/lint-unused-unsafe.rs:427:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -603,13 +603,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:450:20
|
||||
--> $DIR/lint-unused-unsafe.rs:447:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:463:24
|
||||
--> $DIR/lint-unused-unsafe.rs:460:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -617,7 +617,7 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:476:24
|
||||
--> $DIR/lint-unused-unsafe.rs:473:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -625,37 +625,37 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:495:20
|
||||
--> $DIR/lint-unused-unsafe.rs:492:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:504:20
|
||||
--> $DIR/lint-unused-unsafe.rs:501:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:505:24
|
||||
--> $DIR/lint-unused-unsafe.rs:502:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:506:24
|
||||
--> $DIR/lint-unused-unsafe.rs:503:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:511:20
|
||||
--> $DIR/lint-unused-unsafe.rs:508:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:521:24
|
||||
--> $DIR/lint-unused-unsafe.rs:518:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -664,7 +664,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:522:24
|
||||
--> $DIR/lint-unused-unsafe.rs:519:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -673,7 +673,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:523:24
|
||||
--> $DIR/lint-unused-unsafe.rs:520:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -682,7 +682,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:533:28
|
||||
--> $DIR/lint-unused-unsafe.rs:530:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -691,13 +691,13 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:531:20
|
||||
--> $DIR/lint-unused-unsafe.rs:528:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:534:28
|
||||
--> $DIR/lint-unused-unsafe.rs:531:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -706,7 +706,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:535:28
|
||||
--> $DIR/lint-unused-unsafe.rs:532:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -715,37 +715,37 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:545:20
|
||||
--> $DIR/lint-unused-unsafe.rs:542:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:555:20
|
||||
--> $DIR/lint-unused-unsafe.rs:552:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:556:24
|
||||
--> $DIR/lint-unused-unsafe.rs:553:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:557:24
|
||||
--> $DIR/lint-unused-unsafe.rs:554:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:563:20
|
||||
--> $DIR/lint-unused-unsafe.rs:560:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:574:24
|
||||
--> $DIR/lint-unused-unsafe.rs:571:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -754,7 +754,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:575:24
|
||||
--> $DIR/lint-unused-unsafe.rs:572:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -763,7 +763,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:576:24
|
||||
--> $DIR/lint-unused-unsafe.rs:573:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -772,7 +772,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:587:28
|
||||
--> $DIR/lint-unused-unsafe.rs:584:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -781,13 +781,13 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:585:20
|
||||
--> $DIR/lint-unused-unsafe.rs:582:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:588:28
|
||||
--> $DIR/lint-unused-unsafe.rs:585:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -796,7 +796,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:589:28
|
||||
--> $DIR/lint-unused-unsafe.rs:586:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -805,37 +805,37 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:599:20
|
||||
--> $DIR/lint-unused-unsafe.rs:596:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:609:20
|
||||
--> $DIR/lint-unused-unsafe.rs:606:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:610:24
|
||||
--> $DIR/lint-unused-unsafe.rs:607:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:611:24
|
||||
--> $DIR/lint-unused-unsafe.rs:608:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:617:20
|
||||
--> $DIR/lint-unused-unsafe.rs:614:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:628:24
|
||||
--> $DIR/lint-unused-unsafe.rs:625:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -844,7 +844,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:629:24
|
||||
--> $DIR/lint-unused-unsafe.rs:626:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -853,7 +853,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:630:24
|
||||
--> $DIR/lint-unused-unsafe.rs:627:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -862,7 +862,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:641:28
|
||||
--> $DIR/lint-unused-unsafe.rs:638:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -871,13 +871,13 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:639:20
|
||||
--> $DIR/lint-unused-unsafe.rs:636:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:642:28
|
||||
--> $DIR/lint-unused-unsafe.rs:639:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -886,7 +886,7 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:643:28
|
||||
--> $DIR/lint-unused-unsafe.rs:640:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -895,13 +895,13 @@ LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:663:20
|
||||
--> $DIR/lint-unused-unsafe.rs:660:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:676:24
|
||||
--> $DIR/lint-unused-unsafe.rs:673:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -909,7 +909,7 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:689:24
|
||||
--> $DIR/lint-unused-unsafe.rs:686:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -917,37 +917,37 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:707:24
|
||||
--> $DIR/lint-unused-unsafe.rs:704:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:717:24
|
||||
--> $DIR/lint-unused-unsafe.rs:714:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:718:28
|
||||
--> $DIR/lint-unused-unsafe.rs:715:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:719:28
|
||||
--> $DIR/lint-unused-unsafe.rs:716:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:725:24
|
||||
--> $DIR/lint-unused-unsafe.rs:722:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:736:28
|
||||
--> $DIR/lint-unused-unsafe.rs:733:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -956,7 +956,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:737:28
|
||||
--> $DIR/lint-unused-unsafe.rs:734:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -965,7 +965,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:738:28
|
||||
--> $DIR/lint-unused-unsafe.rs:735:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -974,7 +974,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:749:32
|
||||
--> $DIR/lint-unused-unsafe.rs:746:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -983,13 +983,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:747:24
|
||||
--> $DIR/lint-unused-unsafe.rs:744:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:750:32
|
||||
--> $DIR/lint-unused-unsafe.rs:747:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -998,7 +998,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:751:32
|
||||
--> $DIR/lint-unused-unsafe.rs:748:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1007,37 +1007,37 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:761:24
|
||||
--> $DIR/lint-unused-unsafe.rs:758:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:771:24
|
||||
--> $DIR/lint-unused-unsafe.rs:768:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:772:28
|
||||
--> $DIR/lint-unused-unsafe.rs:769:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:773:28
|
||||
--> $DIR/lint-unused-unsafe.rs:770:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:779:24
|
||||
--> $DIR/lint-unused-unsafe.rs:776:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:790:28
|
||||
--> $DIR/lint-unused-unsafe.rs:787:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1046,7 +1046,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:791:28
|
||||
--> $DIR/lint-unused-unsafe.rs:788:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1055,7 +1055,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:792:28
|
||||
--> $DIR/lint-unused-unsafe.rs:789:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1064,7 +1064,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:803:32
|
||||
--> $DIR/lint-unused-unsafe.rs:800:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1073,13 +1073,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:801:24
|
||||
--> $DIR/lint-unused-unsafe.rs:798:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:804:32
|
||||
--> $DIR/lint-unused-unsafe.rs:801:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1088,7 +1088,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:805:32
|
||||
--> $DIR/lint-unused-unsafe.rs:802:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1097,13 +1097,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:825:24
|
||||
--> $DIR/lint-unused-unsafe.rs:822:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:838:28
|
||||
--> $DIR/lint-unused-unsafe.rs:835:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1111,7 +1111,7 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:851:28
|
||||
--> $DIR/lint-unused-unsafe.rs:848:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1119,37 +1119,37 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:865:24
|
||||
--> $DIR/lint-unused-unsafe.rs:862:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:875:24
|
||||
--> $DIR/lint-unused-unsafe.rs:872:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:876:28
|
||||
--> $DIR/lint-unused-unsafe.rs:873:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:877:28
|
||||
--> $DIR/lint-unused-unsafe.rs:874:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:883:24
|
||||
--> $DIR/lint-unused-unsafe.rs:880:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:894:28
|
||||
--> $DIR/lint-unused-unsafe.rs:891:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1158,7 +1158,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:895:28
|
||||
--> $DIR/lint-unused-unsafe.rs:892:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1167,7 +1167,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:896:28
|
||||
--> $DIR/lint-unused-unsafe.rs:893:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1176,7 +1176,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:907:32
|
||||
--> $DIR/lint-unused-unsafe.rs:904:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1185,13 +1185,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:905:24
|
||||
--> $DIR/lint-unused-unsafe.rs:902:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:908:32
|
||||
--> $DIR/lint-unused-unsafe.rs:905:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1200,7 +1200,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:909:32
|
||||
--> $DIR/lint-unused-unsafe.rs:906:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1209,37 +1209,37 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:919:24
|
||||
--> $DIR/lint-unused-unsafe.rs:916:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:929:24
|
||||
--> $DIR/lint-unused-unsafe.rs:926:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:930:28
|
||||
--> $DIR/lint-unused-unsafe.rs:927:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:931:28
|
||||
--> $DIR/lint-unused-unsafe.rs:928:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:937:24
|
||||
--> $DIR/lint-unused-unsafe.rs:934:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:948:28
|
||||
--> $DIR/lint-unused-unsafe.rs:945:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1248,7 +1248,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:949:28
|
||||
--> $DIR/lint-unused-unsafe.rs:946:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1257,7 +1257,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:950:28
|
||||
--> $DIR/lint-unused-unsafe.rs:947:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1266,7 +1266,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:961:32
|
||||
--> $DIR/lint-unused-unsafe.rs:958:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1275,13 +1275,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:959:24
|
||||
--> $DIR/lint-unused-unsafe.rs:956:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:962:32
|
||||
--> $DIR/lint-unused-unsafe.rs:959:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1290,7 +1290,7 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:963:32
|
||||
--> $DIR/lint-unused-unsafe.rs:960:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1299,13 +1299,13 @@ LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:983:24
|
||||
--> $DIR/lint-unused-unsafe.rs:980:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:996:28
|
||||
--> $DIR/lint-unused-unsafe.rs:993:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1313,7 +1313,7 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1009:28
|
||||
--> $DIR/lint-unused-unsafe.rs:1006:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1321,13 +1321,13 @@ LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1055:29
|
||||
--> $DIR/lint-unused-unsafe.rs:1052:29
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1062:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1059:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1336,7 +1336,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1063:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1060:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1345,7 +1345,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1064:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1061:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1354,13 +1354,13 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1069:29
|
||||
--> $DIR/lint-unused-unsafe.rs:1066:29
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1076:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1073:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1369,7 +1369,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1077:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1074:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1378,7 +1378,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1078:33
|
||||
--> $DIR/lint-unused-unsafe.rs:1075:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
@@ -1387,13 +1387,13 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1088:22
|
||||
--> $DIR/lint-unused-unsafe.rs:1085:22
|
||||
|
|
||||
LL | let _x: [(); unsafe { 0 }] = [];
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1092:22
|
||||
--> $DIR/lint-unused-unsafe.rs:1089:22
|
||||
|
|
||||
LL | let _x: [(); unsafe { unsafe { size() } }] = [];
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
@@ -1,1402 +0,0 @@
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:22:13
|
||||
|
|
||||
LL | fn bad1() { unsafe {} }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:10:9
|
||||
|
|
||||
LL | #![deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:23:13
|
||||
|
|
||||
LL | fn bad2() { unsafe { bad1() } }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:24:20
|
||||
|
|
||||
LL | unsafe fn bad3() { unsafe {} }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:25:13
|
||||
|
|
||||
LL | fn bad4() { unsafe { callback(||{}) } }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:28:5
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:35:5
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:70:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:79:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:80:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:81:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:86:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:96:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:97:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:98:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:108:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:106:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:109:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:110:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:120:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:130:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:131:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:132:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:138:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:149:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:150:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:151:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:162:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:160:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:163:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:164:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:174:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:184:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:185:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:186:13
|
||||
|
|
||||
LL | unsafe {}
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:192:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:203:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:204:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:205:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:216:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:214:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:217:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:218:17
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | unsafe { unsf() }
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:238:9
|
||||
|
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:251:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:264:13
|
||||
|
|
||||
LL | unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:282:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:291:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:292:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:293:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:298:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:308:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:309:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:310:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:320:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:318:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:321:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:322:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:332:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:342:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:343:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:344:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:350:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:361:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:362:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:363:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:374:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:372:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:375:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:376:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:386:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:396:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:397:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:398:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:404:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:415:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:416:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:417:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:428:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:426:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:429:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:430:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:450:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:463:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:476:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:495:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:504:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:505:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:506:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:511:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:521:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsf();
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:522:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:523:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:533:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:531:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:534:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:535:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:545:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:555:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:556:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:557:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:563:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:574:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsf();
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:575:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:576:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:587:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:585:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:588:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:589:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:599:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:609:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:610:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:611:24
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:617:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:628:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsf();
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:629:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:630:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:641:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:639:20
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:642:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:643:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { let _ = || unsf(); };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:663:20
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:676:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:689:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:707:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:717:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:718:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:719:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:725:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:736:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:737:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:738:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:749:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:747:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:750:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:751:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:761:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:771:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:772:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:773:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:779:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:790:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:791:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:792:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:803:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:801:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:804:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:805:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:825:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:838:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:851:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:865:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:875:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:876:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:877:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:883:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:894:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:895:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:896:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:907:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:905:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:908:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:909:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:919:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:929:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:930:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:931:28
|
||||
|
|
||||
LL | let _ = || unsafe {};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:937:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:948:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | unsf();
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:949:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:950:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:961:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-unused-unsafe.rs:959:24
|
||||
|
|
||||
LL | #[deny(unused_unsafe)]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:962:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:963:32
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = || unsafe { unsf() };
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:983:24
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:996:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1009:28
|
||||
|
|
||||
LL | let _ = || unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = || unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1055:29
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1062:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = async { unsf() };
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1063:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1064:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1069:29
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1076:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
LL | let _ = async { unsf() };
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1077:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1078:33
|
||||
|
|
||||
LL | let _ = async { unsafe {
|
||||
| ------ because it's nested under this `unsafe` block
|
||||
...
|
||||
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1088:22
|
||||
|
|
||||
LL | let _x: [(); unsafe { 0 }] = [];
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: unnecessary `unsafe` block
|
||||
--> $DIR/lint-unused-unsafe.rs:1092:22
|
||||
|
|
||||
LL | let _x: [(); unsafe { unsafe { size() } }] = [];
|
||||
| ^^^^^^ unnecessary `unsafe` block
|
||||
|
||||
error: aborting due to 174 previous errors
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:13:13
|
||||
|
|
||||
LL | let b = B;
|
||||
| ^ use of mutable static
|
||||
|
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:14:14
|
||||
|
|
||||
LL | let rb = &B;
|
||||
| ^^ use of mutable static
|
||||
|
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:15:14
|
||||
|
|
||||
LL | let xb = XB;
|
||||
| ^^ use of mutable static
|
||||
|
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:16:15
|
||||
|
|
||||
LL | let xrb = &XB;
|
||||
| ^^^ use of mutable static
|
||||
|
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0133`.
|
||||
@@ -1,6 +1,4 @@
|
||||
// aux-build:extern-statics.rs
|
||||
// revisions: mir thir
|
||||
// [thir]compile-flags: -Z thir-unsafeck
|
||||
|
||||
extern crate extern_statics;
|
||||
use extern_statics::*;
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:13:13
|
||||
--> $DIR/safe-extern-statics-mut.rs:11:13
|
||||
|
|
||||
LL | let b = B;
|
||||
| ^ use of mutable static
|
||||
@@ -7,7 +7,7 @@ LL | let b = B;
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:14:15
|
||||
--> $DIR/safe-extern-statics-mut.rs:12:15
|
||||
|
|
||||
LL | let rb = &B;
|
||||
| ^ use of mutable static
|
||||
@@ -15,7 +15,7 @@ LL | let rb = &B;
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:15:14
|
||||
--> $DIR/safe-extern-statics-mut.rs:13:14
|
||||
|
|
||||
LL | let xb = XB;
|
||||
| ^^ use of mutable static
|
||||
@@ -23,7 +23,7 @@ LL | let xb = XB;
|
||||
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
|
||||
|
||||
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
|
||||
--> $DIR/safe-extern-statics-mut.rs:16:16
|
||||
--> $DIR/safe-extern-statics-mut.rs:14:16
|
||||
|
|
||||
LL | let xrb = &XB;
|
||||
| ^^ use of mutable static
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user