|
5 | 5 | //! - Building the type for an item: This happens through the `ty` query. |
6 | 6 | //! |
7 | 7 | //! This usually involves resolving names, collecting generic arguments etc. |
| 8 | +pub(crate) mod diagnostics; |
| 9 | + |
8 | 10 | use std::{ |
9 | 11 | cell::OnceCell, |
10 | 12 | iter, mem, |
@@ -59,6 +61,7 @@ use crate::{ |
59 | 61 | db::HirDatabase, |
60 | 62 | error_lifetime, |
61 | 63 | generics::{generics, trait_self_param_idx, Generics}, |
| 64 | + lower::diagnostics::*, |
62 | 65 | make_binders, |
63 | 66 | mapping::{from_chalk_trait_id, lt_to_placeholder_idx, ToChalk}, |
64 | 67 | static_lifetime, to_assoc_type_id, to_chalk_trait_id, to_placeholder_idx, |
@@ -102,31 +105,6 @@ impl ImplTraitLoweringState { |
102 | 105 | } |
103 | 106 | } |
104 | 107 |
|
105 | | -type TypeSource = Either<TypeRefId, hir_def::type_ref::TypeSource>; |
106 | | - |
107 | | -#[derive(Debug, PartialEq, Eq, Clone)] |
108 | | -pub struct TyLoweringDiagnostic { |
109 | | - pub source: TypeSource, |
110 | | - pub kind: TyLoweringDiagnosticKind, |
111 | | -} |
112 | | - |
113 | | -#[derive(Debug, PartialEq, Eq, Clone)] |
114 | | -pub enum TyLoweringDiagnosticKind { |
115 | | - GenericArgsProhibited { segment: u32, reason: GenericArgsProhibitedReason }, |
116 | | -} |
117 | | - |
118 | | -#[derive(Debug, Clone, Copy, PartialEq, Eq)] |
119 | | -pub enum GenericArgsProhibitedReason { |
120 | | - Module, |
121 | | - TyParam, |
122 | | - SelfTy, |
123 | | - PrimitiveTy, |
124 | | - /// When there is a generic enum, within the expression `Enum::Variant`, |
125 | | - /// either `Enum` or `Variant` are allowed to have generic arguments, but not both. |
126 | | - // FIXME: This is not used now but it should be. |
127 | | - EnumVariant, |
128 | | -} |
129 | | - |
130 | 108 | #[derive(Debug)] |
131 | 109 | pub struct TyLoweringContext<'a> { |
132 | 110 | pub db: &'a dyn HirDatabase, |
|
0 commit comments