Skip to content

Commit 99b6952

Browse files
committed
hir_def::expr -> hir_def::hir, hir_def::type_ref -> hir_def::hir::type_ref
1 parent 8e7c104 commit 99b6952

33 files changed

+96
-94
lines changed

crates/hir-def/src/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::{ast, AstPtr, SyntaxNode, SyntaxNodePtr};
2525
use crate::{
2626
attr::Attrs,
2727
db::DefDatabase,
28-
expr::{
28+
hir::{
2929
dummy_expr_id, Binding, BindingId, Expr, ExprId, Label, LabelId, Pat, PatId, RecordFieldPat,
3030
},
3131
item_scope::BuiltinShadowMode,

crates/hir-def/src/body/lower.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::{
3333
builtin_type::{BuiltinFloat, BuiltinInt, BuiltinUint},
3434
data::adt::StructKind,
3535
db::DefDatabase,
36-
expr::{
36+
hir::{
3737
dummy_expr_id, Array, Binding, BindingAnnotation, BindingId, ClosureKind, Expr, ExprId,
3838
FloatTypeWrapper, Label, LabelId, Literal, MatchArm, Movability, Pat, PatId,
3939
RecordFieldPat, RecordLitField, Statement,

crates/hir-def/src/body/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::fmt::{self, Write};
55
use syntax::ast::HasName;
66

77
use crate::{
8-
expr::{Array, BindingAnnotation, BindingId, ClosureKind, Literal, Movability, Statement},
8+
hir::{Array, BindingAnnotation, BindingId, ClosureKind, Literal, Movability, Statement},
99
pretty::{print_generic_args, print_path, print_type_ref},
1010
type_ref::TypeRef,
1111
};

crates/hir-def/src/body/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
88
use crate::{
99
body::Body,
1010
db::DefDatabase,
11-
expr::{Binding, BindingId, Expr, ExprId, LabelId, Pat, PatId, Statement},
11+
hir::{Binding, BindingId, Expr, ExprId, LabelId, Pat, PatId, Statement},
1212
BlockId, DefWithBodyId,
1313
};
1414

crates/hir-def/src/expr.rs renamed to crates/hir-def/src/hir.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
//!
1313
//! See also a neighboring `body` module.
1414
15+
pub mod type_ref;
16+
1517
use std::fmt;
1618

1719
use hir_expand::name::Name;
@@ -28,10 +30,10 @@ use crate::{
2830

2931
pub use syntax::ast::{ArithOp, BinaryOp, CmpOp, LogicOp, Ordering, RangeOp, UnaryOp};
3032

31-
pub type ExprId = Idx<Expr>;
32-
3333
pub type BindingId = Idx<Binding>;
3434

35+
pub type ExprId = Idx<Expr>;
36+
3537
/// FIXME: this is a hacky function which should be removed
3638
pub(crate) fn dummy_expr_id() -> ExprId {
3739
ExprId::from_raw(RawIdx::from(u32::MAX))

crates/hir-def/src/type_ref.rs renamed to crates/hir-def/src/hir/type_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use syntax::ast::{self, HasName};
1313
use crate::{
1414
body::LowerCtx,
1515
builtin_type::{BuiltinInt, BuiltinType, BuiltinUint},
16-
expr::Literal,
16+
hir::Literal,
1717
path::Path,
1818
};
1919

crates/hir-def/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub mod db;
1818

1919
pub mod attr;
2020
pub mod path;
21-
pub mod type_ref;
2221
pub mod builtin_type;
2322
pub mod builtin_attr;
2423
pub mod per_ns;
@@ -34,7 +33,8 @@ pub mod generics;
3433
pub mod lang_item;
3534
pub mod layout;
3635

37-
pub mod expr;
36+
pub mod hir;
37+
pub use self::hir::type_ref;
3838
pub mod body;
3939
pub mod resolver;
4040

crates/hir-def/src/resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::{
1212
body::scope::{ExprScopes, ScopeId},
1313
builtin_type::BuiltinType,
1414
db::DefDatabase,
15-
expr::{BindingId, ExprId, LabelId},
1615
generics::{GenericParams, TypeOrConstParamData},
16+
hir::{BindingId, ExprId, LabelId},
1717
item_scope::{BuiltinShadowMode, BUILTIN_SCOPE},
1818
lang_item::LangItemTarget,
1919
nameres::DefMap,

crates/hir-ty/src/chalk_db.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait};
99

1010
use base_db::CrateId;
1111
use hir_def::{
12-
expr::Movability,
12+
hir::Movability,
1313
lang_item::{lang_attr, LangItem, LangItemTarget},
1414
AssocItemId, BlockId, GenericDefId, HasModule, ItemContainerId, Lookup, TypeAliasId,
1515
};
@@ -415,8 +415,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
415415
let input_output = crate::make_type_and_const_binders(it, input_output);
416416

417417
let movability = match self.db.body(parent)[expr] {
418-
hir_def::expr::Expr::Closure {
419-
closure_kind: hir_def::expr::ClosureKind::Generator(movability),
418+
hir_def::hir::Expr::Closure {
419+
closure_kind: hir_def::hir::ClosureKind::Generator(movability),
420420
..
421421
} => movability,
422422
_ => unreachable!("non generator expression interned as generator"),

crates/hir-ty/src/consteval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use base_db::CrateId;
44
use chalk_ir::{BoundVar, DebruijnIndex, GenericArgData};
55
use hir_def::{
6-
expr::Expr,
6+
hir::Expr,
77
path::Path,
88
resolver::{Resolver, ValueNs},
99
type_ref::ConstRef,

0 commit comments

Comments
 (0)