@@ -11,8 +11,7 @@ use rustc_errors::{Applicability, Diagnostic};
11
11
use rustc_feature:: GateIssue ;
12
12
use rustc_hir:: def:: DefKind ;
13
13
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
14
- use rustc_hir:: { self as hir} ;
15
- use rustc_hir:: { self , HirId } ;
14
+ use rustc_hir:: { self as hir, HirId } ;
16
15
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
17
16
use rustc_session:: lint:: builtin:: { DEPRECATED , DEPRECATED_IN_FUTURE , SOFT_UNSTABLE } ;
18
17
use rustc_session:: lint:: { BuiltinLintDiagnostics , Level , Lint , LintBuffer } ;
@@ -331,7 +330,7 @@ impl<'tcx> TyCtxt<'tcx> {
331
330
span : Span ,
332
331
method_span : Option < Span > ,
333
332
) -> EvalResult {
334
- self . eval_stability_override ( def_id, id, span, method_span, AllowUnstable :: No )
333
+ self . eval_stability_allow_unstable ( def_id, id, span, method_span, AllowUnstable :: No )
335
334
}
336
335
337
336
/// Evaluates the stability of an item.
@@ -344,14 +343,14 @@ impl<'tcx> TyCtxt<'tcx> {
344
343
/// deprecated. If the item is indeed deprecated, we will emit a deprecation lint attached to
345
344
/// `id`.
346
345
///
347
- /// Pass `EvalOverride::AllowUnstable ` to `eval_override ` to force an unstable item to be allowed. Deprecation warnings will be emitted normally.
348
- pub fn eval_stability_override (
346
+ /// Pass `AllowUnstable::Yes ` to `allow_unstable ` to force an unstable item to be allowed. Deprecation warnings will be emitted normally.
347
+ pub fn eval_stability_allow_unstable (
349
348
self ,
350
349
def_id : DefId ,
351
350
id : Option < HirId > ,
352
351
span : Span ,
353
352
method_span : Option < Span > ,
354
- eval_override : AllowUnstable ,
353
+ allow_unstable : AllowUnstable ,
355
354
) -> EvalResult {
356
355
// Deprecated attributes apply in-crate and cross-crate.
357
356
if let Some ( id) = id {
@@ -449,7 +448,7 @@ impl<'tcx> TyCtxt<'tcx> {
449
448
}
450
449
}
451
450
452
- if matches ! ( eval_override , AllowUnstable :: Yes ) {
451
+ if matches ! ( allow_unstable , AllowUnstable :: Yes ) {
453
452
return EvalResult :: Allow ;
454
453
}
455
454
@@ -479,7 +478,7 @@ impl<'tcx> TyCtxt<'tcx> {
479
478
span : Span ,
480
479
method_span : Option < Span > ,
481
480
) {
482
- self . check_stability_override ( def_id, id, span, method_span, AllowUnstable :: No )
481
+ self . check_stability_allow_unstable ( def_id, id, span, method_span, AllowUnstable :: No )
483
482
}
484
483
485
484
/// Checks if an item is stable or error out.
@@ -490,21 +489,21 @@ impl<'tcx> TyCtxt<'tcx> {
490
489
/// This function will also check if the item is deprecated.
491
490
/// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
492
491
///
493
- /// Pass `EvalOverride::AllowUnstable ` to `eval_override ` to force an unstable item to be allowed. Deprecation warnings will be emitted normally.
494
- pub fn check_stability_override (
492
+ /// Pass `AllowUnstable::Yes ` to `allow_unstable ` to force an unstable item to be allowed. Deprecation warnings will be emitted normally.
493
+ pub fn check_stability_allow_unstable (
495
494
self ,
496
495
def_id : DefId ,
497
496
id : Option < HirId > ,
498
497
span : Span ,
499
498
method_span : Option < Span > ,
500
- eval_override : AllowUnstable ,
499
+ allow_unstable : AllowUnstable ,
501
500
) {
502
501
self . check_optional_stability (
503
502
def_id,
504
503
id,
505
504
span,
506
505
method_span,
507
- eval_override ,
506
+ allow_unstable ,
508
507
|span, def_id| {
509
508
// The API could be uncallable for other reasons, for example when a private module
510
509
// was referenced.
@@ -523,15 +522,15 @@ impl<'tcx> TyCtxt<'tcx> {
523
522
id : Option < HirId > ,
524
523
span : Span ,
525
524
method_span : Option < Span > ,
526
- eval_override : AllowUnstable ,
525
+ allow_unstable : AllowUnstable ,
527
526
unmarked : impl FnOnce ( Span , DefId ) ,
528
527
) {
529
528
let soft_handler = |lint, span, msg : & _ | {
530
529
self . struct_span_lint_hir ( lint, id. unwrap_or ( hir:: CRATE_HIR_ID ) , span, |lint| {
531
530
lint. build ( msg) . emit ( ) ;
532
531
} )
533
532
} ;
534
- match self . eval_stability_override ( def_id, id, span, method_span, eval_override ) {
533
+ match self . eval_stability_allow_unstable ( def_id, id, span, method_span, allow_unstable ) {
535
534
EvalResult :: Allow => { }
536
535
EvalResult :: Deny { feature, reason, issue, suggestion, is_soft } => report_unstable (
537
536
self . sess ,
0 commit comments