Skip to content

Commit cdb76dc

Browse files
committed
Avoid hitting IntoQueryParam<P> for &'a P impl
This is removed.
1 parent 3766c3e commit cdb76dc

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#![feature(rustc_private)]
66
#![feature(box_patterns)]
7-
#![feature(if_let_guard)]
87
#![feature(never_type)]
98
#![feature(try_blocks)]
109
// Used in monomorphize collector

src/mir/elaborate_drop.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,18 @@ where
267267
// impl_item_refs may be empty if drop fn is not implemented in 'impl AsyncDrop for ...'
268268
// (#140974).
269269
// Such code will report error, so just generate sync drop here and return
270-
let Some(drop_fn_def_id) = tcx
271-
.associated_item_def_ids(drop_trait)
272-
.first()
273-
.and_then(|def_id| {
274-
if tcx.def_kind(def_id) == DefKind::AssocFn
275-
&& tcx.check_args_compatible(*def_id, trait_args)
276-
{
277-
Some(def_id)
278-
} else {
279-
None
280-
}
281-
})
282-
.copied()
270+
let Some(drop_fn_def_id) =
271+
tcx.associated_item_def_ids(drop_trait)
272+
.first()
273+
.and_then(|&def_id| {
274+
if tcx.def_kind(def_id) == DefKind::AssocFn
275+
&& tcx.check_args_compatible(def_id, trait_args)
276+
{
277+
Some(def_id)
278+
} else {
279+
None
280+
}
281+
})
283282
else {
284283
tcx.dcx().span_delayed_bug(
285284
self.elaborator.body().span,

src/monomorphize_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn custom_coerce_unsize_info<'tcx>(
8282
Ok(traits::ImplSource::UserDefined(traits::ImplSourceUserDefinedData {
8383
impl_def_id,
8484
..
85-
})) => Ok(tcx.coerce_unsized_info(impl_def_id)?.custom_kind.unwrap()),
85+
})) => Ok(tcx.coerce_unsized_info(*impl_def_id)?.custom_kind.unwrap()),
8686
impl_source => {
8787
bug!("invalid `CoerceUnsized` impl_source: {:?}", impl_source);
8888
}

0 commit comments

Comments
 (0)