From 4316d92bf31e453047fdadebf29176cf07bb8aa8 Mon Sep 17 00:00:00 2001 From: fpoli Date: Mon, 15 Feb 2021 07:08:01 +0000 Subject: [PATCH] Update rustc to nightly-2021-02-15 --- .../tests/verify/fail/no-annotations/panic-reason.rs | 6 ++++-- prusti-viper/src/encoder/mir_encoder.rs | 12 +++++++----- rust-toolchain | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/prusti-tests/tests/verify/fail/no-annotations/panic-reason.rs b/prusti-tests/tests/verify/fail/no-annotations/panic-reason.rs index 689bebdd247..9b7a5273389 100644 --- a/prusti-tests/tests/verify/fail/no-annotations/panic-reason.rs +++ b/prusti-tests/tests/verify/fail/no-annotations/panic-reason.rs @@ -7,7 +7,8 @@ fn test_assert(x: bool) { } fn test_assert_msg(x: bool) { - assert!(false, "msg"); //~ ERROR the asserted expression might not hold + // FIXME: see mir_encoder encode_panic_cause + assert!(false, "msg"); //~ ERROR panic!(..) statement might be reachable } fn test_debug_assert(x: bool) { @@ -65,7 +66,8 @@ fn test_inner_assert(x: bool) { macro_rules! inner_assert_msg { () => { { - assert!(false, "msg"); //~ ERROR the asserted expression might not hold + // FIXME: see mir_encoder encode_panic_cause + assert!(false, "msg"); //~ ERROR panic!(..) statement might be reachable } }; } diff --git a/prusti-viper/src/encoder/mir_encoder.rs b/prusti-viper/src/encoder/mir_encoder.rs index 1861b139746..f2de550c3a7 100644 --- a/prusti-viper/src/encoder/mir_encoder.rs +++ b/prusti-viper/src/encoder/mir_encoder.rs @@ -750,13 +750,15 @@ impl<'p, 'v: 'p, 'tcx: 'v> MirEncoder<'p, 'v, 'tcx> { .map(|x| x.as_str()) .collect(); match ¯o_names_str[..] { - ["core::macros::panic", "std::unimplemented", ..] => PanicCause::Unimplemented, - ["core::macros::panic", "std::unreachable", ..] => PanicCause::Unreachable, + ["core::panic::panic_2015", "core::macros::panic", "std::unimplemented"] => PanicCause::Unimplemented, + ["core::panic::panic_2015", "core::macros::panic", "std::unreachable"] => PanicCause::Unreachable, ["std::assert", "std::debug_assert", ..] => PanicCause::DebugAssert, ["std::assert", ..] => PanicCause::Assert, - ["std::panic", "std::assert", "std::debug_assert", ..] => PanicCause::DebugAssert, - ["std::panic", "std::assert", ..] => PanicCause::Assert, - ["std::panic", ..] => PanicCause::Panic, + ["std::panic::panic_2015", "std::panic", "std::debug_assert"] => PanicCause::DebugAssert, + // TODO: assert!(_, "") currently has the same backtrace as panic!() + // see https://github.com/rust-lang/rust/issues/82157 + //["std::panic::panic_2015", "std::panic", ..] => PanicCause::Assert, + ["std::panic::panic_2015", "std::panic", ..] => PanicCause::Panic, _ => PanicCause::Generic, } } diff --git a/rust-toolchain b/rust-toolchain index e6d53c95233..a675275a070 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2021-02-01" +channel = "nightly-2021-02-15" components = [ "rustfmt", "rustc-dev", "llvm-tools-preview" ]