Skip to content

Commit 8d5accb

Browse files
authored
Unrolled build for rust-lang#138993
Rollup merge of rust-lang#138993 - CAD97:cfg_match_semitransparent, r=dtolnay Make `cfg_match!` a semitransparent macro IIUC this is preferred when (potentially) stabilizing `macro` items, to avoid potentially utilizing def-site hygiene instead of mixed-site. Tracking issue: rust-lang#115585
2 parents f06e5c1 + 2c70c8a commit 8d5accb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/core/src/macros/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,10 @@ pub macro assert_matches {
237237
/// ```
238238
#[unstable(feature = "cfg_match", issue = "115585")]
239239
#[rustc_diagnostic_item = "cfg_match"]
240+
#[rustc_macro_transparency = "semitransparent"]
240241
pub macro cfg_match {
241242
({ $($tt:tt)* }) => {{
242-
cfg_match! { $($tt)* }
243+
$crate::cfg_match! { $($tt)* }
243244
}},
244245
(_ => { $($output:tt)* }) => {
245246
$($output)*
@@ -249,10 +250,10 @@ pub macro cfg_match {
249250
$($( $rest:tt )+)?
250251
) => {
251252
#[cfg($cfg)]
252-
cfg_match! { _ => $output }
253+
$crate::cfg_match! { _ => $output }
253254
$(
254255
#[cfg(not($cfg))]
255-
cfg_match! { $($rest)+ }
256+
$crate::cfg_match! { $($rest)+ }
256257
)?
257258
},
258259
}

0 commit comments

Comments
 (0)