Skip to content

Commit 859951e

Browse files
committed
Auto merge of #153047 - JonathanBrouwer:rollup-l4iF4ru, r=JonathanBrouwer
Rollup of 15 pull requests Successful merges: - #152176 (Neon fast path for str::contains) - #152657 (std: move `exit` out of PAL) - #152841 (Streamline `QueryVTableUnerased` into `GetQueryVTable`) - #152845 (Skip `tidy` in PR CI jobs not dedicated to running `tidy`) - #152897 (Add optional json logging) - #153009 (Remove `rustc_feedable_queries` and `define_feedable` macros.) - #151558 (Port diagnostic attributes) - #152492 (mGCA: Enforce WF element types for array valtrees) - #152888 (Fix async drop glue MIR bug) - #152988 (Port `#[register_tool]` to the new attribute system) - #153018 (`unused_must_use` lint improvements) - #153023 (Update books) - #153033 (Clarify how "ensure" queries check whether they can skip execution) - #153043 (fix error on missing value for -C flags) - #153045 (rustc-dev-guide subtree update) Failed merges: - #153032 (Fix attribute parser and kind names.)
2 parents 0028f34 + b1a17e0 commit 859951e

151 files changed

Lines changed: 4431 additions & 4157 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 14 additions & 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",
@@ -5751,6 +5751,16 @@ dependencies = [
57515751
"tracing-core",
57525752
]
57535753

5754+
[[package]]
5755+
name = "tracing-serde"
5756+
version = "0.2.0"
5757+
source = "registry+https://github.com/rust-lang/crates.io-index"
5758+
checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
5759+
dependencies = [
5760+
"serde",
5761+
"tracing-core",
5762+
]
5763+
57545764
[[package]]
57555765
name = "tracing-subscriber"
57565766
version = "0.3.20"
@@ -5762,12 +5772,15 @@ dependencies = [
57625772
"once_cell",
57635773
"parking_lot",
57645774
"regex-automata",
5775+
"serde",
5776+
"serde_json",
57655777
"sharded-slab",
57665778
"smallvec",
57675779
"thread_local",
57685780
"tracing",
57695781
"tracing-core",
57705782
"tracing-log",
5783+
"tracing-serde",
57715784
]
57725785

57735786
[[package]]

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)