diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-10-30 16:50:40 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-10-30 17:13:38 -0700 |
| commit | 8b8906b2641ab2c7b852ac956b7388cb614e5391 (patch) | |
| tree | 5e056ebf0bd406e177b069dd5df55010edf7d154 /compiler/rustc_passes | |
| parent | dccf10e98969c31f4a395a3555f781b8dd17b25d (diff) | |
| download | rust-8b8906b2641ab2c7b852ac956b7388cb614e5391.tar.gz rust-8b8906b2641ab2c7b852ac956b7388cb614e5391.zip | |
Add method for checking if deprecation is a rustc version
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 6ef160f3b39..6a2498f3f99 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -196,14 +196,8 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { } } - if let Some(( - rustc_attr::Deprecation { since: DeprecatedSince::RustcVersion(_), .. }, - span, - )) = &depr - { - if stab.is_none() { - self.tcx.sess.emit_err(errors::DeprecatedAttribute { span: *span }); - } + if let Some((depr, span)) = &depr && depr.is_since_rustc_version() && stab.is_none() { + self.tcx.sess.emit_err(errors::DeprecatedAttribute { span: *span }); } if let Some((body_stab, _span)) = body_stab { |
