Skip to content

Commit e3268bc

Browse files
committed
Auto merge of #153042 - JonathanBrouwer:rollup-CUdtmWm, r=<try>
Rollup of 9 pull requests try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1
2 parents 0028f34 + 3382fdd commit e3268bc

File tree

94 files changed

+2620
-2906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2620
-2906
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3548,6 +3548,7 @@ dependencies = [
35483548
"rustc_lexer",
35493549
"rustc_macros",
35503550
"rustc_parse",
3551+
"rustc_parse_format",
35513552
"rustc_session",
35523553
"rustc_span",
35533554
"rustc_target",
@@ -4682,7 +4683,6 @@ dependencies = [
46824683
"rustc_macros",
46834684
"rustc_middle",
46844685
"rustc_next_trait_solver",
4685-
"rustc_parse_format",
46864686
"rustc_session",
46874687
"rustc_span",
46884688
"rustc_transmute",

compiler/rustc_attr_parsing/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rustc_hir = { path = "../rustc_hir" }
1515
rustc_lexer = { path = "../rustc_lexer" }
1616
rustc_macros = { path = "../rustc_macros" }
1717
rustc_parse = { path = "../rustc_parse" }
18+
rustc_parse_format = { path = "../rustc_parse_format" }
1819
rustc_session = { path = "../rustc_session" }
1920
rustc_span = { path = "../rustc_span" }
2021
rustc_target = { path = "../rustc_target" }

compiler/rustc_attr_parsing/src/attributes/crate_level.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,50 @@ impl<S: Stage> CombineAttributeParser<S> for FeatureParser {
347347
res
348348
}
349349
}
350+
351+
pub(crate) struct RegisterToolParser;
352+
353+
impl<S: Stage> CombineAttributeParser<S> for RegisterToolParser {
354+
const PATH: &[Symbol] = &[sym::register_tool];
355+
type Item = Ident;
356+
const CONVERT: ConvertFn<Self::Item> = AttributeKind::RegisterTool;
357+
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);
358+
const TEMPLATE: AttributeTemplate = template!(List: &["tool1, tool2, ..."]);
359+
360+
fn extend(
361+
cx: &mut AcceptContext<'_, '_, S>,
362+
args: &ArgParser,
363+
) -> impl IntoIterator<Item = Self::Item> {
364+
let ArgParser::List(list) = args else {
365+
cx.expected_list(cx.attr_span, args);
366+
return Vec::new();
367+
};
368+
369+
if list.is_empty() {
370+
cx.warn_empty_attribute(cx.attr_span);
371+
}
372+
373+
let mut res = Vec::new();
374+
375+
for elem in list.mixed() {
376+
let Some(elem) = elem.meta_item() else {
377+
cx.expected_identifier(elem.span());
378+
continue;
379+
};
380+
if let Err(arg_span) = elem.args().no_args() {
381+
cx.expected_no_args(arg_span);
382+
continue;
383+
}
384+
385+
let path = elem.path();
386+
let Some(ident) = path.word() else {
387+
cx.expected_identifier(path.span());
388+
continue;
389+
};
390+
391+
res.push(ident);
392+
}
393+
394+
res
395+
}
396+
}

compiler/rustc_attr_parsing/src/attributes/do_not_recommend.rs renamed to compiler/rustc_attr_parsing/src/attributes/diagnostic/do_not_recommend.rs

File renamed without changes.

0 commit comments

Comments
 (0)