@@ -16,7 +16,7 @@ use rustc_hir::def_id::{DefIdMap, LocalDefId};
16
16
use rustc_hir:: hir_id:: ItemLocalId ;
17
17
use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
18
18
use rustc_hir:: { GenericArg , GenericParam , LifetimeName , Node , ParamName , QPath } ;
19
- use rustc_hir:: { GenericParamKind , HirIdMap , HirIdSet , LifetimeParamKind } ;
19
+ use rustc_hir:: { GenericParamKind , HirIdMap , HirIdSet } ;
20
20
use rustc_middle:: hir:: map:: Map ;
21
21
use rustc_middle:: middle:: resolve_lifetime:: * ;
22
22
use rustc_middle:: ty:: { self , DefIdTree , GenericParamDefKind , TyCtxt } ;
@@ -1326,9 +1326,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1326
1326
}
1327
1327
1328
1328
fn visit_generics ( & mut self , generics : & ' tcx hir:: Generics < ' tcx > ) {
1329
- if !self . trait_definition_only {
1330
- check_mixed_explicit_and_in_band_defs ( self . tcx , & generics. params ) ;
1331
- }
1332
1329
let scope = Scope :: TraitRefBoundary { s : self . scope } ;
1333
1330
self . with ( scope, |this| {
1334
1331
for param in generics. params {
@@ -1497,30 +1494,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
1497
1494
}
1498
1495
}
1499
1496
1500
- fn check_mixed_explicit_and_in_band_defs ( tcx : TyCtxt < ' _ > , params : & [ hir:: GenericParam < ' _ > ] ) {
1501
- let lifetime_params: Vec < _ > = params
1502
- . iter ( )
1503
- . filter_map ( |param| match param. kind {
1504
- GenericParamKind :: Lifetime { kind, .. } => Some ( ( kind, param. span ) ) ,
1505
- _ => None ,
1506
- } )
1507
- . collect ( ) ;
1508
- let explicit = lifetime_params. iter ( ) . find ( |( kind, _) | * kind == LifetimeParamKind :: Explicit ) ;
1509
- let in_band = lifetime_params. iter ( ) . find ( |( kind, _) | * kind == LifetimeParamKind :: InBand ) ;
1510
-
1511
- if let ( Some ( ( _, explicit_span) ) , Some ( ( _, in_band_span) ) ) = ( explicit, in_band) {
1512
- struct_span_err ! (
1513
- tcx. sess,
1514
- * in_band_span,
1515
- E0688 ,
1516
- "cannot mix in-band and explicit lifetime definitions"
1517
- )
1518
- . span_label ( * in_band_span, "in-band lifetime definition here" )
1519
- . span_label ( * explicit_span, "explicit lifetime definition here" )
1520
- . emit ( ) ;
1521
- }
1522
- }
1523
-
1524
1497
fn compute_object_lifetime_defaults (
1525
1498
tcx : TyCtxt < ' _ > ,
1526
1499
item : & hir:: Item < ' _ > ,
0 commit comments