Skip to content

Commit 737d473

Browse files
committed
Inline lower_generic_args_of_trait_ref
Only had a single call site and having it as a separate method didn't gain us anything.
1 parent 49aee29 commit 737d473

File tree

1 file changed

+6
-26
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+6
-26
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -751,33 +751,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
751751
// FIXME(effects): Move all host param things in HIR ty lowering to AST lowering.
752752
constness: ty::BoundConstness,
753753
) -> ty::TraitRef<'tcx> {
754-
let (generic_args, _) = self.lower_generic_args_of_trait_ref(
755-
span,
756-
trait_def_id,
757-
self_ty,
758-
trait_segment,
759-
is_impl,
760-
constness,
761-
);
762-
if let Some(b) = trait_segment.args().bindings.first() {
763-
prohibit_assoc_item_binding(self.tcx(), b.span, Some((trait_segment, span)));
764-
}
765-
ty::TraitRef::new(self.tcx(), trait_def_id, generic_args)
766-
}
767-
768-
#[instrument(level = "debug", skip(self, span))]
769-
fn lower_generic_args_of_trait_ref<'a>(
770-
&self,
771-
span: Span,
772-
trait_def_id: DefId,
773-
self_ty: Ty<'tcx>,
774-
trait_segment: &'a hir::PathSegment<'tcx>,
775-
is_impl: bool,
776-
constness: ty::BoundConstness,
777-
) -> (GenericArgsRef<'tcx>, GenericArgCountResult) {
778754
self.complain_about_internal_fn_trait(span, trait_def_id, trait_segment, is_impl);
779755

780-
self.lower_generic_args_of_path(
756+
let (generic_args, _) = self.lower_generic_args_of_path(
781757
span,
782758
trait_def_id,
783759
&[],
@@ -786,7 +762,11 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
786762
trait_segment.infer_args,
787763
Some(self_ty),
788764
constness,
789-
)
765+
);
766+
if let Some(b) = trait_segment.args().bindings.first() {
767+
prohibit_assoc_item_binding(self.tcx(), b.span, Some((trait_segment, span)));
768+
}
769+
ty::TraitRef::new(self.tcx(), trait_def_id, generic_args)
790770
}
791771

792772
fn probe_trait_that_defines_assoc_item(

0 commit comments

Comments
 (0)