mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Chalk integration
- add proper canonicalization logic - add conversions from/to Chalk IR
This commit is contained in:
parent
6269791d36
commit
b9c0c2abb7
14 changed files with 800 additions and 149 deletions
|
@ -9,7 +9,7 @@ use ra_syntax::ast::{self, NameOwner, TypeParamsOwner, TypeBoundsOwner};
|
|||
|
||||
use crate::{
|
||||
db::DefDatabase,
|
||||
Name, AsName, Function, Struct, Enum, Trait, TypeAlias, ImplBlock, Container, path::Path, type_ref::TypeRef
|
||||
Name, AsName, Function, Struct, Enum, Trait, TypeAlias, ImplBlock, Container, path::Path, type_ref::TypeRef, AdtDef
|
||||
};
|
||||
|
||||
/// Data about a generic parameter (to a function, struct, impl, ...).
|
||||
|
@ -157,6 +157,15 @@ impl From<Container> for GenericDef {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<crate::adt::AdtDef> for GenericDef {
|
||||
fn from(adt: crate::adt::AdtDef) -> Self {
|
||||
match adt {
|
||||
AdtDef::Struct(s) => s.into(),
|
||||
AdtDef::Enum(e) => e.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HasGenericParams {
|
||||
fn generic_params(self, db: &impl DefDatabase) -> Arc<GenericParams>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue