]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_const_eval/src/const_eval/eval_queries.rs
New upstream version 1.71.1+dfsg1
[rustc.git] / compiler / rustc_const_eval / src / const_eval / eval_queries.rs
index 4bd6fe19931e7c83ecf6d736162c7a9b21ac1d09..046d2052968a3ad161bb31a7c38e20ce91ceebb1 100644 (file)
@@ -296,12 +296,12 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
     }
 
     let cid = key.value;
-    let def = cid.instance.def.with_opt_param();
-    let is_static = tcx.is_static(def.did);
+    let def = cid.instance.def.def_id();
+    let is_static = tcx.is_static(def);
 
     let mut ecx = InterpCx::new(
         tcx,
-        tcx.def_span(def.did),
+        tcx.def_span(def),
         key.param_env,
         // Statics (and promoteds inside statics) may access other statics, because unlike consts
         // they do not have to behave "as if" they were evaluated at runtime.
@@ -368,7 +368,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
                         if matches!(err.error, InterpError::UndefinedBehavior(_)) {
                             diag.note(NOTE_ON_UNDEFINED_BEHAVIOR_ERROR);
                         }
-                        diag.note(&format!(
+                        diag.note(format!(
                             "the raw bytes of the constant ({}",
                             display_allocation(
                                 *ecx.tcx,