Rename InstanceDef -> InstanceKind
This commit is contained in:
@@ -33,7 +33,7 @@ pub fn provide(providers: &mut Providers) {
|
||||
/// parameters are used).
|
||||
fn unused_generic_params<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: ty::InstanceDef<'tcx>,
|
||||
instance: ty::InstanceKind<'tcx>,
|
||||
) -> UnusedGenericParams {
|
||||
assert!(instance.def_id().is_local());
|
||||
|
||||
@@ -88,7 +88,7 @@ fn unused_generic_params<'tcx>(
|
||||
fn should_polymorphize<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
def_id: DefId,
|
||||
instance: ty::InstanceDef<'tcx>,
|
||||
instance: ty::InstanceKind<'tcx>,
|
||||
) -> bool {
|
||||
// If an instance's MIR body is not polymorphic then the modified generic parameters that are
|
||||
// derived from polymorphization's result won't make any difference.
|
||||
@@ -97,7 +97,7 @@ fn should_polymorphize<'tcx>(
|
||||
}
|
||||
|
||||
// Don't polymorphize intrinsics or virtual calls - calling `instance_mir` will panic.
|
||||
if matches!(instance, ty::InstanceDef::Intrinsic(..) | ty::InstanceDef::Virtual(..)) {
|
||||
if matches!(instance, ty::InstanceKind::Intrinsic(..) | ty::InstanceKind::Virtual(..)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
|
||||
/// a closure, coroutine or constant).
|
||||
#[instrument(level = "debug", skip(self, def_id, args))]
|
||||
fn visit_child_body(&mut self, def_id: DefId, args: GenericArgsRef<'tcx>) {
|
||||
let instance = ty::InstanceDef::Item(def_id);
|
||||
let instance = ty::InstanceKind::Item(def_id);
|
||||
let unused = self.tcx.unused_generic_params(instance);
|
||||
debug!(?self.unused_parameters, ?unused);
|
||||
for (i, arg) in args.iter().enumerate() {
|
||||
|
||||
Reference in New Issue
Block a user