Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/hir.rs')
| -rw-r--r-- | crates/hir-def/src/hir.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/crates/hir-def/src/hir.rs b/crates/hir-def/src/hir.rs index 4ad8a7aa8e..500e880061 100644 --- a/crates/hir-def/src/hir.rs +++ b/crates/hir-def/src/hir.rs @@ -26,7 +26,7 @@ use crate::{ builtin_type::{BuiltinFloat, BuiltinInt, BuiltinUint}, path::{GenericArgs, Path}, type_ref::{Mutability, Rawness, TypeRef}, - AnonymousConstId, BlockId, + BlockId, ConstBlockId, }; pub use syntax::ast::{ArithOp, BinaryOp, CmpOp, LogicOp, Ordering, RangeOp, UnaryOp}; @@ -181,7 +181,7 @@ pub enum Expr { statements: Box<[Statement]>, tail: Option<ExprId>, }, - Const(AnonymousConstId), + Const(ConstBlockId), Unsafe { id: Option<BlockId>, statements: Box<[Statement]>, @@ -501,25 +501,9 @@ pub struct Binding { pub name: Name, pub mode: BindingAnnotation, pub definitions: SmallVec<[PatId; 1]>, - /// Id of the closure/generator that owns this binding. If it is owned by the - /// top level expression, this field would be `None`. - pub owner: Option<ExprId>, pub problems: Option<BindingProblems>, } -impl Binding { - pub fn is_upvar(&self, relative_to: ExprId) -> bool { - match self.owner { - Some(x) => { - // We assign expression ids in a way that outer closures will receive - // a lower id - x.into_raw() < relative_to.into_raw() - } - None => true, - } - } -} - #[derive(Debug, Clone, Eq, PartialEq)] pub struct RecordFieldPat { pub name: Name, |