@@ -8,9 +8,7 @@ use rustc_errors::{Applicability, Diag, EmissionGuarantee, MultiSpan, listify};
8
8
use rustc_hir:: def:: { CtorKind , Namespace } ;
9
9
use rustc_hir:: { self as hir, CoroutineKind , LangItem } ;
10
10
use rustc_index:: IndexSlice ;
11
- use rustc_infer:: infer:: {
12
- BoundRegionConversionTime , NllRegionVariableOrigin , RegionVariableOrigin ,
13
- } ;
11
+ use rustc_infer:: infer:: { BoundRegionConversionTime , NllRegionVariableOrigin } ;
14
12
use rustc_infer:: traits:: SelectionError ;
15
13
use rustc_middle:: bug;
16
14
use rustc_middle:: mir:: {
@@ -587,7 +585,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
587
585
// this by hooking into the pretty printer and telling it to label the
588
586
// lifetimes without names with the value `'0`.
589
587
if let ty:: Ref ( region, ..) = ty. kind ( ) {
590
- match * * region {
588
+ match region. kind ( ) {
591
589
ty:: ReBound ( _, ty:: BoundRegion { kind : br, .. } )
592
590
| ty:: RePlaceholder ( ty:: PlaceholderRegion {
593
591
bound : ty:: BoundRegion { kind : br, .. } ,
@@ -607,7 +605,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
607
605
let mut printer = ty:: print:: FmtPrinter :: new ( self . infcx . tcx , Namespace :: TypeNS ) ;
608
606
609
607
let region = if let ty:: Ref ( region, ..) = ty. kind ( ) {
610
- match * * region {
608
+ match region. kind ( ) {
611
609
ty:: ReBound ( _, ty:: BoundRegion { kind : br, .. } )
612
610
| ty:: RePlaceholder ( ty:: PlaceholderRegion {
613
611
bound : ty:: BoundRegion { kind : br, .. } ,
@@ -633,9 +631,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
633
631
) {
634
632
let predicate_span = path. iter ( ) . find_map ( |constraint| {
635
633
let outlived = constraint. sub ;
636
- if let Some ( origin) = self . regioncx . var_infos . get ( outlived)
637
- && let RegionVariableOrigin :: Nll ( NllRegionVariableOrigin :: Placeholder ( _) ) =
638
- origin. origin
634
+ if let Some ( origin) = self . regioncx . definitions . get ( outlived)
635
+ && let NllRegionVariableOrigin :: Placeholder ( _) = origin. origin
639
636
&& let ConstraintCategory :: Predicate ( span) = constraint. category
640
637
{
641
638
Some ( span)
0 commit comments