mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Split out ExpressionStore from Body
This commit is contained in:
parent
db6d23c0e5
commit
55d1d5dd8b
28 changed files with 530 additions and 444 deletions
|
|
@ -3,7 +3,7 @@
|
|||
use base_db::{ra_salsa::Cycle, CrateId};
|
||||
use chalk_ir::{cast::Cast, BoundVar, DebruijnIndex};
|
||||
use hir_def::{
|
||||
body::{Body, HygieneId},
|
||||
expr_store::{Body, HygieneId},
|
||||
hir::{Expr, ExprId},
|
||||
path::Path,
|
||||
resolver::{Resolver, ValueNs},
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ use crate::{
|
|||
};
|
||||
|
||||
pub(crate) use hir_def::{
|
||||
body::Body,
|
||||
expr_store::Body,
|
||||
hir::{Expr, ExprId, MatchArm, Pat, PatId, Statement},
|
||||
LocalFieldId, VariantId,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ pub(crate) mod pat_analysis;
|
|||
|
||||
use chalk_ir::Mutability;
|
||||
use hir_def::{
|
||||
body::Body, data::adt::VariantData, hir::PatId, AdtId, EnumVariantId, LocalFieldId, VariantId,
|
||||
data::adt::VariantData, expr_store::Body, hir::PatId, AdtId, EnumVariantId, LocalFieldId,
|
||||
VariantId,
|
||||
};
|
||||
use hir_expand::name::Name;
|
||||
use span::Edition;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::mem;
|
|||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::Body,
|
||||
expr_store::Body,
|
||||
hir::{Expr, ExprId, ExprOrPatId, Pat, PatId, Statement, UnaryOp},
|
||||
path::Path,
|
||||
resolver::{HasResolver, ResolveValueResult, Resolver, ValueNs},
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ use chalk_ir::{
|
|||
};
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::{Body, HygieneId},
|
||||
builtin_type::{BuiltinInt, BuiltinType, BuiltinUint},
|
||||
data::{ConstData, StaticData},
|
||||
expr_store::{Body, HygieneId},
|
||||
hir::{BindingAnnotation, BindingId, ExprId, ExprOrPatId, LabelId, PatId},
|
||||
lang_item::{LangItem, LangItemTarget},
|
||||
layout::Integer,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
use std::cell::RefCell;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use hir_def::body::HygieneId;
|
||||
use hir_def::expr_store::HygieneId;
|
||||
use hir_def::hir::ExprOrPatId;
|
||||
use hir_def::path::{Path, PathSegment, PathSegments};
|
||||
use hir_def::resolver::{ResolveValueResult, Resolver, TypeNs};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use std::iter::repeat_with;
|
||||
|
||||
use hir_def::{
|
||||
body::Body,
|
||||
expr_store::Body,
|
||||
hir::{Binding, BindingAnnotation, BindingId, Expr, ExprId, Literal, Pat, PatId},
|
||||
path::Path,
|
||||
};
|
||||
|
|
@ -528,7 +528,7 @@ impl InferenceContext<'_> {
|
|||
self.infer_expr(expr, &Expectation::has_type(expected.clone()), ExprIsRead::Yes)
|
||||
}
|
||||
|
||||
fn is_non_ref_pat(&mut self, body: &hir_def::body::Body, pat: PatId) -> bool {
|
||||
fn is_non_ref_pat(&mut self, body: &hir_def::expr_store::Body, pat: PatId) -> bool {
|
||||
match &body[pat] {
|
||||
Pat::Tuple { .. }
|
||||
| Pat::TupleStruct { .. }
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ use chalk_ir::{
|
|||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::HygieneId,
|
||||
builtin_type::BuiltinType,
|
||||
data::{adt::StructKind, TraitFlags},
|
||||
expander::Expander,
|
||||
expr_store::HygieneId,
|
||||
generics::{
|
||||
GenericParamDataRef, TypeOrConstParamData, TypeParamProvenance, WherePredicate,
|
||||
WherePredicateTypeTarget,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use base_db::CrateId;
|
|||
use chalk_ir::Mutability;
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::Body,
|
||||
expr_store::Body,
|
||||
hir::{BindingAnnotation, BindingId, Expr, ExprId, Ordering, PatId},
|
||||
DefWithBodyId, FieldId, StaticId, TupleFieldId, UnionId, VariantId,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ use base_db::CrateId;
|
|||
use chalk_ir::{cast::Cast, Mutability};
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::HygieneId,
|
||||
builtin_type::BuiltinType,
|
||||
data::adt::{StructFlags, VariantData},
|
||||
expr_store::HygieneId,
|
||||
lang_item::LangItem,
|
||||
layout::{TagEncoding, Variants},
|
||||
resolver::{HasResolver, TypeNs, ValueNs},
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ use std::{fmt::Write, iter, mem};
|
|||
use base_db::ra_salsa::Cycle;
|
||||
use chalk_ir::{BoundVar, ConstData, DebruijnIndex, TyKind};
|
||||
use hir_def::{
|
||||
body::{Body, HygieneId},
|
||||
data::adt::{StructKind, VariantData},
|
||||
expr_store::{Body, HygieneId},
|
||||
hir::{
|
||||
ArithOp, Array, BinaryOp, BindingAnnotation, BindingId, ExprId, LabelId, Literal,
|
||||
LiteralOrConst, MatchArm, Pat, PatId, RecordFieldPat, RecordLitField,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use std::{
|
|||
};
|
||||
|
||||
use either::Either;
|
||||
use hir_def::{body::Body, hir::BindingId};
|
||||
use hir_def::{expr_store::Body, hir::BindingId};
|
||||
use hir_expand::{name::Name, Lookup};
|
||||
use la_arena::ArenaMap;
|
||||
use span::Edition;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ use std::sync::LazyLock;
|
|||
use base_db::SourceDatabaseFileInputExt as _;
|
||||
use expect_test::Expect;
|
||||
use hir_def::{
|
||||
body::{Body, BodySourceMap},
|
||||
db::DefDatabase,
|
||||
expr_store::{Body, BodySourceMap},
|
||||
hir::{ExprId, Pat, PatId},
|
||||
item_scope::ItemScope,
|
||||
nameres::DefMap,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue