@@ -11,8 +11,7 @@ use rustc_errors::{Applicability, Diagnostic};
1111use rustc_feature:: GateIssue ;
1212use rustc_hir:: def:: DefKind ;
1313use 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 } ;
1615use rustc_middle:: ty:: print:: with_no_trimmed_paths;
1716use rustc_session:: lint:: builtin:: { DEPRECATED , DEPRECATED_IN_FUTURE , SOFT_UNSTABLE } ;
1817use rustc_session:: lint:: { BuiltinLintDiagnostics , Level , Lint , LintBuffer } ;
@@ -331,7 +330,7 @@ impl<'tcx> TyCtxt<'tcx> {
331330 span : Span ,
332331 method_span : Option < Span > ,
333332 ) -> 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 )
335334 }
336335
337336 /// Evaluates the stability of an item.
@@ -344,14 +343,14 @@ impl<'tcx> TyCtxt<'tcx> {
344343 /// deprecated. If the item is indeed deprecated, we will emit a deprecation lint attached to
345344 /// `id`.
346345 ///
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 (
349348 self ,
350349 def_id : DefId ,
351350 id : Option < HirId > ,
352351 span : Span ,
353352 method_span : Option < Span > ,
354- eval_override : AllowUnstable ,
353+ allow_unstable : AllowUnstable ,
355354 ) -> EvalResult {
356355 // Deprecated attributes apply in-crate and cross-crate.
357356 if let Some ( id) = id {
@@ -449,7 +448,7 @@ impl<'tcx> TyCtxt<'tcx> {
449448 }
450449 }
451450
452- if matches ! ( eval_override , AllowUnstable :: Yes ) {
451+ if matches ! ( allow_unstable , AllowUnstable :: Yes ) {
453452 return EvalResult :: Allow ;
454453 }
455454
@@ -479,7 +478,7 @@ impl<'tcx> TyCtxt<'tcx> {
479478 span : Span ,
480479 method_span : Option < Span > ,
481480 ) {
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 )
483482 }
484483
485484 /// Checks if an item is stable or error out.
@@ -490,21 +489,21 @@ impl<'tcx> TyCtxt<'tcx> {
490489 /// This function will also check if the item is deprecated.
491490 /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
492491 ///
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 (
495494 self ,
496495 def_id : DefId ,
497496 id : Option < HirId > ,
498497 span : Span ,
499498 method_span : Option < Span > ,
500- eval_override : AllowUnstable ,
499+ allow_unstable : AllowUnstable ,
501500 ) {
502501 self . check_optional_stability (
503502 def_id,
504503 id,
505504 span,
506505 method_span,
507- eval_override ,
506+ allow_unstable ,
508507 |span, def_id| {
509508 // The API could be uncallable for other reasons, for example when a private module
510509 // was referenced.
@@ -523,15 +522,15 @@ impl<'tcx> TyCtxt<'tcx> {
523522 id : Option < HirId > ,
524523 span : Span ,
525524 method_span : Option < Span > ,
526- eval_override : AllowUnstable ,
525+ allow_unstable : AllowUnstable ,
527526 unmarked : impl FnOnce ( Span , DefId ) ,
528527 ) {
529528 let soft_handler = |lint, span, msg : & _ | {
530529 self . struct_span_lint_hir ( lint, id. unwrap_or ( hir:: CRATE_HIR_ID ) , span, |lint| {
531530 lint. build ( msg) . emit ( ) ;
532531 } )
533532 } ;
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 ) {
535534 EvalResult :: Allow => { }
536535 EvalResult :: Deny { feature, reason, issue, suggestion, is_soft } => report_unstable (
537536 self . sess ,
0 commit comments