File tree 4 files changed +8
-14
lines changed
compiler/rustc_middle/src/ty
4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,7 @@ impl GenericParamDef {
73
73
74
74
pub fn is_anonymous_lifetime ( & self ) -> bool {
75
75
match self . kind {
76
- GenericParamDefKind :: Lifetime => {
77
- self . name == kw:: UnderscoreLifetime || self . name == kw:: Empty
78
- }
76
+ GenericParamDefKind :: Lifetime => self . name == kw:: UnderscoreLifetime ,
79
77
_ => false ,
80
78
}
81
79
}
Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ impl EarlyParamRegion {
457
457
/// Does this early bound region have a name? Early bound regions normally
458
458
/// always have names except when using anonymous lifetimes (`'_`).
459
459
pub fn has_name ( & self ) -> bool {
460
- self . name != kw:: UnderscoreLifetime && self . name != kw :: Empty
460
+ self . name != kw:: UnderscoreLifetime
461
461
}
462
462
}
463
463
Original file line number Diff line number Diff line change @@ -2591,11 +2591,9 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
2591
2591
// to fit that into a short string. Hence the recommendation to use
2592
2592
// `explain_region()` or `note_and_explain_region()`.
2593
2593
match * region {
2594
- ty:: ReEarlyParam ( ref data) => {
2595
- if data. name != kw:: Empty {
2596
- p ! ( write( "{}" , data. name) ) ;
2597
- return Ok ( ( ) ) ;
2598
- }
2594
+ ty:: ReEarlyParam ( data) => {
2595
+ p ! ( write( "{}" , data. name) ) ;
2596
+ return Ok ( ( ) ) ;
2599
2597
}
2600
2598
ty:: ReLateParam ( ty:: LateParamRegion { kind, .. } ) => {
2601
2599
if let Some ( name) = kind. get_name ( ) {
@@ -2834,7 +2832,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
2834
2832
2835
2833
( name, ty:: BoundRegionKind :: Named ( CRATE_DEF_ID . to_def_id ( ) , name) )
2836
2834
}
2837
- ty:: BoundRegionKind :: Named ( def_id, kw:: UnderscoreLifetime | kw :: Empty ) => {
2835
+ ty:: BoundRegionKind :: Named ( def_id, kw:: UnderscoreLifetime ) => {
2838
2836
let name = next_name ( self ) ;
2839
2837
2840
2838
if let Some ( lt_idx) = lifetime_idx {
Original file line number Diff line number Diff line change @@ -400,9 +400,7 @@ impl LateParamRegionKind {
400
400
401
401
pub fn is_named ( & self ) -> bool {
402
402
match * self {
403
- LateParamRegionKind :: Named ( _, name) => {
404
- name != kw:: UnderscoreLifetime && name != kw:: Empty
405
- }
403
+ LateParamRegionKind :: Named ( _, name) => name != kw:: UnderscoreLifetime ,
406
404
_ => false ,
407
405
}
408
406
}
@@ -475,7 +473,7 @@ impl core::fmt::Debug for BoundRegion {
475
473
impl BoundRegionKind {
476
474
pub fn is_named ( & self ) -> bool {
477
475
match * self {
478
- BoundRegionKind :: Named ( _, name) => name != kw:: UnderscoreLifetime && name != kw :: Empty ,
476
+ BoundRegionKind :: Named ( _, name) => name != kw:: UnderscoreLifetime ,
479
477
_ => false ,
480
478
}
481
479
}
You can’t perform that action at this time.
0 commit comments