]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_resolve/lib.rs
clarify what the item is in "not a module" error
[rust.git] / src / librustc_resolve / lib.rs
index 5216156c0cab81d14b0ff2cbdfb40c28edc8cae9..ffc783ae9f235dd56eee44cadce2cbb94b4e5362 100644 (file)
@@ -3731,9 +3731,16 @@ fn resolve_path(
                             def, path.len() - i - 1
                         ));
                     } else {
+                        let label = format!(
+                            "`{}` is {} {}, not a module",
+                            ident,
+                            def.article(),
+                            def.kind_name(),
+                        );
+
                         return PathResult::Failed {
                             span: ident.span,
-                            label: format!("not a module `{}`", ident),
+                            label,
                             suggestion: None,
                             is_error_from_last_segment: is_last,
                         };