@@ -54,7 +54,7 @@ macro_rules! assert {
54
54
// strategy, which is tracked in
55
55
// https://github.com/model-checking/kani/issues/692
56
56
if false {
57
- :: std :: panic! ( $( $arg) +) ;
57
+ core :: assert! ( true , $( $arg) +) ;
58
58
}
59
59
} } ;
60
60
}
@@ -158,7 +158,7 @@ macro_rules! unreachable {
158
158
// handle.
159
159
( $fmt: expr, $( $arg: tt) * ) => { {
160
160
if false {
161
- let _ = format_args! ( $fmt, $( $arg) +) ;
161
+ core :: assert! ( true , $fmt, $( $arg) +) ;
162
162
}
163
163
kani:: panic( concat!( "internal error: entered unreachable code: " ,
164
164
stringify!( $fmt, $( $arg) * ) ) ) } } ;
@@ -186,22 +186,12 @@ macro_rules! panic {
186
186
( $msg: expr $( , ) ?) => ( {
187
187
kani:: panic( stringify!( $msg) ) ;
188
188
} ) ;
189
- // The first argument is the message and the rest contains tokens to be included in the msg.
189
+ // All other cases, e.g.:
190
190
// `panic!("Error: {}", code);`
191
- //
192
- // Note: This macro may match things that wouldn't be accepted by the panic!() macro. we have
193
- // decided to over-approximate the matching so we can deal with things like macro inside a macro
194
- // E.g.:
195
- // ```
196
- // panic!(concat!("Message {}", " split in two"), argument);
197
- // ```
198
- // The std implementation of `panic!()` macro is implemented in the compiler and it seems to
199
- // be able to do things that we cannot do here.
200
- // https://github.com/rust-lang/rust/blob/dc2d232c7485c60dd856f8b9aee83426492d4661/compiler/rustc_expand/src/base.rs#L1197
201
- ( $msg: expr, $( $arg: tt) +) => { {
191
+ ( $( $arg: tt) +) => { {
202
192
if false {
203
- let _ = format_args! ( $msg , $( $arg) +) ;
193
+ core :: assert! ( true , $( $arg) +) ;
204
194
}
205
- kani:: panic( stringify!( $msg , $ ( $arg) +) ) ;
195
+ kani:: panic( stringify!( $( $arg) +) ) ;
206
196
} } ;
207
197
}
0 commit comments