diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-11-03 19:32:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-03 19:32:36 +0100 |
| commit | f0112928cb13dbf8936c79d31badf3b684bdda10 (patch) | |
| tree | 21ed8acc3d2f48b62adbc65b674c43ad365e4250 /compiler/rustc_mir/src/transform/coverage/debug.rs | |
| parent | 39f5563e73a46f3393d33f501e51be59a4927f98 (diff) | |
| parent | 9c647d102168f0344bf895aedf96dd52c193aa25 (diff) | |
| download | rust-f0112928cb13dbf8936c79d31badf3b684bdda10.tar.gz rust-f0112928cb13dbf8936c79d31badf3b684bdda10.zip | |
Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank
Improve errors about #[deprecated] attribute
This change:
1. Turns `#[deprecated]` on a trait impl block into an error, which fixes #78625;
2. Changes these and other errors about `#[deprecated]` to use the span of the attribute instead of the item; and
3. Turns this error into a lint, to make sure it can be capped with `--cap-lints` and doesn't break any existing dependencies.
Can be reviewed per commit.
---
Example:
```rust
struct X;
#[deprecated = "a"]
impl Default for X {
#[deprecated = "b"]
fn default() -> Self {
X
}
}
```
Before:
```
error: This deprecation annotation is useless
--> src/main.rs:6:5
|
6 | / fn default() -> Self {
7 | | X
8 | | }
| |_____^
```
After:
```
error: this `#[deprecated]' annotation has no effect
--> src/main.rs:3:1
|
3 | #[deprecated = "a"]
| ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
|
= note: `#[deny(useless_deprecated)]` on by default
error: this `#[deprecated]' annotation has no effect
--> src/main.rs:5:5
|
5 | #[deprecated = "b"]
| ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute
```
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions
