Repository: rust-lang/rust
File: compiler/rustc_query_impl/src/dep_kind_vtables.rs (Rust)

Code before:
        <Q::Cache as QueryCache>::Key::key_fingerprint_style()
    };

    // A query dep-node can only be forced or promoted if it can recover a key
    // from its key fingerprint.
    let can_recover = key_fingerprint_style.is_maybe_recoverable();
    if is_anon {
        assert!(!can_recover);
    }

    DepKindVTable {
        is_anon,
        is_eval_always,
        key_fingerprint_style,
        force_from_dep_node_fn: can_recover.then_some(force_from_dep_node_inner::<Q>),
        promote_from_disk_fn: (can_recover && is_cache_on_disk)
            .then_some(promote_from_disk_inner::<Q>),
    }
}

macro_rules! define_vtables {
    (
        queries {
            $(
                $(#[$attr:meta])*
                [$($modifiers:tt)*] fn $name:ident($K:ty) -> $V:ty,
            )*
        }
        non_queries {
            $(
                $(#[$nq_attr:meta])*
                $nq_name:ident,
            )*
        }
    ) => {{
        // The small number of non-query vtables: `Null`, `Red`, etc.
        let nq_vtables = [
            $(
                non_query::$nq_name(),
            )*
        ];

        // The large number of query vtables.
        let q_vtables: [DepKindVTable<'tcx>; _] = [
            $(
                $crate::dep_kind_vtables::make_dep_kind_vtable_for_query::<
                    $crate::query_impl::$name::VTableGetter,
                >(
                    is_anon!([$($modifiers)*]),
                    if_cache_on_disk!([$($modifiers)*] true false),
                    is_eval_always!([$($modifiers)*]),

Review comment (suggestion):
Nit: There should be a line break between modifiers and `fn`.

Code after:
        <Q::Cache as QueryCache>::Key::key_fingerprint_style()
    };

    // A query dep-node can only be forced or promoted if it can recover a key
    // from its key fingerprint.
    let can_recover = key_fingerprint_style.is_maybe_recoverable();
    if is_anon {
        assert!(!can_recover);
    }

    DepKindVTable {
        is_anon,
        is_eval_always,
        key_fingerprint_style,
        force_from_dep_node_fn: can_recover.then_some(force_from_dep_node_inner::<Q>),
        promote_from_disk_fn: (can_recover && is_cache_on_disk)
            .then_some(promote_from_disk_inner::<Q>),
    }
}

macro_rules! define_dep_kind_vtables {
    (
        queries {
            $(
                $(#[$attr:meta])*
                [$($modifiers:tt)*]
                fn $name:ident($K:ty) -> $V:ty,
            )*
        }
        non_queries {
            $(
                $(#[$nq_attr:meta])*
                $nq_name:ident,
            )*
        }
    ) => {{
        // The small number of non-query vtables: `Null`, `Red`, etc.
        let nq_vtables = [
            $(
                non_query::$nq_name(),
            )*
        ];

        // The large number of query vtables.
        let q_vtables: [DepKindVTable<'tcx>; _] = [
            $(
                $crate::dep_kind_vtables::make_dep_kind_vtable_for_query::<
                    $crate::query_impl::$name::VTableGetter,
                >(
                    is_anon!([$($modifiers)*]),
                    if_cache_on_disk!([$($modifiers)*] true false),