From 3947591ee82702f124af9248463036155b83b907 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Tue, 30 Jun 2020 19:05:14 -0400 Subject: [PATCH] Remove now unneeded check_stability argument --- compiler/rustc_middle/src/middle/stability.rs | 23 +++++++------------ compiler/rustc_typeck/src/astconv/mod.rs | 1 - .../rustc_typeck/src/check/method/probe.rs | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs index 4c0e513e75c..0fb73db83e8 100644 --- a/compiler/rustc_middle/src/middle/stability.rs +++ b/compiler/rustc_middle/src/middle/stability.rs @@ -293,15 +293,9 @@ impl<'tcx> TyCtxt<'tcx> { /// If `id` is `Some(_)`, this function will also check if the item at `def_id` has been /// deprecated. If the item is indeed deprecated, we will emit a deprecation lint attached to /// `id`. - pub fn eval_stability( - self, - def_id: DefId, - id: Option, - span: Span, - check_deprecation: bool, - ) -> EvalResult { + pub fn eval_stability(self, def_id: DefId, id: Option, span: Span) -> EvalResult { // Deprecated attributes apply in-crate and cross-crate. - if let (Some(id), true) = (id, check_deprecation) { + if let Some(id) = id { if let Some(depr_entry) = self.lookup_deprecation_entry(def_id) { let parent_def_id = self.hir().local_def_id(self.hir().get_parent_item(id)); let skip = self @@ -398,10 +392,10 @@ impl<'tcx> TyCtxt<'tcx> { /// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not /// exist, emits an error. /// - /// Additionally, this function will also check if the item is deprecated. If so, and `id` is - /// not `None`, a deprecated lint attached to `id` will be emitted. + /// This function will also check if the item is deprecated. + /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted. pub fn check_stability(self, def_id: DefId, id: Option, span: Span) { - self.check_stability_internal(def_id, id, span, true, |span, def_id| { + self.check_stability_internal(def_id, id, span, |span, def_id| { // The API could be uncallable for other reasons, for example when a private module // was referenced. self.sess.delay_span_bug(span, &format!("encountered unmarked API: {:?}", def_id)); @@ -413,14 +407,13 @@ impl<'tcx> TyCtxt<'tcx> { /// If the item defined by `def_id` is unstable and the corresponding `#![feature]` does not /// exist, emits an error. /// - /// Additionally when `inherit_dep` is `true`, this function will also check if the item is deprecated. If so, and `id` is - /// not `None`, a deprecated lint attached to `id` will be emitted. + /// This function will also check if the item is deprecated. + /// If so, and `id` is not `None`, a deprecated lint attached to `id` will be emitted. pub fn check_stability_internal( self, def_id: DefId, id: Option, span: Span, - check_deprecation: bool, unmarked: impl FnOnce(Span, DefId) -> (), ) { let soft_handler = |lint, span, msg: &_| { @@ -428,7 +421,7 @@ impl<'tcx> TyCtxt<'tcx> { lint.build(msg).emit() }) }; - match self.eval_stability(def_id, id, span, check_deprecation) { + match self.eval_stability(def_id, id, span) { EvalResult::Allow => {} EvalResult::Deny { feature, reason, issue, is_soft } => { report_unstable(self.sess, feature, reason, issue, is_soft, span, soft_handler) diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index c4f1ee2e6f6..ad4c28928fc 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -366,7 +366,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { param.def_id, Some(arg.id()), arg.span(), - false, |_, _| (), ) } diff --git a/compiler/rustc_typeck/src/check/method/probe.rs b/compiler/rustc_typeck/src/check/method/probe.rs index 07e75594195..8a62031ec88 100644 --- a/compiler/rustc_typeck/src/check/method/probe.rs +++ b/compiler/rustc_typeck/src/check/method/probe.rs @@ -1227,7 +1227,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { if let Some(uc) = unstable_candidates { applicable_candidates.retain(|&(p, _)| { if let stability::EvalResult::Deny { feature, .. } = - self.tcx.eval_stability(p.item.def_id, None, self.span, true) + self.tcx.eval_stability(p.item.def_id, None, self.span) { uc.push((p, feature)); return false;