about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-01-15 21:17:36 +0100
committerGitHub <noreply@github.com>2023-01-15 21:17:36 +0100
commitfc78b1e7f9e2823a99919e452d0e7635f4e049e0 (patch)
treef0bb25d23f8dc4fb0375e6e2b264c5618a752e0a /compiler
parent8bd67dd12d9a7e41c9b7ddca431caa3c589689da (diff)
parent566202b97511b27e66312f67faacffb7272d7dbb (diff)
downloadrust-fc78b1e7f9e2823a99919e452d0e7635f4e049e0.tar.gz
rust-fc78b1e7f9e2823a99919e452d0e7635f4e049e0.zip
Rollup merge of #106909 - compiler-errors:only-types-can-be, r=estebank
Only suggest adding type param if path being resolved was a type
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_resolve/src/late.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index ca43762aa21..6ca7cd3e713 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -3373,7 +3373,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                         sugg.to_string(),
                         Applicability::MaybeIncorrect,
                     ))
-                } else if res.is_none() {
+                } else if res.is_none() && matches!(source, PathSource::Type) {
                     this.report_missing_type_error(path)
                 } else {
                     None