inline format!() args up to and including rustc_middle
This commit is contained in:
parent
2e0136a131
commit
23815467a2
87 changed files with 378 additions and 437 deletions
|
@ -308,13 +308,13 @@ fn fmt_instance(
|
|||
InstanceDef::ReifyShim(_) => write!(f, " - shim(reify)"),
|
||||
InstanceDef::ThreadLocalShim(_) => write!(f, " - shim(tls)"),
|
||||
InstanceDef::Intrinsic(_) => write!(f, " - intrinsic"),
|
||||
InstanceDef::Virtual(_, num) => write!(f, " - virtual#{}", num),
|
||||
InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({})", ty),
|
||||
InstanceDef::Virtual(_, num) => write!(f, " - virtual#{num}"),
|
||||
InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({ty})"),
|
||||
InstanceDef::ClosureOnceShim { .. } => write!(f, " - shim"),
|
||||
InstanceDef::DropGlue(_, None) => write!(f, " - shim(None)"),
|
||||
InstanceDef::DropGlue(_, Some(ty)) => write!(f, " - shim(Some({}))", ty),
|
||||
InstanceDef::CloneShim(_, ty) => write!(f, " - shim({})", ty),
|
||||
InstanceDef::FnPtrAddrShim(_, ty) => write!(f, " - shim({})", ty),
|
||||
InstanceDef::DropGlue(_, Some(ty)) => write!(f, " - shim(Some({ty}))"),
|
||||
InstanceDef::CloneShim(_, ty) => write!(f, " - shim({ty})"),
|
||||
InstanceDef::FnPtrAddrShim(_, ty) => write!(f, " - shim({ty})"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,9 +336,7 @@ impl<'tcx> Instance<'tcx> {
|
|||
pub fn new(def_id: DefId, args: GenericArgsRef<'tcx>) -> Instance<'tcx> {
|
||||
assert!(
|
||||
!args.has_escaping_bound_vars(),
|
||||
"args of instance {:?} not normalized for codegen: {:?}",
|
||||
def_id,
|
||||
args
|
||||
"args of instance {def_id:?} not normalized for codegen: {args:?}"
|
||||
);
|
||||
Instance { def: InstanceDef::Item(def_id), args }
|
||||
}
|
||||
|
@ -425,7 +423,7 @@ impl<'tcx> Instance<'tcx> {
|
|||
) -> Option<Instance<'tcx>> {
|
||||
debug!("resolve(def_id={:?}, args={:?})", def_id, args);
|
||||
// Use either `resolve_closure` or `resolve_for_vtable`
|
||||
assert!(!tcx.is_closure(def_id), "Called `resolve_for_fn_ptr` on closure: {:?}", def_id);
|
||||
assert!(!tcx.is_closure(def_id), "Called `resolve_for_fn_ptr` on closure: {def_id:?}");
|
||||
Instance::resolve(tcx, param_env, def_id, args).ok().flatten().map(|mut resolved| {
|
||||
match resolved.def {
|
||||
InstanceDef::Item(def) if resolved.def.requires_caller_location(tcx) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue