diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-07-14 17:38:11 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-07-17 08:44:48 +1000 |
| commit | 005a70e3034eb84798760d3ccbf46eda65b40075 (patch) | |
| tree | c14ab1a17c9dc4f39d7e742ef823bf39ae88a1f8 /compiler/rustc_ty_utils/src | |
| parent | 87c509da95f3d837b3351ee3d706f7fe1d317a93 (diff) | |
| download | rust-005a70e3034eb84798760d3ccbf46eda65b40075.tar.gz rust-005a70e3034eb84798760d3ccbf46eda65b40075.zip | |
Remove `instance_def_size_estimate` query.
It doesn't seem worthwhile now that `MonoItem::size_estimate` is called much less often.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index c228938126e..f6302113e2a 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -311,22 +311,6 @@ fn param_env_reveal_all_normalized(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamE tcx.param_env(def_id).with_reveal_all_normalized(tcx) } -fn instance_def_size_estimate<'tcx>( - tcx: TyCtxt<'tcx>, - instance_def: ty::InstanceDef<'tcx>, -) -> usize { - use ty::InstanceDef; - - match instance_def { - InstanceDef::Item(..) | InstanceDef::DropGlue(..) => { - let mir = tcx.instance_mir(instance_def); - mir.basic_blocks.iter().map(|bb| bb.statements.len() + 1).sum() - } - // Estimate the size of other compiler-generated shims to be 1. - _ => 1, - } -} - /// If `def_id` is an issue 33140 hack impl, returns its self type; otherwise, returns `None`. /// /// See [`ty::ImplOverlapKind::Issue33140`] for more details. @@ -432,7 +416,6 @@ pub fn provide(providers: &mut Providers) { adt_sized_constraint, param_env, param_env_reveal_all_normalized, - instance_def_size_estimate, issue33140_self_ty, defaultness, unsizing_params_for_adt, |
