1
use bumpalo::collections::Vec;
2
use estree::Identifier;
3
-use std::collections::HashSet;
3
+use std::{cell::RefCell, collections::HashSet, rc::Rc};
4
5
use hir::{
6
- BasicBlock, BlockId, BlockKind, Environment, GotoKind, Instruction, InstructionIdGenerator,
7
- InstructionValue, Place, Terminal, TerminalValue, Type, HIR,
6
+ BasicBlock, BlockId, BlockKind, Environment, GotoKind, IdentifierData, Instruction,
7
+ InstructionIdGenerator, InstructionValue, Place, Terminal, TerminalValue, Type, HIR,
8
};
9
use indexmap::IndexMap;
10
106
pub(crate) fn make_temporary(&self) -> hir::Identifier<'a> {
107
hir::Identifier {
108
id: self.environment.next_identifier_id(),
109
- mutable_range: Default::default(),
109
name: None,
111
- scope: None,
112
- type_: Type::Var(self.environment.next_type_var_id()),
110
+ data: Rc::new(RefCell::new(IdentifierData {
111
+ mutable_range: Default::default(),
112
+ scope: None,
113
+ type_: Type::Var(self.environment.next_type_var_id()),
114
+ })),
115
}
116
}
117
118
/// Resolves the target for the given break label (if present), or returns the default
119
/// break target given the current context. Returns a diagnostic if the label is
120
/// provided but cannot be resolved.
119
- pub(crate) fn resolve_break(&self, label: Option<Identifier>) -> Result<BlockId, Diagnostic> {
121
+ pub(crate) fn resolve_break(&self, _label: Option<Identifier>) -> Result<BlockId, Diagnostic> {
122
todo!()
123
}
124
127
/// provided but cannot be resolved.
128
pub(crate) fn resolve_continue(
129
&self,
128
- label: Option<Identifier>,
130
+ _label: Option<Identifier>,
131
) -> Result<BlockId, Diagnostic> {
132
todo!()
133
}