From 8baab4cdf77979aed3ed7a5617df651c3e933405 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Wed, 11 Jun 2025 17:05:01 +0000 Subject: Detect missing `derive` on unresolved attribute even when not imported ``` error: cannot find attribute `sede` in this scope --> $DIR/missing-derive-3.rs:20:7 | LL | #[sede(untagged)] | ^^^^ | help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute | LL | #[serde(untagged)] | + error: cannot find attribute `serde` in this scope --> $DIR/missing-derive-3.rs:14:7 | LL | #[serde(untagged)] | ^^^^^ | note: `serde` is imported here, but it is a crate, not an attribute --> $DIR/missing-derive-3.rs:4:1 | LL | extern crate serde; | ^^^^^^^^^^^^^^^^^^^ help: `serde` is an attribute that can be used by the derive macros `Deserialize` and `Serialize`, you might be missing a `derive` attribute | LL + #[derive(Deserialize, Serialize)] LL | enum B { | ``` --- compiler/rustc_resolve/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_resolve/src/lib.rs') diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index ca9c124fca6..c0a46e3b16b 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1267,6 +1267,10 @@ pub struct Resolver<'ra, 'tcx> { mods_with_parse_errors: FxHashSet, + /// Whether `Resolver::register_macros_for_all_crates` has been called once already, as we + /// don't need to run it more than once. + all_crate_macros_already_registered: bool = false, + // Stores pre-expansion and pre-placeholder-fragment-insertion names for `impl Trait` types // that were encountered during resolution. These names are used to generate item names // for APITs, so we don't want to leak details of resolution into these names. -- cgit 1.4.1-3-g733a5 From 9878616a3d66872cb9a358873992cc81efbd1578 Mon Sep 17 00:00:00 2001 From: bohan Date: Sun, 17 Aug 2025 22:37:42 +0800 Subject: resolve: debug for block module --- compiler/rustc_resolve/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_resolve/src/lib.rs') diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index ca9c124fca6..04ff76e6bd6 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -781,7 +781,10 @@ impl<'ra> std::ops::Deref for Module<'ra> { impl<'ra> fmt::Debug for Module<'ra> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:?}", self.res()) + match self.kind { + ModuleKind::Block => write!(f, "block"), + ModuleKind::Def(..) => write!(f, "{:?}", self.res()), + } } } -- cgit 1.4.1-3-g733a5