diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2022-02-15 02:00:21 -0500 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2022-03-04 18:15:49 -0500 |
| commit | 6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8 (patch) | |
| tree | 3584fabe76f9318369a15ea1e88dc057c4a345b7 /compiler/rustc_attr/src | |
| parent | 9fcbc32053d5084d1de79bd484de82474cdae427 (diff) | |
| download | rust-6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8.tar.gz rust-6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8.zip | |
Change `rustc_deprecated` to use `note`
This keeps `reason` around for the time being. This is necessary to avoid breakage during the bootstrap process. This change, as a whole, brings `#[rustc_deprecated]` more in line with `#[deprecated]`.
Diffstat (limited to 'compiler/rustc_attr/src')
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 846abce9d6a..e965cc4f385 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -729,11 +729,13 @@ where continue 'outer; } } - sym::note if attr.has_name(sym::deprecated) => { + sym::note => { if !get(mi, &mut note) { continue 'outer; } } + // FIXME(jhpratt) remove this after a bootstrap occurs. Emitting an + // error specific to the renaming would be a good idea as well. sym::reason if attr.has_name(sym::rustc_deprecated) => { if !get(mi, &mut note) { continue 'outer; @@ -753,7 +755,7 @@ where if attr.has_name(sym::deprecated) { &["since", "note"] } else { - &["since", "reason", "suggestion"] + &["since", "note", "suggestion"] }, ), ); @@ -787,7 +789,7 @@ where } if note.is_none() { - struct_span_err!(diagnostic, attr.span, E0543, "missing 'reason'").emit(); + struct_span_err!(diagnostic, attr.span, E0543, "missing 'note'").emit(); continue; } } |
