Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lower/path.rs')
| -rw-r--r-- | crates/hir-ty/src/lower/path.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/hir-ty/src/lower/path.rs b/crates/hir-ty/src/lower/path.rs index 08917d70b6..cc3e630ee9 100644 --- a/crates/hir-ty/src/lower/path.rs +++ b/crates/hir-ty/src/lower/path.rs @@ -10,7 +10,7 @@ use hir_def::{ expr_store::HygieneId, generics::{TypeParamProvenance, WherePredicate, WherePredicateTypeTarget}, path::{GenericArg, GenericArgs, GenericArgsParentheses, Path, PathSegment, PathSegments}, - resolver::{ModuleOrTypeNs, ResolveValueResult, TypeNs, ValueNs}, + resolver::{ResolveValueResult, TypeNs, ValueNs}, type_ref::{TypeBound, TypeRef, TypesMap}, }; use smallvec::SmallVec; @@ -285,7 +285,9 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> { TypeNs::BuiltinType(it) => self.lower_path_inner(it.into(), infer_args), TypeNs::TypeAliasId(it) => self.lower_path_inner(it.into(), infer_args), // FIXME: report error - TypeNs::EnumVariantId(_) => return (TyKind::Error.intern(Interner), None), + TypeNs::EnumVariantId(_) | TypeNs::ModuleId(_) => { + return (TyKind::Error.intern(Interner), None); + } }; self.skip_resolved_segment(); @@ -316,6 +318,9 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> { TypeNs::BuiltinType(_) => { prohibit_generics_on_resolved(GenericArgsProhibitedReason::PrimitiveTy) } + TypeNs::ModuleId(_) => { + prohibit_generics_on_resolved(GenericArgsProhibitedReason::Module) + } TypeNs::AdtId(_) | TypeNs::EnumVariantId(_) | TypeNs::TypeAliasId(_) @@ -338,10 +343,6 @@ impl<'a, 'b> PathLoweringContext<'a, 'b> { .resolver .resolve_path_in_type_ns_with_prefix_info(self.ctx.db.upcast(), self.path)?; - let ModuleOrTypeNs::TypeNs(resolution) = resolution else { - return None; - }; - let segments = self.segments; if segments.is_empty() || matches!(self.path, Path::LangItem(..)) { // `segments.is_empty()` can occur with `self`. |