Skip to content

Commit

Permalink
fix lifetime issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed Jun 13, 2024
1 parent 4058212 commit a34c5db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scopegraphs/examples/records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ type RecordScopegraph<'sg> = ScopeGraph<'sg, SgLabel, SgData, FutureCompleteness
type SgScopeExt<'sg> = ScopeExt<'sg, SgLabel, SgData, FutureCompleteness<SgLabel>>;

struct TypeChecker<'sg, 'ex> {
sg: RecordScopegraph<'sg>,
sg: &'sg RecordScopegraph<'sg>,
uf: RefCell<UnionFind>,
ex: LocalExecutor<'ex>,
}
Expand Down Expand Up @@ -425,10 +425,10 @@ where
}

fn init_record_def<'tc, 'ast, 'ext>(
&'tc self,
&self,
record_def: &'ast RecordDef,
decl_ext: &'ext SgScopeExt<'sg>,
) -> SgScopeExt {
decl_ext: &'ext SgScopeExt<'ext>,
) -> SgScopeExt<'sg> {
let (field_scope, ext_def) = add_scope!(&self.sg, [SgLabel::Definition]);
self.sg
.ext_decl(
Expand Down Expand Up @@ -561,7 +561,7 @@ fn typecheck(ast: &Program) -> Option<Type> {
let uf = RefCell::new(UnionFind::default());
let local = LocalExecutor::new();

let tc = Rc::new(TypeChecker { sg, uf, ex: local });
let tc = Rc::new(TypeChecker { sg: &sg, uf, ex: local });

// INLINED add_scope!(...) macro for debugging purposes
let (global_scope, ext_type_def) = {
Expand Down

0 comments on commit a34c5db

Please sign in to comment.