@@ -232,18 +232,6 @@ pub enum DefiningAnchor {
232232pub struct InferCtxt < ' tcx > {
233233 pub tcx : TyCtxt < ' tcx > ,
234234
235- /// The `DefId` of the item in whose context we are performing inference or typeck.
236- /// It is used to check whether an opaque type use is a defining use.
237- ///
238- /// If it is `DefiningAnchor::Bubble`, we can't resolve opaque types here and need to bubble up
239- /// the obligation. This frequently happens for
240- /// short lived InferCtxt within queries. The opaque type obligations are forwarded
241- /// to the outside until the end up in an `InferCtxt` for typeck or borrowck.
242- ///
243- /// Its default value is `DefiningAnchor::Error`, this way it is easier to catch errors that
244- /// might come up during inference or typeck.
245- pub old_defining_use_anchor : DefiningAnchor ,
246-
247235 /// Whether this inference context should care about region obligations in
248236 /// the root universe. Most notably, this is used during hir typeck as region
249237 /// solving is left to borrowck instead.
@@ -537,7 +525,6 @@ impl<'tcx> fmt::Display for FixupError<'tcx> {
537525/// Used to configure inference contexts before their creation
538526pub struct InferCtxtBuilder < ' tcx > {
539527 tcx : TyCtxt < ' tcx > ,
540- defining_use_anchor : DefiningAnchor ,
541528 considering_regions : bool ,
542529 /// Whether we are in coherence mode.
543530 intercrate : bool ,
@@ -549,27 +536,11 @@ pub trait TyCtxtInferExt<'tcx> {
549536
550537impl < ' tcx > TyCtxtInferExt < ' tcx > for TyCtxt < ' tcx > {
551538 fn infer_ctxt ( self ) -> InferCtxtBuilder < ' tcx > {
552- InferCtxtBuilder {
553- tcx : self ,
554- defining_use_anchor : DefiningAnchor :: Error ,
555- considering_regions : true ,
556- intercrate : false ,
557- }
539+ InferCtxtBuilder { tcx : self , considering_regions : true , intercrate : false }
558540 }
559541}
560542
561543impl < ' tcx > InferCtxtBuilder < ' tcx > {
562- /// Whenever the `InferCtxt` should be able to handle defining uses of opaque types,
563- /// you need to call this function. Otherwise the opaque type will be treated opaquely.
564- ///
565- /// It is only meant to be called in two places, for typeck
566- /// (via `Inherited::build`) and for the inference context used
567- /// in mir borrowck.
568- pub fn with_opaque_type_inference ( mut self , defining_use_anchor : DefiningAnchor ) -> Self {
569- self . defining_use_anchor = defining_use_anchor;
570- self
571- }
572-
573544 pub fn intercrate ( mut self ) -> Self {
574545 self . intercrate = true ;
575546 self
@@ -601,10 +572,9 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
601572 }
602573
603574 pub fn build ( & mut self ) -> InferCtxt < ' tcx > {
604- let InferCtxtBuilder { tcx, defining_use_anchor , considering_regions, intercrate } = * self ;
575+ let InferCtxtBuilder { tcx, considering_regions, intercrate } = * self ;
605576 InferCtxt {
606577 tcx,
607- old_defining_use_anchor : defining_use_anchor,
608578 considering_regions,
609579 inner : RefCell :: new ( InferCtxtInner :: new ( ) ) ,
610580 lexical_region_resolutions : RefCell :: new ( None ) ,
0 commit comments