mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
rustup (don't know the exact PR unfortunately)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user