@@ -16,7 +16,7 @@ use rustc_hir::def_id::{DefIdMap, LocalDefId};
1616use rustc_hir:: hir_id:: ItemLocalId ;
1717use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
1818use rustc_hir:: { GenericArg , GenericParam , LifetimeName , Node , ParamName , QPath } ;
19- use rustc_hir:: { GenericParamKind , HirIdMap , HirIdSet , LifetimeParamKind } ;
19+ use rustc_hir:: { GenericParamKind , HirIdMap , HirIdSet } ;
2020use rustc_middle:: hir:: map:: Map ;
2121use rustc_middle:: middle:: resolve_lifetime:: * ;
2222use rustc_middle:: ty:: { self , DefIdTree , GenericParamDefKind , TyCtxt } ;
@@ -1326,9 +1326,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
13261326 }
13271327
13281328 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- }
13321329 let scope = Scope :: TraitRefBoundary { s : self . scope } ;
13331330 self . with ( scope, |this| {
13341331 for param in generics. params {
@@ -1497,30 +1494,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
14971494 }
14981495}
14991496
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-
15241497fn compute_object_lifetime_defaults (
15251498 tcx : TyCtxt < ' _ > ,
15261499 item : & hir:: Item < ' _ > ,
0 commit comments