Skip to content

Commit 6ed6eb4

Browse files
committed
Update trait impl related methods
1 parent 25cc564 commit 6ed6eb4

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/monomorphize_collector.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ impl<'v> RootCollector<'_, 'v> {
13601360
}
13611361
}
13621362
}
1363-
DefKind::Impl { .. } => {
1363+
DefKind::Impl { of_trait: true } => {
13641364
if self.strategy == MonoItemCollectionStrategy::Eager {
13651365
create_mono_items_for_default_impls(self.tcx, id, self.output);
13661366
}
@@ -1513,9 +1513,7 @@ fn create_mono_items_for_default_impls<'tcx>(
15131513
item: hir::ItemId,
15141514
output: &mut MonoItems<'tcx>,
15151515
) {
1516-
let Some(impl_) = tcx.impl_trait_header(item.owner_id) else {
1517-
return;
1518-
};
1516+
let impl_ = tcx.impl_trait_header(item.owner_id);
15191517

15201518
if matches!(impl_.polarity, ty::ImplPolarity::Negative) {
15211519
return;

src/preempt_count/adjustment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ memoize!(
810810
// Addition check for trait impl methods.
811811
if matches!(instance.def, ty::InstanceKind::Item(_))
812812
&& let Some(impl_) = cx.impl_of_assoc(instance.def_id())
813-
&& let Some(trait_) = cx.trait_id_of_impl(impl_)
813+
&& let Some(trait_) = cx.impl_opt_trait_id(impl_)
814814
{
815815
let trait_def = cx.trait_def(trait_);
816816
let trait_item = cx

src/preempt_count/expectation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ memoize!(
11811181
// Addition check for trait impl methods.
11821182
if matches!(instance.def, ty::InstanceKind::Item(_))
11831183
&& let Some(impl_) = cx.impl_of_assoc(instance.def_id())
1184-
&& let Some(trait_) = cx.trait_id_of_impl(impl_)
1184+
&& let Some(trait_) = cx.impl_opt_trait_id(impl_)
11851185
{
11861186
let trait_def = cx.trait_def(trait_);
11871187
let trait_item = cx

0 commit comments

Comments
 (0)