fn parameterized<F: fmt::Write>(&mut self,
f: &mut F,
substs: &subst::Substs<'_>,
- mut did: DefId,
+ did: DefId,
projections: &[ty::ProjectionPredicate<'_>])
-> fmt::Result {
let key = ty::tls::with(|tcx| tcx.def_key(did));
- let mut item_name = if let Some(name) = key.disambiguated_data.data.get_opt_name() {
- Some(name)
- } else {
- did.index = key.parent.unwrap_or_else(
- || bug!("finding type for {:?}, encountered def-id {:?} with no parent",
- did, did));
- self.parameterized(f, substs, did, projections)?;
- return write!(f, "::{}", key.disambiguated_data.data.as_interned_str());
- };
let verbose = self.is_verbose;
let mut num_supplied_defaults = 0;
let mut has_self = false;
let mut own_counts: GenericParamCount = Default::default();
let mut is_value_path = false;
+ let mut item_name = Some(key.disambiguated_data.data.as_interned_str());
let fn_trait_kind = ty::tls::with(|tcx| {
// Unfortunately, some kinds of items (e.g., closures) don't have
// generics. So walk back up the find the closest parent that DOES
DefPathData::AssocTypeInImpl(_) |
DefPathData::AssocExistentialInImpl(_) |
DefPathData::Trait(_) |
+ DefPathData::Impl |
DefPathData::TypeNs(_) => {
break;
}
}
DefPathData::CrateRoot |
DefPathData::Misc |
- DefPathData::Impl |
DefPathData::Module(_) |
DefPathData::MacroDef(_) |
DefPathData::ClosureExpr |
other => return other,
}
}
+ // the first trace is for replicating an ice
+ // There's no tracking issue, but the next two lines concatenated link to the discussion on
+ // zulip. It's not really possible to test this, because it doesn't show up in diagnostics
+ // or MIR.
+ // https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/
+ // subject/anon_const_instance_printing/near/135980032
+ trace!("const eval: {}", key.value.instance);
trace!("const eval: {:?}", key);
let cid = key.value;