Skip to content

Commit fc07cb1

Browse files
Rollup merge of rust-lang#151046 - semiopaque-eii-fix, r=jdonszelmann
compiler: Make Externally Implementable Item (eii) macros "semiopaque" Otherwise eiis defined by std will produce large amounts of `missing stability attribute` errors. This problem is not eii specific, as can be seen in rust-lang#146993 and which is demonstrated in rust-lang#151022. As can be seen with ```console $ git grep rustc_macro_transparency compiler/rustc_arena/src/lib.rs:#[rustc_macro_transparency = "semiopaque"] [...] ``` it is very common for macros to use `"semiopaque"`. r? @jdonszelmann Tracking issue: rust-lang#125418 Needed for: rust-lang#150588
2 parents 185d044 + 8a8b31a commit fc07cb1

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_builtin_macros/src

1 file changed

+3
-0
lines changed

compiler/rustc_builtin_macros/src/eii.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ fn generate_attribute_macro_to_implement(
335335
// errors for eii's in std.
336336
macro_attrs.extend_from_slice(attrs_from_decl);
337337

338+
// Avoid "missing stability attribute" errors for eiis in std. See #146993.
339+
macro_attrs.push(ecx.attr_name_value_str(sym::rustc_macro_transparency, sym::semiopaque, span));
340+
338341
// #[builtin_macro(eii_shared_macro)]
339342
macro_attrs.push(ecx.attr_nested_word(sym::rustc_builtin_macro, sym::eii_shared_macro, span));
340343

0 commit comments

Comments
 (0)