Skip to content

Commit

Permalink
Merge pull request #407 from viperproject/auto-update-rustc
Browse files Browse the repository at this point in the history
Update rustc to nightly-2021-02-15
  • Loading branch information
Aurel300 authored Feb 15, 2021
2 parents 2ff2bf2 + 4316d92 commit b51ec33
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions prusti-tests/tests/verify/fail/no-annotations/panic-reason.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}
};
}
Expand Down
12 changes: 7 additions & 5 deletions prusti-viper/src/encoder/mir_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,15 @@ impl<'p, 'v: 'p, 'tcx: 'v> MirEncoder<'p, 'v, 'tcx> {
.map(|x| x.as_str())
.collect();
match &macro_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,
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2021-02-01"
channel = "nightly-2021-02-15"
components = [ "rustfmt", "rustc-dev", "llvm-tools-preview" ]

0 comments on commit b51ec33

Please sign in to comment.