Skip to content

Commit ddfdbe0

Browse files
committed
Remove an unnecessary argument
1 parent 3f0b21f commit ddfdbe0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_infer/src/infer/opaque_types.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ impl<'tcx> InferCtxt<'tcx> {
380380
span: Span,
381381
param_env: ty::ParamEnv<'tcx>,
382382
) -> Option<OpaqueTyOrigin> {
383-
let opaque_hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
384383
let parent_def_id = match self.defining_use_anchor {
385384
DefiningAnchor::Bubble | DefiningAnchor::Error => return None,
386385
DefiningAnchor::Bind(bind) => bind,
@@ -402,7 +401,7 @@ impl<'tcx> InferCtxt<'tcx> {
402401
hir::OpaqueTyOrigin::FnReturn(parent) => parent == parent_def_id,
403402
// Named `type Foo = impl Bar;`
404403
hir::OpaqueTyOrigin::TyAlias => {
405-
may_define_opaque_type(self.tcx, parent_def_id, opaque_hir_id, def_id, param_env)
404+
may_define_opaque_type(self.tcx, parent_def_id, def_id, param_env)
406405
}
407406
};
408407
trace!(?origin);
@@ -650,10 +649,10 @@ impl<'tcx> InferCtxt<'tcx> {
650649
fn may_define_opaque_type<'tcx>(
651650
tcx: TyCtxt<'tcx>,
652651
def_id: LocalDefId,
653-
opaque_hir_id: hir::HirId,
654652
opaque_def_id: LocalDefId,
655653
param_env: ty::ParamEnv<'tcx>,
656654
) -> bool {
655+
let opaque_hir_id = tcx.hir().local_def_id_to_hir_id(opaque_def_id);
657656
let mut hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
658657

659658
// Named opaque types can be defined by any siblings or children of siblings.

0 commit comments

Comments
 (0)