mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
add ModuleDef::BuiltInType
This commit is contained in:
parent
6b88735fe6
commit
e6545cc647
5 changed files with 61 additions and 10 deletions
|
@ -9,7 +9,7 @@ use crate::{
|
|||
type_ref::TypeRef,
|
||||
nameres::{ModuleScope, Namespace, ImportId, CrateModuleId},
|
||||
expr::{Body, BodySourceMap, validation::ExprValidator},
|
||||
ty::{TraitRef, InferenceResult},
|
||||
ty::{TraitRef, InferenceResult, primitive::{IntTy, FloatTy}},
|
||||
adt::{EnumVariantId, StructFieldId, VariantDef},
|
||||
generics::HasGenericParams,
|
||||
docs::{Documentation, Docs, docs_from_ast},
|
||||
|
@ -75,6 +75,15 @@ pub struct Module {
|
|||
pub(crate) module_id: CrateModuleId,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum BuiltinType {
|
||||
Char,
|
||||
Bool,
|
||||
Str,
|
||||
Int(IntTy),
|
||||
Float(FloatTy),
|
||||
}
|
||||
|
||||
/// The defs which can be visible in the module.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum ModuleDef {
|
||||
|
@ -89,6 +98,7 @@ pub enum ModuleDef {
|
|||
Static(Static),
|
||||
Trait(Trait),
|
||||
TypeAlias(TypeAlias),
|
||||
BuiltinType(BuiltinType),
|
||||
}
|
||||
impl_froms!(
|
||||
ModuleDef: Module,
|
||||
|
@ -100,7 +110,8 @@ impl_froms!(
|
|||
Const,
|
||||
Static,
|
||||
Trait,
|
||||
TypeAlias
|
||||
TypeAlias,
|
||||
BuiltinType
|
||||
);
|
||||
|
||||
pub enum ModuleSource {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue