Rollup merge of #142158 - xizheyin:141617, r=jdonszelmann

Tracking the old name of renamed unstable library features

This PR resolves the first problem of rust-lang/rust#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification.

r? `@jdonszelmann`
There have been a lot of PR's reviewed by you lately, thanks for your time!

cc `@jyn514`
This commit is contained in:
Matthias Krüger
2025-06-13 05:16:56 +02:00
committed by GitHub
20 changed files with 68 additions and 31 deletions

View File

@@ -298,6 +298,7 @@ pub(crate) fn parse_unstability<S: Stage>(
let mut issue_num = None;
let mut is_soft = false;
let mut implied_by = None;
let mut old_name = None;
for param in args.list()?.mixed() {
let Some(param) = param.meta_item() else {
cx.emit_err(session_diagnostics::UnsupportedLiteral {
@@ -345,11 +346,12 @@ pub(crate) fn parse_unstability<S: Stage>(
Some(sym::implied_by) => {
insert_value_into_option_or_error(cx, &param, &mut implied_by)?
}
Some(sym::old_name) => insert_value_into_option_or_error(cx, &param, &mut old_name)?,
_ => {
cx.emit_err(session_diagnostics::UnknownMetaItem {
span: param.span(),
item: param.path().to_string(),
expected: &["feature", "reason", "issue", "soft", "implied_by"],
expected: &["feature", "reason", "issue", "soft", "implied_by", "old_name"],
});
return None;
}
@@ -374,6 +376,7 @@ pub(crate) fn parse_unstability<S: Stage>(
issue: issue_num,
is_soft,
implied_by,
old_name,
};
Some((feature, level))
}