@@ -293,15 +293,9 @@ impl<'tcx> TyCtxt<'tcx> {
293293 /// If `id` is `Some(_)`, this function will also check if the item at `def_id` has been
294294 /// deprecated. If the item is indeed deprecated, we will emit a deprecation lint attached to
295295 /// `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 {
303297 // Deprecated attributes apply in-crate and cross-crate.
304- if let ( Some ( id) , true ) = ( id , check_deprecation ) {
298+ if let Some ( id) = id {
305299 if let Some ( depr_entry) = self . lookup_deprecation_entry ( def_id) {
306300 let parent_def_id = self . hir ( ) . local_def_id ( self . hir ( ) . get_parent_item ( id) ) ;
307301 let skip = self
@@ -398,10 +392,10 @@ impl<'tcx> TyCtxt<'tcx> {
398392 /// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
399393 /// exist, emits an error.
400394 ///
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.
403397 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| {
405399 // The API could be uncallable for other reasons, for example when a private module
406400 // was referenced.
407401 self . sess . delay_span_bug ( span, & format ! ( "encountered unmarked API: {:?}" , def_id) ) ;
@@ -413,22 +407,21 @@ impl<'tcx> TyCtxt<'tcx> {
413407 /// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not
414408 /// exist, emits an error.
415409 ///
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.
418412 pub fn check_stability_internal (
419413 self ,
420414 def_id : DefId ,
421415 id : Option < HirId > ,
422416 span : Span ,
423- check_deprecation : bool ,
424417 unmarked : impl FnOnce ( Span , DefId ) -> ( ) ,
425418 ) {
426419 let soft_handler = |lint, span, msg : & _ | {
427420 self . struct_span_lint_hir ( lint, id. unwrap_or ( hir:: CRATE_HIR_ID ) , span, |lint| {
428421 lint. build ( msg) . emit ( )
429422 } )
430423 } ;
431- match self . eval_stability ( def_id, id, span, check_deprecation ) {
424+ match self . eval_stability ( def_id, id, span) {
432425 EvalResult :: Allow => { }
433426 EvalResult :: Deny { feature, reason, issue, is_soft } => {
434427 report_unstable ( self . sess , feature, reason, issue, is_soft, span, soft_handler)
0 commit comments