mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
ModuleDef is Def-free
This commit is contained in:
parent
0f2f3a21e7
commit
ff9c5bef7b
4 changed files with 2 additions and 12 deletions
|
@ -5,7 +5,7 @@ use ra_db::{CrateId, FileId};
|
|||
use ra_syntax::{ast::self, TreeArc, SyntaxNode};
|
||||
|
||||
use crate::{
|
||||
Name, DefId, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId,
|
||||
Name, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId,
|
||||
type_ref::TypeRef,
|
||||
nameres::{ModuleScope, lower::ImportId},
|
||||
db::HirDatabase,
|
||||
|
@ -62,13 +62,12 @@ pub enum ModuleDef {
|
|||
Function(Function),
|
||||
Struct(Struct),
|
||||
Enum(Enum),
|
||||
// Can't be directly declared, but can be imported.
|
||||
EnumVariant(EnumVariant),
|
||||
Const(Const),
|
||||
Static(Static),
|
||||
Trait(Trait),
|
||||
Type(Type),
|
||||
// Can't be directly declared, but can be imported.
|
||||
Def(DefId),
|
||||
}
|
||||
impl_froms!(
|
||||
ModuleDef: Module,
|
||||
|
@ -82,12 +81,6 @@ impl_froms!(
|
|||
Type
|
||||
);
|
||||
|
||||
impl From<DefId> for ModuleDef {
|
||||
fn from(it: DefId) -> ModuleDef {
|
||||
ModuleDef::Def(it)
|
||||
}
|
||||
}
|
||||
|
||||
pub enum ModuleSource {
|
||||
SourceFile(TreeArc<ast::SourceFile>),
|
||||
Module(TreeArc<ast::Module>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue