refactor(tvix/eval): add initialised arg to declare_phantom
There are more upcomming uses of declare_phantom where this will come in handy to avoid some code bloat. Change-Id: I75cad8caf14511c519ab2f56e87e99bcbf0a082e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6467 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
9da99af860
commit
12acb1e237
2 changed files with 8 additions and 9 deletions
|
|
@ -234,13 +234,13 @@ impl Scope {
|
|||
/// Declare a local variable that occupies a stack slot and should
|
||||
/// be accounted for, but is not directly accessible by users
|
||||
/// (e.g. attribute sets used for `with`).
|
||||
pub fn declare_phantom(&mut self, span: codemap::Span) -> LocalIdx {
|
||||
pub fn declare_phantom(&mut self, span: codemap::Span, initialised: bool) -> LocalIdx {
|
||||
let idx = self.locals.len();
|
||||
self.locals.push(Local {
|
||||
name: LocalName::Phantom,
|
||||
initialised,
|
||||
span,
|
||||
name: LocalName::Phantom,
|
||||
depth: self.scope_depth,
|
||||
initialised: false,
|
||||
needs_finaliser: false,
|
||||
used: true,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue