Preserve deprecation attribute even if 'since' version is missing
This commit is contained in:
parent
b106167673
commit
c52367276d
@ -876,10 +876,10 @@ pub fn find_deprecation(
|
||||
sess.emit_err(session_diagnostics::InvalidSince { span: attr.span });
|
||||
Some(DeprecatedSince::Err)
|
||||
}
|
||||
} else if is_rustc {
|
||||
sess.emit_err(session_diagnostics::MissingSince { span: attr.span });
|
||||
continue;
|
||||
} else {
|
||||
if is_rustc {
|
||||
sess.emit_err(session_diagnostics::MissingSince { span: attr.span });
|
||||
}
|
||||
None
|
||||
};
|
||||
|
||||
|
@ -19,6 +19,7 @@ fn f4() { }
|
||||
|
||||
#[stable(feature = "a", since = "3.3.3")]
|
||||
#[deprecated] //~ ERROR missing 'since'
|
||||
//~^ ERROR missing 'note'
|
||||
fn f5() { }
|
||||
|
||||
#[stable(feature = "a", since = "3.3.3")]
|
||||
|
@ -28,12 +28,19 @@ error[E0542]: missing 'since'
|
||||
LL | #[deprecated]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0543]: missing 'note'
|
||||
--> $DIR/stability-attribute-sanity-4.rs:21:5
|
||||
|
|
||||
LL | #[deprecated]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0542]: missing 'since'
|
||||
--> $DIR/stability-attribute-sanity-4.rs:25:5
|
||||
--> $DIR/stability-attribute-sanity-4.rs:26:5
|
||||
|
|
||||
LL | #[deprecated = "a"]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0542`.
|
||||
Some errors have detailed explanations: E0542, E0543.
|
||||
For more information about an error, try `rustc --explain E0542`.
|
||||
|
Loading…
Reference in New Issue
Block a user