@@ -293,15 +293,9 @@ impl<'tcx> TyCtxt<'tcx> {
293
293
/// If `id` is `Some(_)`, this function will also check if the item at `def_id` has been
294
294
/// deprecated. If the item is indeed deprecated, we will emit a deprecation lint attached to
295
295
/// `id`.
296
- pub fn eval_stability (
297
- self ,
298
- def_id : DefId ,
299
- id : Option < HirId > ,
300
- span : Span ,
301
- check_deprecation : bool ,
302
- ) -> EvalResult {
296
+ pub fn eval_stability ( self , def_id : DefId , id : Option < HirId > , span : Span ) -> EvalResult {
303
297
// Deprecated attributes apply in-crate and cross-crate.
304
- if let ( Some ( id) , true ) = ( id , check_deprecation ) {
298
+ if let Some ( id) = id {
305
299
if let Some ( depr_entry) = self . lookup_deprecation_entry ( def_id) {
306
300
let parent_def_id = self . hir ( ) . local_def_id ( self . hir ( ) . get_parent_item ( id) ) ;
307
301
let skip = self
@@ -398,10 +392,10 @@ impl<'tcx> TyCtxt<'tcx> {
398
392
/// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
399
393
/// exist, emits an error.
400
394
///
401
- /// Additionally, this function will also check if the item is deprecated. If so, and `id` is
402
- /// not `None`, a deprecated lint attached to `id` will be emitted.
395
+ /// This function will also check if the item is deprecated.
396
+ /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
403
397
pub fn check_stability ( self , def_id : DefId , id : Option < HirId > , span : Span ) {
404
- self . check_stability_internal ( def_id, id, span, true , |span, def_id| {
398
+ self . check_stability_internal ( def_id, id, span, |span, def_id| {
405
399
// The API could be uncallable for other reasons, for example when a private module
406
400
// was referenced.
407
401
self . sess . delay_span_bug ( span, & format ! ( "encountered unmarked API: {:?}" , def_id) ) ;
@@ -413,22 +407,21 @@ impl<'tcx> TyCtxt<'tcx> {
413
407
/// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
414
408
/// exist, emits an error.
415
409
///
416
- /// Additionally when `inherit_dep` is `true`, this function will also check if the item is deprecated. If so, and `id` is
417
- /// not `None`, a deprecated lint attached to `id` will be emitted.
410
+ /// This function will also check if the item is deprecated.
411
+ /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted.
418
412
pub fn check_stability_internal (
419
413
self ,
420
414
def_id : DefId ,
421
415
id : Option < HirId > ,
422
416
span : Span ,
423
- check_deprecation : bool ,
424
417
unmarked : impl FnOnce ( Span , DefId ) -> ( ) ,
425
418
) {
426
419
let soft_handler = |lint, span, msg : & _ | {
427
420
self . struct_span_lint_hir ( lint, id. unwrap_or ( hir:: CRATE_HIR_ID ) , span, |lint| {
428
421
lint. build ( msg) . emit ( )
429
422
} )
430
423
} ;
431
- match self . eval_stability ( def_id, id, span, check_deprecation ) {
424
+ match self . eval_stability ( def_id, id, span) {
432
425
EvalResult :: Allow => { }
433
426
EvalResult :: Deny { feature, reason, issue, is_soft } => {
434
427
report_unstable ( self . sess , feature, reason, issue, is_soft, span, soft_handler)
0 commit comments