mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Simplify
This commit is contained in:
parent
6a852d7627
commit
13890697eb
12 changed files with 121 additions and 136 deletions
|
@ -21,7 +21,6 @@ use crate::{
|
|||
pub struct Expander {
|
||||
cfg_options: CfgOptions,
|
||||
span_map: OnceCell<SpanMap>,
|
||||
krate: CrateId,
|
||||
current_file_id: HirFileId,
|
||||
pub(crate) module: ModuleId,
|
||||
/// `recursion_depth == usize::MAX` indicates that the recursion limit has been reached.
|
||||
|
@ -45,10 +44,13 @@ impl Expander {
|
|||
recursion_limit,
|
||||
cfg_options: db.crate_graph()[module.krate].cfg_options.clone(),
|
||||
span_map: OnceCell::new(),
|
||||
krate: module.krate,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn krate(&self) -> CrateId {
|
||||
self.module.krate
|
||||
}
|
||||
|
||||
pub fn enter_expand<T: ast::AstNode>(
|
||||
&mut self,
|
||||
db: &dyn DefDatabase,
|
||||
|
@ -112,7 +114,7 @@ impl Expander {
|
|||
pub(crate) fn parse_attrs(&self, db: &dyn DefDatabase, owner: &dyn ast::HasAttrs) -> Attrs {
|
||||
Attrs::filter(
|
||||
db,
|
||||
self.krate,
|
||||
self.krate(),
|
||||
RawAttrs::new(
|
||||
db.upcast(),
|
||||
owner,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue