diff options
| author | bors <bors@rust-lang.org> | 2025-03-21 17:55:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-21 17:55:41 +0000 |
| commit | be73c1f4617c97bce81b2694a767353300a75072 (patch) | |
| tree | a4ea855c8e74da2d800321298c45e48d3e8198f2 /compiler/rustc_attr_data_structures | |
| parent | a4a11aca5ecf24dfff3c00715641026809951305 (diff) | |
| parent | bc46c98dd81dc6c0a2c24c701dfd28d7b2c41260 (diff) | |
Auto merge of #138791 - matthiaskrgr:rollup-ev46cqr, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #138364 (ports the compiler test cases to new rust_intrinsic format) - #138570 (add `naked_functions_target_feature` unstable feature) - #138623 ([bootstrap] Use llvm_runtimes for compiler-rt) - #138627 (Autodiff cleanups) - #138669 (tests: accept some noise from LLVM 21 in symbols-all-mangled) - #138706 (Improve bootstrap git modified path handling) - #138709 (Update GCC submodule) - #138717 (Add an attribute that makes the spans from a macro edition 2021, and fix pin on edition 2024 with it) - #138721 (Use explicit cpu in some asm and codegen tests.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_attr_data_structures')
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/attributes.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/lib.rs | 11 |
2 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index d2d1285b075..969bce7ae20 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -191,6 +191,7 @@ pub enum AttributeKind { }, MacroTransparency(Transparency), Repr(ThinVec<(ReprAttr, Span)>), + RustcMacroEdition2021, Stability { stability: Stability, /// Span of the `#[stable(...)]` or `#[unstable(...)]` attribute diff --git a/compiler/rustc_attr_data_structures/src/lib.rs b/compiler/rustc_attr_data_structures/src/lib.rs index bbd3308809c..c61b44b273d 100644 --- a/compiler/rustc_attr_data_structures/src/lib.rs +++ b/compiler/rustc_attr_data_structures/src/lib.rs @@ -182,21 +182,18 @@ macro_rules! find_attr { }}; ($attributes_list: expr, $pattern: pat $(if $guard: expr)? => $e: expr) => {{ - fn check_attribute_iterator<'a>(_: &'_ impl IntoIterator<Item = &'a rustc_hir::Attribute>) {} - check_attribute_iterator(&$attributes_list); - - let find_attribute = |iter| { + 'done: { for i in $attributes_list { + let i: &rustc_hir::Attribute = i; match i { rustc_hir::Attribute::Parsed($pattern) $(if $guard)? => { - return Some($e); + break 'done Some($e); } _ => {} } } None - }; - find_attribute($attributes_list) + } }}; } |
