rustup (don't know the exact PR unfortunately)

This commit is contained in:
Matthias Krüger 2019-01-05 01:12:33 +01:00
parent cf3fb908c8
commit 33ec4e5220
2 changed files with 2 additions and 2 deletions

View File

@ -304,7 +304,7 @@ fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> {
};
let result = self.tcx.const_eval(self.param_env.and(gid)).ok()?;
let ret = miri_to_const(self.tcx, result);
let ret = miri_to_const(self.tcx, &result);
if ret.is_some() {
self.needed_resolution = true;
}

View File

@ -70,7 +70,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
promoted: None,
};
let constant = cx.tcx.const_eval(param_env.and(c_id)).ok();
if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, c)) {
if let Some(Constant::Int(val)) = constant.and_then(|c| miri_to_const(cx.tcx, &c)) {
let mut ty = cx.tcx.type_of(def_id);
if let ty::Adt(adt, _) = ty.sty {
if adt.is_enum() {