rust/compiler
Mara Bos f0112928cb
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
```
2020-11-03 19:32:36 +01:00
..
rustc
rustc_apfloat Backport another LLVM commit to rustc_apfloat 2020-10-04 02:02:25 +02:00
rustc_arena Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_ast Rollup merge of #78376 - Aaron1011:feature/consistent-empty-expr, r=petrochenkov 2020-11-03 15:27:03 +09:00
rustc_ast_lowering Implement rustc side of report-future-incompat 2020-10-30 20:02:14 -04:00
rustc_ast_passes Fix typos 2020-10-29 16:51:46 +01:00
rustc_ast_pretty Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_attr Improve deprecation attribute diagnostic messages. 2020-11-02 13:21:18 +01:00
rustc_builtin_macros Unconditionally capture tokens for attributes. 2020-10-21 18:57:29 -04:00
rustc_codegen_cranelift Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into update_cg_clif-2020-11-01 2020-11-03 11:00:04 +01:00
rustc_codegen_llvm Rollup merge of #77950 - arlosi:sha256, r=eddyb 2020-11-03 19:32:26 +01:00
rustc_codegen_ssa Auto merge of #78448 - rylev:cache-foreign_modules, r=wesleywiser 2020-11-03 04:27:27 +00:00
rustc_data_structures Move post order walk to iterative approach 2020-10-31 18:52:00 +01:00
rustc_driver Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_error_codes Rollup merge of #78332 - PoignardAzur:doc_E0308, r=camelid 2020-10-27 08:44:54 +09:00
rustc_errors Some work 2020-10-30 20:02:14 -04:00
rustc_expand Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank 2020-11-03 19:32:36 +01:00
rustc_feature Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_fs_util Remove unused code from remaining compiler crates 2020-10-14 04:14:32 +02:00
rustc_graphviz Reuse memory 2020-10-28 17:22:10 +01:00
rustc_hir Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_hir_pretty Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_incremental Delete files immediately, instead of collecting into vector 2020-10-28 17:22:10 +01:00
rustc_index
rustc_infer Remove implicit Continue type 2020-10-30 12:27:47 +01:00
rustc_interface Rollup merge of #78610 - petrochenkov:nostriptok, r=Aaron1011 2020-11-02 14:14:34 +09:00
rustc_lexer Add back missing comments 2020-10-30 10:13:41 -04:00
rustc_lint Rollup merge of #78663 - Aaron1011:fix/cap-future-compat, r=tmandry 2020-11-03 15:27:16 +09:00
rustc_lint_defs Turn 'useless #[deprecated]' error into a lint. 2020-11-01 20:48:58 +01:00
rustc_llvm Rollup merge of #77950 - arlosi:sha256, r=eddyb 2020-11-03 19:32:26 +01:00
rustc_macros Remove implicit Continue type 2020-10-30 12:27:47 +01:00
rustc_metadata Auto merge of #78448 - rylev:cache-foreign_modules, r=wesleywiser 2020-11-03 04:27:27 +00:00
rustc_middle Auto merge of #78697 - JohnTitor:rollup-q0fchpv, r=JohnTitor 2020-11-03 06:56:46 +00:00
rustc_mir Auto merge of #78597 - RalfJung:raw-retag, r=oli-obk 2020-11-03 13:48:54 +00:00
rustc_mir_build Auto merge of #78553 - Nadrieril:fix-78549, r=varkor 2020-11-01 14:37:50 +00:00
rustc_parse parser: Cleanup LazyTokenStream and avoid some clones 2020-10-31 01:56:34 +03:00
rustc_parse_format
rustc_passes Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, r=estebank 2020-11-03 19:32:36 +01:00
rustc_plugin_impl
rustc_privacy Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obk 2020-10-30 22:53:55 +00:00
rustc_query_system Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_resolve Expand NtExpr tokens only in key-value attributes 2020-11-03 00:53:43 +03:00
rustc_save_analysis Rollup merge of #78349 - JohnTitor:issue-75962, r=davidtwco 2020-10-27 08:45:07 +09:00
rustc_serialize Replace absolute paths with relative ones 2020-10-13 14:16:45 +02:00
rustc_session Rollup merge of #77950 - arlosi:sha256, r=eddyb 2020-11-03 19:32:26 +01:00
rustc_span Rollup merge of #77950 - arlosi:sha256, r=eddyb 2020-11-03 19:32:26 +01:00
rustc_symbol_mangling Fix even more clippy warnings 2020-10-30 10:13:39 -04:00
rustc_target indicate calling convention 2020-11-02 23:29:00 +01:00
rustc_trait_selection Fix format 2020-11-02 16:59:11 +09:00
rustc_traits Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obk 2020-10-30 22:53:55 +00:00
rustc_ty Calculate visibilities once in resolve 2020-10-19 11:57:50 +03:00
rustc_typeck Add delay_span_bug to no longer ICE 2020-11-01 22:31:19 +00:00