@@ -4,7 +4,7 @@ use rustc::hir::def_id::DefId;
4
4
use rustc:: mir:: BorrowKind ;
5
5
use rustc:: session:: config:: nightly_options;
6
6
use rustc:: ty:: TyCtxt ;
7
- use syntax:: feature_gate:: { emit_feature_err , GateIssue } ;
7
+ use syntax:: feature_gate:: feature_err ;
8
8
use syntax:: symbol:: sym;
9
9
use syntax_pos:: { Span , Symbol } ;
10
10
@@ -222,13 +222,13 @@ impl NonConstOp for Panic {
222
222
}
223
223
224
224
fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
225
- emit_feature_err (
225
+ feature_err (
226
226
& item. tcx . sess . parse_sess ,
227
227
sym:: const_panic,
228
228
span,
229
- GateIssue :: Language ,
230
229
& format ! ( "panicking in {}s is unstable" , item. const_kind( ) ) ,
231
- ) ;
230
+ )
231
+ . emit ( ) ;
232
232
}
233
233
}
234
234
@@ -240,13 +240,13 @@ impl NonConstOp for RawPtrComparison {
240
240
}
241
241
242
242
fn emit_error ( & self , item : & Item < ' _ , ' _ > , span : Span ) {
243
- emit_feature_err (
243
+ feature_err (
244
244
& item. tcx . sess . parse_sess ,
245
245
sym:: const_compare_raw_pointers,
246
246
span,
247
- GateIssue :: Language ,
248
247
& format ! ( "comparing raw pointers inside {}" , item. const_kind( ) ) ,
249
- ) ;
248
+ )
249
+ . emit ( ) ;
250
250
}
251
251
}
252
252
@@ -258,14 +258,14 @@ impl NonConstOp for RawPtrDeref {
258
258
}
259
259
260
260
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,
264
263
& format ! (
265
264
"dereferencing raw pointers in {}s is unstable" ,
266
265
item. const_kind( ) ,
267
266
) ,
268
- ) ;
267
+ )
268
+ . emit ( ) ;
269
269
}
270
270
}
271
271
@@ -277,14 +277,14 @@ impl NonConstOp for RawPtrToIntCast {
277
277
}
278
278
279
279
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,
283
282
& format ! (
284
283
"casting pointers to integers in {}s is unstable" ,
285
284
item. const_kind( ) ,
286
285
) ,
287
- ) ;
286
+ )
287
+ . emit ( ) ;
288
288
}
289
289
}
290
290
@@ -334,11 +334,11 @@ impl NonConstOp for Transmute {
334
334
}
335
335
336
336
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 ( ) ;
342
342
}
343
343
}
344
344
@@ -355,10 +355,10 @@ impl NonConstOp for UnionAccess {
355
355
}
356
356
357
357
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,
361
360
"unions in const fn are unstable" ,
362
- ) ;
361
+ )
362
+ . emit ( ) ;
363
363
}
364
364
}
0 commit comments