@@ -50,7 +50,6 @@ use std::collections::BTreeMap;
50
50
use std:: iter;
51
51
use syntax:: ast:: * ;
52
52
use syntax:: attr:: { ThinAttributes , ThinAttributesExt } ;
53
- use syntax:: errors:: Handler ;
54
53
use syntax:: ext:: mtwt;
55
54
use syntax:: ptr:: P ;
56
55
use syntax:: codemap:: { respan, Spanned , Span } ;
@@ -94,7 +93,7 @@ impl Resolver for DummyResolver {
94
93
}
95
94
}
96
95
97
- impl < ' a , ' hir > LoweringContext < ' a > {
96
+ impl < ' a > LoweringContext < ' a > {
98
97
pub fn new ( id_assigner : & ' a NodeIdAssigner ,
99
98
c : Option < & Crate > ,
100
99
resolver : & ' a mut Resolver )
@@ -125,11 +124,6 @@ impl<'a, 'hir> LoweringContext<'a> {
125
124
hir:: Ident :: from_name ( token:: gensym ( s) )
126
125
}
127
126
128
- // Panics if this LoweringContext's NodeIdAssigner is not able to emit diagnostics.
129
- fn diagnostic ( & self ) -> & Handler {
130
- self . id_assigner . diagnostic ( )
131
- }
132
-
133
127
fn with_parent_def < T , F : FnOnce ( ) -> T > ( & self , parent_id : NodeId , f : F ) -> T {
134
128
let old_def = self . parent_def . get ( ) ;
135
129
self . parent_def . set ( match self . resolver . borrow_mut ( ) . definitions ( ) {
@@ -1245,8 +1239,8 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
1245
1239
make_struct ( lctx, e, & [ "RangeInclusive" , "NonEmpty" ] ,
1246
1240
& [ ( "start" , e1) , ( "end" , e2) ] ) ,
1247
1241
1248
- _ => panic ! ( lctx. diagnostic( ) . span_fatal ( e . span ,
1249
- "inclusive range with no end" ) )
1242
+ _ => panic ! ( lctx. id_assigner . diagnostic( )
1243
+ . span_fatal ( e . span , "inclusive range with no end" ) ) ,
1250
1244
} ;
1251
1245
}
1252
1246
ExprKind :: Path ( ref qself, ref path) => {
0 commit comments