mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Add test for #[deprecated] attribute on trait impl block.
This commit is contained in:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user