mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Add HIR for impl blocks
Since we need to be able to go from def to containing impl block, as well as the other direction, and to find all impls for a certain type, a design similar to the one for modules, where we collect all impls for the whole crate and keep them in an arena, seemed fitting. The ImplBlock type, which provides the public interface, then consists only of an Arc to the arena containing all impls, and the index into it.
This commit is contained in:
parent
226e31dae9
commit
ae9530addc
11 changed files with 269 additions and 8 deletions
|
@ -31,6 +31,7 @@ mod function;
|
|||
mod adt;
|
||||
mod type_ref;
|
||||
mod ty;
|
||||
mod impl_block;
|
||||
|
||||
use crate::{
|
||||
db::HirDatabase,
|
||||
|
@ -48,6 +49,7 @@ pub use self::{
|
|||
function::{Function, FnScopes},
|
||||
adt::{Struct, Enum},
|
||||
ty::Ty,
|
||||
impl_block::{ImplBlock, ImplItem},
|
||||
};
|
||||
|
||||
pub use self::function::FnSignatureInfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue