Skip to content

Commit e97d9ed

Browse files
committed
Remove unused const_decl_origin from TypedVariableDeclaration
After #2158, constant declartaions use TypedConstantDeclaration AST node, and hence this field is now useless. It must have been removed in #2158 itself, but I missed doing that.
1 parent 15cc8f8 commit e97d9ed

File tree

5 files changed

+0
-14
lines changed

5 files changed

+0
-14
lines changed

sway-core/src/ir_generation/compile.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ fn compile_constants(
6363
None
6464
}
6565
}
66-
67-
TypedDeclaration::VariableDeclaration(TypedVariableDeclaration {
68-
name,
69-
body,
70-
const_decl_origin,
71-
..
72-
}) if *const_decl_origin => Some((name, body)),
73-
7466
_otherwise => None,
7567
};
7668

sway-core/src/semantic_analysis/ast_node/declaration/function/function_parameter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ impl TypedFunctionParameter {
6767
} else {
6868
VariableMutability::Immutable
6969
},
70-
const_decl_origin: false,
7170
type_ascription: type_id,
7271
}),
7372
);

sway-core/src/semantic_analysis/ast_node/declaration/variable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ pub struct TypedVariableDeclaration {
5252
pub body: TypedExpression,
5353
pub(crate) is_mutable: VariableMutability,
5454
pub type_ascription: TypeId,
55-
pub(crate) const_decl_origin: bool,
5655
}
5756

5857
// NOTE: Hash and PartialEq must uphold the invariant:
@@ -64,7 +63,6 @@ impl PartialEq for TypedVariableDeclaration {
6463
&& self.body == other.body
6564
&& self.is_mutable == other.is_mutable
6665
&& look_up_type_id(self.type_ascription) == look_up_type_id(other.type_ascription)
67-
&& self.const_decl_origin == other.const_decl_origin
6866
}
6967
}
7068

sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_branch.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ impl TypedMatchBranch {
6868
body: right_decl,
6969
is_mutable: VariableMutability::Immutable,
7070
type_ascription,
71-
const_decl_origin: false,
7271
});
7372
ctx.namespace.insert_symbol(left_decl, var_decl.clone());
7473
code_block_contents.push(TypedAstNode {

sway-core/src/semantic_analysis/ast_node/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ impl TypedAstNode {
291291
name: name.clone(),
292292
body,
293293
is_mutable: is_mutable.into(),
294-
const_decl_origin: false,
295294
type_ascription,
296295
});
297296
ctx.namespace.insert_symbol(name, typed_var_decl.clone());
@@ -794,7 +793,6 @@ fn type_check_trait_methods(
794793
},
795794
// TODO allow mutable function params?
796795
is_mutable: VariableMutability::Immutable,
797-
const_decl_origin: false,
798796
type_ascription: r#type,
799797
}),
800798
);

0 commit comments

Comments
 (0)