Skip to content

Commit deeb0c5

Browse files
committed
Inline and remove InferCtxtBuilder::with_defining_opaque_types.
It has a single use.
1 parent 0ca4784 commit deeb0c5

File tree

1 file changed

+3
-10
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+3
-10
lines changed

compiler/rustc_infer/src/infer/mod.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
569569
self
570570
}
571571

572-
pub fn with_defining_opaque_types(
573-
mut self,
574-
defining_opaque_types: &'tcx ty::List<LocalDefId>,
575-
) -> Self {
576-
self.defining_opaque_types = defining_opaque_types;
577-
self
578-
}
579-
580572
pub fn with_next_trait_solver(mut self, next_trait_solver: bool) -> Self {
581573
self.next_trait_solver = next_trait_solver;
582574
self
@@ -605,14 +597,15 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
605597
/// the bound values in `C` to their instantiated values in `V`
606598
/// (in other words, `S(C) = V`).
607599
pub fn build_with_canonical<T>(
608-
self,
600+
mut self,
609601
span: Span,
610602
canonical: &Canonical<'tcx, T>,
611603
) -> (InferCtxt<'tcx>, T, CanonicalVarValues<'tcx>)
612604
where
613605
T: TypeFoldable<TyCtxt<'tcx>>,
614606
{
615-
let infcx = self.with_defining_opaque_types(canonical.defining_opaque_types).build();
607+
self.defining_opaque_types = canonical.defining_opaque_types;
608+
let infcx = self.build();
616609
let (value, args) = infcx.instantiate_canonical(span, canonical);
617610
(infcx, value, args)
618611
}

0 commit comments

Comments
 (0)