display the full path to the function if no MIR is found

上级 97807291
......@@ -282,6 +282,7 @@ pub fn trait_method(
}
fn load_mir(&self, def_id: DefId) -> CachedMir<'a, 'tcx> {
use rustc_trans::back::symbol_names::def_id_to_string;
match self.tcx.map.as_local_node_id(def_id) {
Some(node_id) => CachedMir::Ref(self.mir_map.map.get(&node_id).unwrap()),
None => {
......@@ -292,7 +293,7 @@ fn load_mir(&self, def_id: DefId) -> CachedMir<'a, 'tcx> {
let cs = &self.tcx.sess.cstore;
let mir = cs.maybe_get_item_mir(self.tcx, def_id).unwrap_or_else(|| {
panic!("no mir for {:?}", def_id);
panic!("no mir for `{}`", def_id_to_string(self.tcx, def_id));
});
let cached = Rc::new(mir);
mir_cache.insert(def_id, cached.clone());
......
......@@ -12,6 +12,7 @@
// From rustc.
#[macro_use] extern crate rustc;
extern crate rustc_mir;
extern crate rustc_trans;
extern crate syntax;
#[macro_use] extern crate log;
extern crate log_settings;
......
// error-pattern:no mir for DefId
// error-pattern:no mir for `env_logger/
use std::env;
use std::process::{Command, Output};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册