+ PlaceBase::Static(box Static { kind: StaticKind::Promoted(promoted, substs), def_id, .. }) => {
+ debug!("collecting promoted(def_id: {:?}, promoted: {:?}, substs: {:?})", def_id, promoted, substs);
+ debug!("param_substs: {:?}", self.param_substs);
+ let param_env = ty::ParamEnv::reveal_all();
+ let cid = GlobalId {
+ instance: Instance::new(*def_id, substs.subst(self.tcx, self.param_substs)),
+ promoted: Some(*promoted),
+ };
+ debug!("cid: {:?}", cid);
+ match self.tcx.const_eval(param_env.and(cid)) {
+ Ok(val) => collect_const(self.tcx, val, substs, self.output),
+ Err(ErrorHandled::Reported) => {},
+ Err(ErrorHandled::TooGeneric) => {
+ let span = self.tcx.promoted_mir(*def_id)[*promoted].span;
+ span_bug!(span, "collection encountered polymorphic constant")
+ },
+ }