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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user