fix miri backtrace panic
This commit is contained in:
parent
c1ae916a64
commit
63cc7fc9e8
@ -1188,13 +1188,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
ppaux::parameterized(f, self.1, self.0, ppaux::Ns::Value, &[])
|
||||
}
|
||||
}
|
||||
let inst = Instance(def_id, substs);
|
||||
match ::std::panic::catch_unwind(|| {
|
||||
format!("inside call to {}", inst)
|
||||
}) {
|
||||
Ok(msg) => err.span_note(span, &msg),
|
||||
Err(_) => err.span_note(span, &format!("ppaux::parameterized failed: {:?}, {:?}", def_id, substs)),
|
||||
};
|
||||
err.span_note(span, &format!("inside call to {}", Instance(def_id, substs)));
|
||||
}
|
||||
err.emit();
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ fn eval_fn_call(
|
||||
Some((ptr, block)) => (Some(ptr), StackPopCleanup::Goto(block)),
|
||||
None => (None, StackPopCleanup::None),
|
||||
};
|
||||
self.push_stack_frame(def_id, span, mir, resolved_substs, return_ptr, return_to_block)?;
|
||||
self.push_stack_frame(resolved_def_id, span, mir, resolved_substs, return_ptr, return_to_block)?;
|
||||
|
||||
for (i, (src, src_ty)) in arg_srcs.into_iter().enumerate() {
|
||||
let dest = self.frame().locals[i];
|
||||
|
13
tests/run-pass/try-operator-custom.rs
Normal file
13
tests/run-pass/try-operator-custom.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
assert!(Ok::<i32, String>(42) == Ok(42));
|
||||
}
|
Loading…
Reference in New Issue
Block a user