Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3947591

Browse files
Avi-D-coderJacob Hughes
authored andcommitted
Remove now unneeded check_stability argument
1 parent a1892f1 commit 3947591

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
366366
param.def_id,
367367
Some(arg.id()),
368368
arg.span(),
369-
false,
370369
|_, _| (),
371370
)
372371
}

compiler/rustc_typeck/src/check/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
12271227
if let Some(uc) = unstable_candidates {
12281228
applicable_candidates.retain(|&(p, _)| {
12291229
if let stability::EvalResult::Deny { feature, .. } =
1230-
self.tcx.eval_stability(p.item.def_id, None, self.span, true)
1230+
self.tcx.eval_stability(p.item.def_id, None, self.span)
12311231
{
12321232
uc.push((p, feature));
12331233
return false;

0 commit comments

Comments
 (0)