@@ -39,7 +39,6 @@ use rustc_span::Span;
39
39
40
40
use std:: cell:: { Cell , RefCell } ;
41
41
use std:: fmt;
42
- use std:: ops:: Drop ;
43
42
44
43
use self :: combine:: CombineFields ;
45
44
use self :: error_reporting:: TypeErrCtxt ;
@@ -342,11 +341,6 @@ pub struct InferCtxt<'tcx> {
342
341
/// there is no type that the user could *actually name* that
343
342
/// would satisfy it. This avoids crippling inference, basically.
344
343
pub intercrate : bool ,
345
-
346
- /// Flag that is set when we enter canonicalization. Used for debugging to ensure
347
- /// that we only collect region information for `BorrowckInferCtxt::reg_var_to_origin`
348
- /// inside non-canonicalization contexts.
349
- inside_canonicalization_ctxt : Cell < bool > ,
350
344
}
351
345
352
346
/// See the `error_reporting` module for more details.
@@ -638,7 +632,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
638
632
skip_leak_check : Cell :: new ( false ) ,
639
633
universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
640
634
intercrate,
641
- inside_canonicalization_ctxt : Cell :: new ( false ) ,
642
635
}
643
636
}
644
637
}
@@ -1636,31 +1629,6 @@ impl<'tcx> InferCtxt<'tcx> {
1636
1629
}
1637
1630
}
1638
1631
}
1639
-
1640
- pub fn inside_canonicalization_ctxt ( & self ) -> bool {
1641
- self . inside_canonicalization_ctxt . get ( )
1642
- }
1643
-
1644
- pub fn set_canonicalization_ctxt ( & self ) -> CanonicalizationCtxtGuard < ' _ , ' tcx > {
1645
- let prev_ctxt = self . inside_canonicalization_ctxt ( ) ;
1646
- self . inside_canonicalization_ctxt . set ( true ) ;
1647
- CanonicalizationCtxtGuard { prev_ctxt, infcx : self }
1648
- }
1649
-
1650
- fn set_canonicalization_ctxt_to ( & self , ctxt : bool ) {
1651
- self . inside_canonicalization_ctxt . set ( ctxt) ;
1652
- }
1653
- }
1654
-
1655
- pub struct CanonicalizationCtxtGuard < ' cx , ' tcx > {
1656
- prev_ctxt : bool ,
1657
- infcx : & ' cx InferCtxt < ' tcx > ,
1658
- }
1659
-
1660
- impl < ' cx , ' tcx > Drop for CanonicalizationCtxtGuard < ' cx , ' tcx > {
1661
- fn drop ( & mut self ) {
1662
- self . infcx . set_canonicalization_ctxt_to ( self . prev_ctxt )
1663
- }
1664
1632
}
1665
1633
1666
1634
impl < ' tcx > TypeErrCtxt < ' _ , ' tcx > {
0 commit comments