Skip to content

fresh binding should shadow the def in expand #143141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Jun 28, 2025

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 28, 2025
@petrochenkov
Copy link
Contributor

I don't understand why this works and how it fixes the issue.
The LookAheadMacroDefinition are inserted for all macro definitions, regardless of whether it's macro or macro_rules, and nothing is done for use items.
The reversed rib walk in fn apply_pattern_bindings can also encounter arbitrary ribs before encountering a LookAheadMacroDefinition.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 30, 2025
@petrochenkov
Copy link
Contributor

Also "shallow" -> "shadow" in the PR/commit messages and file names.

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Jul 1, 2025

The reversed rib walk in fn apply_pattern_bindings can also encounter arbitrary ribs before encountering a LookAheadMacroDefinition.

There may be a bug if LookAheadMacroDefinition fails to apply correctly.

I don't understand why this works and how it fixes the issue.

LookAheadMacroDefinition stores the macro expansion result and serves as a fallback in resolve_ident_in_lexical_scope, ensuring it takes the correct resolution path:

// The ident resolves to a type parameter or local variable.
return Some(LexicalScopeBinding::Res(self.validate_res_from_ribs(
i,
rib_ident,
*res,
finalize.map(|finalize| finalize.path_span),
*original_rib_ident_def,
ribs,
)));

@bvanjoi bvanjoi changed the title fresh binding should shallow the def after expand fresh binding should shadow the def in expand Jul 1, 2025
@bvanjoi
Copy link
Contributor Author

bvanjoi commented Jul 1, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 1, 2025
@petrochenkov
Copy link
Contributor

@bvanjoi
Are you sure this cannot successfully resolve some names that should not be resolved?
(I started reviewing yesterday, but it was late so I'll finish today or on Monday.)

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Jul 12, 2025

Are you sure this cannot successfully resolve some names that should not be resolved?

I need to test this with additional cases across different rib contexts. @rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2025
@rust-log-analyzer

This comment has been minimized.

}
LookaheadItemInBlock::MacroDef { bindings: macro_bindings, .. } => {
let bindings =
bindings.last().unwrap().1.iter().filter_map(|(name, res)| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bindings.last().unwrap().1.iter().filter_map(|(name, res)| {
bindings.last().unwrap().1.iter().copied().filter(|(name, _)| !need_removed.contains(name))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use copied().filter here because bindings.last().unwrap().1.iter() yields elements of type (&_, &_) rather than the required &_.


if let Some(last_pat_id) = last_pat_id
&& let RibKind::Block { id: block, .. } = self.ribs[ValueNS].last_mut().unwrap().kind
&& let Some(items) = self.r.lookahead_items_in_block.get_mut(&block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in

let a = 0;
{
  let b = 1;
  macro_rules! m { ... }
}

only b will be added to LookaheadItemInBlock::MacroDef bindings for m, but not a.

Is this ok?
If yes, why is this ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the latest patch: I've made the binding store into the macro definitions site for each child block.

let a0: BindingF = m!(); //~ NOTE in this expansion of m!
let f = || -> BindingF { 42 };
let a1: BindingF = m!();
macro m() { f() } //~ ERROR cannot find function `f` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f can be found at m's definition site, we should report a different error in this case, like "f is not yet alive at point of use" or something.

@petrochenkov
Copy link
Contributor

Could you also add a test case demonstrating what happens with this example?

fn f() {
    let a = 10;
    
    #[macro_export]
    macro_rules! m { () => { a } }
}

fn main() {
    fn a() {}

    crate::m!();
}

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2025
@bors
Copy link
Collaborator

bors commented Aug 8, 2025

☔ The latest upstream changes (presumably #145077) made this pull request unmergeable. Please resolve the merge conflicts.

Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 14, 2025
resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses rust-lang#143141 (comment) and rust-lang#143141 (comment).

A couple of related cleanups are also added on top.
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 15, 2025
resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses rust-lang#143141 (comment) and rust-lang#143141 (comment).

A couple of related cleanups are also added on top.
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 15, 2025
resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses rust-lang#143141 (comment) and rust-lang#143141 (comment).

A couple of related cleanups are also added on top.
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 15, 2025
resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses rust-lang#143141 (comment) and rust-lang#143141 (comment).

A couple of related cleanups are also added on top.
rust-timer added a commit that referenced this pull request Aug 15, 2025
Rollup merge of #145065 - petrochenkov:riblock, r=davidtwco

resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses #143141 (comment) and #143141 (comment).

A couple of related cleanups are also added on top.
@bvanjoi
Copy link
Contributor Author

bvanjoi commented Aug 16, 2025

Could you also add a test case demonstrating what happens with this example?

This refers to the fn a in the main block. I think this case should throw an error like a is not accessible in this block scope, correct?

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Aug 16, 2025

Additionally, what would be the expected behavior for this particular case?

fn f_with_macro_export() {
    let d = 10;

    {
        #[macro_export]
        macro_rules! m {
            () => {
               d 
            };
        }
        use crate::m;
        m!(); // compile success
    }

    use crate::m;
    m!(); // Should this case compile successfully? Note that it currently throws a 'not found' error in the master branch
}

@petrochenkov
Copy link
Contributor

petrochenkov commented Aug 16, 2025

Could you also add a test case demonstrating what happens with this example?

This refers to the fn a in the main block. I think this case should throw an error like a is not accessible in this block scope, correct?

Yes, some error like that.
Technically it should do that even if m is exported from a different crate, but implementing that would have a really bad cost/benefit ratio.

@petrochenkov
Copy link
Contributor

petrochenkov commented Aug 16, 2025

Additionally, what would be the expected behavior for this particular case?

I'd expect it to be ok, d is in scope at m's definition site (and alive at point of use).

@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2025

This PR was rebased onto a different master commit! Check out the changes with our range-diff.

@rustbot
Copy link
Collaborator

rustbot commented Aug 17, 2025

This PR was rebased onto a different master commit! Check out the changes with our range-diff.

@rust-log-analyzer

This comment has been minimized.

github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Aug 18, 2025
resolve: Introduce `RibKind::Block`

to avoid confusing module items, blocks with items, and blocks without items.

Addresses rust-lang/rust#143141 (comment) and rust-lang/rust#143141 (comment).

A couple of related cleanups are also added on top.
@bors
Copy link
Collaborator

bors commented Aug 23, 2025

☔ The latest upstream changes (presumably #145773) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Aug 24, 2025

Technically it should do that even if m is exported from a different crate

These changes have wide-ranging implications. Could you please review whether the modifications in tests/ui/hygiene/{legacy_interaction, wrap_unhygienic_example}.rs produce the expected behavior?

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1274 |   macro_rules! debug {
     |   ------------------ in this expansion of `debug!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/linked_graph/mod.rs:152:9
     |
 152 |           debug!("graph: add_edge({:?}, {:?}, {:?})", source, target, data);
     |           ----------------------------------------------------------------- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1274 |   macro_rules! debug {
     |   ------------------ in this expansion of `debug!` (#1)
---
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:214:9
     |
 214 | /         debug!(
 215 | |             "create_scc({:?}) successors={:?}",
 216 | |             self.len(),
 217 | |             &self.all_successors[all_successors_start..all_successors_end],
 218 | |         );
     | |_________- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:410:17
     |
 410 |                   trace!("find_state(r = {node:?} in state {:?})", self.node_states[node]);
     |                   ------------------------------------------------------------------------ in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:484:13
     |
 484 |               trace!("Compressing {node:?} down to {previous_node:?} with state {assigned_state:?}");
     |               -------------------------------------------------------------------------------------- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
  20 |   macro_rules! span {
     |   ----------------- in this expansion of `::tracing::span!` (#2)
...
  58 |               static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  __________________________________________________________________-
  59 | |                 name: $name,
  60 | |                 kind: $crate::metadata::Kind::SPAN,
  61 | |                 target: $target,
  62 | |                 level: $lvl,
  63 | |                 fields: $($fields)*
  64 | |             };
     | |_____________- in this macro invocation (#3)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:509:5
     |
 509 |       #[instrument(skip(self, initial), level = "trace")]
     |       ---------------------------------------------------
     |       |
     |       in this attribute macro expansion (#1)
     |       in this macro invocation (#2)
     |
---
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:511:9
     |
 511 |           trace!("Walk unvisited node: {initial:?}");
     |           ------------------------------------------ in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:558:13
     |
 558 | /             trace!(
 559 | |                 "Visiting {node:?} at depth {depth:?}, annotation: {current_component_annotation:?}"
 560 | |             );
     | |_____________- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:566:21
     |
 566 |                       trace!(?depth, ?node);
     |                       --------------------- in this macro invocation (#1)

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2224:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
...
2224 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:566:21
     |
 566 |                       trace!(?depth, ?node);
     |                       --------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2262:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
     |   in this expansion of `$crate::valueset!` (#5)
...
2223 | /         $crate::valueset!(
2224 | |             @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
2225 | |             $next,
2226 | |             $($rest)*
2227 | |         )
     | |_________- in this macro invocation (#5)
...
2262 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:566:21
     |
 566 |                       trace!(?depth, ?node);
     |                       --------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:596:17
     |
 596 |                   trace!(?node, ?successor_node);
     |                   ------------------------------ in this macro invocation (#1)

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2224:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
...
2224 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:596:17
     |
 596 |                   trace!(?node, ?successor_node);
     |                   ------------------------------ in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2262:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
     |   in this expansion of `$crate::valueset!` (#5)
...
2223 | /         $crate::valueset!(
2224 | |             @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
2225 | |             $next,
2226 | |             $($rest)*
2227 | |         )
     | |_________- in this macro invocation (#5)
...
2262 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:596:17
     |
 596 |                   trace!(?node, ?successor_node);
     |                   ------------------------------ in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0425]: cannot find value `CALLSITE` in this scope
---
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:607:25
     |
 607 | /                         trace!(
 608 | |                             "Cycle found from {node:?}, minimum depth: {successor_min_depth:?}, annotation: {successor_annotation:?}"
 609 | |                         );
     | |_________________________- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:613:29
     |
 613 |   ...                   trace!(?node, ?successor_min_depth);
     |                         ----------------------------------- in this macro invocation (#1)

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2224:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
...
2224 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:613:29
     |
 613 |   ...                   trace!(?node, ?successor_min_depth);
     |                         ----------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2262:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
     |   in this expansion of `$crate::valueset!` (#5)
...
2223 | /         $crate::valueset!(
2224 | |             @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
2225 | |             $next,
2226 | |             $($rest)*
2227 | |         )
     | |_________- in this macro invocation (#5)
...
2262 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:613:29
     |
 613 |   ...                   trace!(?node, ?successor_min_depth);
     |                         ----------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0425]: cannot find value `CALLSITE` in this scope
---
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:625:25
     |
 625 | / ...   trace!(
 626 | | ...       "Complete; {node:?} is root of complete-visited SCC idx {successor_scc_index:?} with annotation {successor_annotation:?}"
 627 | | ...   );
     | |_______- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:630:25
     |
 630 |                           trace!(?node, ?successor_scc_index);
     |                           ----------------------------------- in this macro invocation (#1)

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2224:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
...
2224 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:630:25
     |
 630 |                           trace!(?node, ?successor_scc_index);
     |                           ----------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2262:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
     |   in this expansion of `$crate::valueset!` (#5)
...
2223 | /         $crate::valueset!(
2224 | |             @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
2225 | |             $next,
2226 | |             $($rest)*
2227 | |         )
     | |_________- in this macro invocation (#5)
...
2262 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:630:25
     |
 630 |                           trace!(?node, ?successor_scc_index);
     |                           ----------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0425]: cannot find value `CALLSITE` in this scope
---
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:637:25
     |
 637 |                           trace!("Recursing down into {successor_node:?} at depth {depth:?}");
     |                           ------------------------------------------------------------------- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2123 |   macro_rules! callsite2 {
     |   ---------------------- in this expansion of `$crate::callsite2!` (#3)
...
2160 |                   callsite: &CALLSITE,
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:638:25
     |
 638 |                           trace!(?depth, ?successor_node);
     |                           ------------------------------- in this macro invocation (#1)

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2224:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
...
2224 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:638:25
     |
 638 |                           trace!(?depth, ?successor_node);
     |                           ------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0423]: expected function, found macro `debug`
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2262:43
     |
 584 |   macro_rules! event {
     |   ------------------ in this expansion of `$crate::event!` (#2)
...
 673 |               })($crate::valueset!(CALLSITE.metadata().fields(), $($fields)*));
     |                  ------------------------------------------------------------ in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
...
1207 | /         $crate::event!(
1208 | |             target: module_path!(),
1209 | |             $crate::Level::TRACE,
1210 | |             { ?$($k).+, $($field)*}
1211 | |         )
     | |_________- in this macro invocation (#2)
...
2180 |   macro_rules! valueset {
     |   ---------------------
     |   |
     |   in this expansion of `$crate::valueset!` (#3)
     |   in this expansion of `$crate::valueset!` (#4)
     |   in this expansion of `$crate::valueset!` (#5)
...
2223 | /         $crate::valueset!(
2224 | |             @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
2225 | |             $next,
2226 | |             $($rest)*
2227 | |         )
     | |_________- in this macro invocation (#5)
...
2262 |               @ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
     |                                             ^^^^^ not a function
...
2325 |               $fields.value_set($crate::valueset!(
     |  _______________________________-
2326 | |                 @ { },
2327 | |                 iter.next().expect("FieldSet corrupted (this is a bug)"),
2328 | |                 $($kvs)+
2329 | |             ))
     | |_____________- in this macro invocation (#4)
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:638:25
     |
 638 |                           trace!(?depth, ?successor_node);
     |                           ------------------------------- in this macro invocation (#1)
     |
help: consider importing this function instead
    -->  compiler/rustc_data_structures/src/graph/scc/mod.rs:11:1
     |
  11 + use tracing::field::debug;
     |

error[E0425]: cannot find value `CALLSITE` in this scope
---
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1087 |   macro_rules! trace {
     |   ------------------ in this expansion of `trace!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:657:13
     |
 657 |               trace!("Finished walk from {node:?} with annotation: {current_component_annotation:?}");
     |               --------------------------------------------------------------------------------------- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1274 |   macro_rules! debug {
     |   ------------------ in this expansion of `debug!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/graph/scc/mod.rs:687:17
     |
 687 |                   debug!("Creating SCC rooted in {node:?} with successor {:?}", frame.successor_node);
     |                   ----------------------------------------------------------------------------------- in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1274 |   macro_rules! debug {
     |   ------------------ in this expansion of `debug!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/obligation_forest/mod.rs:350:13
     |
 350 |               debug!("register_obligation_at: ignoring already done obligation: {:?}", obligation);
     |               ------------------------------------------------------------------------------------ in this macro invocation (#1)

error[E0425]: cannot find value `CALLSITE` in this scope
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tracing-0.1.37/src/macros.rs:2160:28
     |
 584 |   macro_rules! event {
     |   ------------------
     |   |
     |   in this expansion of `$crate::event!` (#2)
     |   in this expansion of `$crate::event!` (#3)
...
 644 |           static CALLSITE: $crate::callsite::DefaultCallsite = $crate::callsite2! {
     |  ______________________________________________________________-
 645 | |             name: $crate::__macro_support::concat!(
 646 | |                 "event ",
 647 | |                 file!(),
...    |
 654 | |             fields: $($fields)*
 655 | |         };
     | |_________- in this macro invocation (#4)
...
 683 | /         $crate::event!(
 684 | |             target: $target,
 685 | |             $lvl,
 686 | |             { message = format_args!($($arg)+), $($fields)* }
 687 | |         )
     | |_________- in this macro invocation (#3)
...
1691 |   macro_rules! warn {
     |   ----------------- in this expansion of `warn!` (#1)
---
     |                              ^^^^^^^^ not found in this scope
     |
    ::: compiler/rustc_data_structures/src/profiling.rs:666:17
     |
 666 | /                 warn!(
 667 | |                     "Unknown self-profiler events specified: {}. Available options are: {}.",
 668 | |                     unknown_events.join(", "),
 669 | |                     EVENT_FILTERS_BY_NAME
...    |
 673 | |                         .join(", ")
 674 | |                 );
     | |_________________- in this macro invocation (#1)

[RUSTC-TIMING] writeable test:false 0.948
[RUSTC-TIMING] ppv_lite86 test:false 0.482

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Aug 24, 2025

Reduce for #143141 (comment)

macro_rules! m2 {
    () => {{
        static B: i32 = S;
        42
    }};
}

macro_rules! m {
    () => {
        static S: i32 = m2!();
    };
}

fn main() {
    m!();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hygiene of used macro item is weird.
5 participants