Add test for #[deprecated] attribute on trait impl block.

This commit is contained in:
Mara Bos
2020-11-01 13:09:03 +01:00
parent 6f1992a7d6
commit 9fc991a0ea
2 changed files with 18 additions and 1 deletions
@@ -30,4 +30,13 @@ fn multiple1() { }
#[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items
fn f1() { }
struct X;
#[deprecated = "hello"] //~ ERROR this `#[deprecated]' annotation has no effect
impl Default for X {
fn default() -> Self {
X
}
}
fn main() { }
@@ -58,7 +58,15 @@ error[E0538]: multiple 'since' items
LL | #[deprecated(since = "a", since = "b", note = "c")]
| ^^^^^^^^^^^
error: aborting due to 9 previous errors
error: this `#[deprecated]' annotation has no effect
--> $DIR/deprecation-sanity.rs:35:1
|
LL | #[deprecated = "hello"]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
|
= note: `#[deny(useless_deprecated)]` on by default
error: aborting due to 10 previous errors
Some errors have detailed explanations: E0538, E0541, E0550, E0551, E0565.
For more information about an error, try `rustc --explain E0538`.