about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-19 00:18:50 +0200
committerLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-27 20:37:57 +0200
commitb3e012becc6539de9570eee6ce694f07879935d2 (patch)
treee2ee5f0ccc4ceb68a4b8786c15db6868c00474f2
parent3ce9d5c26982ff0516946dda7fa8d29580fa25b3 (diff)
downloadrust-b3e012becc6539de9570eee6ce694f07879935d2.tar.gz
rust-b3e012becc6539de9570eee6ce694f07879935d2.zip
Fix inverted `if` condition
-rw-r--r--src/librustc_mir/transform/check_unsafety.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs
index 0434f3447bc..3cff214f441 100644
--- a/src/librustc_mir/transform/check_unsafety.rs
+++ b/src/librustc_mir/transform/check_unsafety.rs
@@ -676,7 +676,7 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: DefId) {
     {
         // Report an error.
         let unsafe_fn_msg =
-            if unsafe_op_in_unsafe_fn_allowed(tcx, lint_root) { "" } else { " function or" };
+            if unsafe_op_in_unsafe_fn_allowed(tcx, lint_root) { " function or" } else { "" };
 
         match kind {
             UnsafetyViolationKind::GeneralAndConstFn | UnsafetyViolationKind::General => {