New deprecated_suggestion
feature, use in tests
This commit is contained in:
parent
6efc8e34d8
commit
5636655d0f
10 changed files with 40 additions and 8 deletions
|
@ -741,7 +741,19 @@ where
|
|||
continue 'outer;
|
||||
}
|
||||
}
|
||||
sym::suggestion if attr.has_name(sym::rustc_deprecated) => {
|
||||
sym::suggestion => {
|
||||
if !sess.features_untracked().deprecated_suggestion {
|
||||
let mut diag = sess.struct_span_err(
|
||||
mi.span,
|
||||
"suggestions on deprecated items are unstable",
|
||||
);
|
||||
if sess.is_nightly_build() {
|
||||
diag.help("add `#![feature(deprecated_suggestion)]` to the crate root");
|
||||
}
|
||||
// FIXME(jhpratt) change this to an actual tracking issue
|
||||
diag.note("see #XXX for more details").emit();
|
||||
}
|
||||
|
||||
if !get(mi, &mut suggestion) {
|
||||
continue 'outer;
|
||||
}
|
||||
|
@ -778,10 +790,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
if suggestion.is_some() && attr.has_name(sym::deprecated) {
|
||||
unreachable!("only allowed on rustc_deprecated")
|
||||
}
|
||||
|
||||
if attr.has_name(sym::rustc_deprecated) {
|
||||
if since.is_none() {
|
||||
handle_errors(&sess.parse_sess, attr.span, AttrError::MissingSince);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue