1
Fork 0

Add method for checking if deprecation is a rustc version

This commit is contained in:
David Tolnay 2023-10-30 16:50:40 -07:00
parent dccf10e989
commit 8b8906b264
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 7 additions and 9 deletions

View file

@ -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 {