@@ -4,7 +4,7 @@ use rustc::hir::def_id::DefId;
44use rustc:: mir:: BorrowKind ;
55use rustc:: session:: config:: nightly_options;
66use rustc:: ty:: TyCtxt ;
7- use syntax:: feature_gate:: { emit_feature_err , GateIssue } ;
7+ use syntax:: feature_gate:: feature_err ;
88use syntax:: symbol:: sym;
99use syntax_pos:: { Span , Symbol } ;
1010
@@ -222,13 +222,13 @@ impl NonConstOp for Panic {
222222 }
223223
224224 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
225- emit_feature_err (
225+ feature_err (
226226 & item. tcx . sess . parse_sess ,
227227 sym:: const_panic,
228228 span,
229- GateIssue :: Language ,
230229 & format ! ( "panicking in {}s is unstable" , item. const_kind( ) ) ,
231- ) ;
230+ )
231+ . emit ( ) ;
232232 }
233233}
234234
@@ -240,13 +240,13 @@ impl NonConstOp for RawPtrComparison {
240240 }
241241
242242 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
243- emit_feature_err (
243+ feature_err (
244244 & item. tcx . sess . parse_sess ,
245245 sym:: const_compare_raw_pointers,
246246 span,
247- GateIssue :: Language ,
248247 & format ! ( "comparing raw pointers inside {}" , item. const_kind( ) ) ,
249- ) ;
248+ )
249+ . emit ( ) ;
250250 }
251251}
252252
@@ -258,14 +258,14 @@ impl NonConstOp for RawPtrDeref {
258258 }
259259
260260 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
261- emit_feature_err (
262- & item. tcx . sess . parse_sess , sym:: const_raw_ptr_deref,
263- span, GateIssue :: Language ,
261+ feature_err (
262+ & item. tcx . sess . parse_sess , sym:: const_raw_ptr_deref, span,
264263 & format ! (
265264 "dereferencing raw pointers in {}s is unstable" ,
266265 item. const_kind( ) ,
267266 ) ,
268- ) ;
267+ )
268+ . emit ( ) ;
269269 }
270270}
271271
@@ -277,14 +277,14 @@ impl NonConstOp for RawPtrToIntCast {
277277 }
278278
279279 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
280- emit_feature_err (
281- & item. tcx . sess . parse_sess , sym:: const_raw_ptr_to_usize_cast,
282- span, GateIssue :: Language ,
280+ feature_err (
281+ & item. tcx . sess . parse_sess , sym:: const_raw_ptr_to_usize_cast, span,
283282 & format ! (
284283 "casting pointers to integers in {}s is unstable" ,
285284 item. const_kind( ) ,
286285 ) ,
287- ) ;
286+ )
287+ . emit ( ) ;
288288 }
289289}
290290
@@ -334,11 +334,11 @@ impl NonConstOp for Transmute {
334334 }
335335
336336 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
337- emit_feature_err (
338- & item. tcx . sess . parse_sess , sym:: const_transmute,
339- span , GateIssue :: Language ,
340- & format ! ( "The use of std::mem::transmute() \
341- is gated in {}s" , item . const_kind ( ) ) ) ;
337+ feature_err (
338+ & item. tcx . sess . parse_sess , sym:: const_transmute, span ,
339+ & format ! ( "The use of std::mem::transmute() is gated in {}s" , item . const_kind ( ) )
340+ )
341+ . emit ( ) ;
342342 }
343343}
344344
@@ -355,10 +355,10 @@ impl NonConstOp for UnionAccess {
355355 }
356356
357357 fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
358- emit_feature_err (
359- & item. tcx . sess . parse_sess , sym:: const_fn_union,
360- span, GateIssue :: Language ,
358+ feature_err (
359+ & item. tcx . sess . parse_sess , sym:: const_fn_union, span,
361360 "unions in const fn are unstable" ,
362- ) ;
361+ )
362+ . emit ( ) ;
363363 }
364364}
0 commit comments