mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
fix borrow checker things
This commit is contained in:
parent
93a1baad1d
commit
a2938440fa
1 changed files with 8 additions and 8 deletions
|
@ -237,7 +237,7 @@ fn start_phase<'a>(module_id: ModuleId, phase: Phase, state: &mut State<'a>) ->
|
||||||
// canonicalize the file
|
// canonicalize the file
|
||||||
let parsed = state.module_cache.parsed.remove(&module_id).unwrap();
|
let parsed = state.module_cache.parsed.remove(&module_id).unwrap();
|
||||||
|
|
||||||
let deps_by_name = parsed.deps_by_name;
|
let deps_by_name = &parsed.deps_by_name;
|
||||||
let num_deps = deps_by_name.len();
|
let num_deps = deps_by_name.len();
|
||||||
let mut dep_idents: IdentIdsByModule = IdentIds::exposed_builtins(num_deps);
|
let mut dep_idents: IdentIdsByModule = IdentIds::exposed_builtins(num_deps);
|
||||||
|
|
||||||
|
@ -531,7 +531,6 @@ struct ParsedModule<'a> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct CanonicalizedModule<'a> {
|
struct CanonicalizedModule<'a> {
|
||||||
module: Module,
|
module: Module,
|
||||||
module_output: ModuleOutput,
|
|
||||||
src: &'a str,
|
src: &'a str,
|
||||||
module_timing: ModuleTiming,
|
module_timing: ModuleTiming,
|
||||||
}
|
}
|
||||||
|
@ -1326,9 +1325,11 @@ fn update<'a>(
|
||||||
Ok(state)
|
Ok(state)
|
||||||
}
|
}
|
||||||
Parsed(parsed) => {
|
Parsed(parsed) => {
|
||||||
|
let module_id = parsed.module_id;
|
||||||
|
|
||||||
state.module_cache.parsed.insert(parsed.module_id, parsed);
|
state.module_cache.parsed.insert(parsed.module_id, parsed);
|
||||||
|
|
||||||
let work = state.dependencies.notify(parsed.module_id, Phase::Parse);
|
let work = state.dependencies.notify(module_id, Phase::Parse);
|
||||||
|
|
||||||
for (module_id, phase) in work {
|
for (module_id, phase) in work {
|
||||||
let task = start_phase(module_id, phase, &mut state);
|
let task = start_phase(module_id, phase, &mut state);
|
||||||
|
@ -1339,14 +1340,14 @@ fn update<'a>(
|
||||||
Ok(state)
|
Ok(state)
|
||||||
}
|
}
|
||||||
Canonicalized(canonical) => {
|
Canonicalized(canonical) => {
|
||||||
|
let module_id = canonical.module.module_id;
|
||||||
|
|
||||||
state
|
state
|
||||||
.module_cache
|
.module_cache
|
||||||
.canonicalized
|
.canonicalized
|
||||||
.insert(canonical.module.module_id, canonical);
|
.insert(canonical.module.module_id, canonical);
|
||||||
|
|
||||||
let work = state
|
let work = state.dependencies.notify(module_id, Phase::Canonicalize);
|
||||||
.dependencies
|
|
||||||
.notify(canonical.module.module_id, Phase::Canonicalize);
|
|
||||||
|
|
||||||
for (module_id, phase) in work {
|
for (module_id, phase) in work {
|
||||||
let task = start_phase(module_id, phase, &mut state);
|
let task = start_phase(module_id, phase, &mut state);
|
||||||
|
@ -2169,7 +2170,7 @@ fn canonicalize<'a>(
|
||||||
module_timing.canonicalize = canonicalize_end.duration_since(canonicalize_start).unwrap();
|
module_timing.canonicalize = canonicalize_end.duration_since(canonicalize_start).unwrap();
|
||||||
|
|
||||||
match canonicalized {
|
match canonicalized {
|
||||||
Ok(mut module_output) => {
|
Ok(module_output) => {
|
||||||
let module = Module {
|
let module = Module {
|
||||||
module_id,
|
module_id,
|
||||||
exposed_imports: module_output.exposed_imports,
|
exposed_imports: module_output.exposed_imports,
|
||||||
|
@ -2181,7 +2182,6 @@ fn canonicalize<'a>(
|
||||||
|
|
||||||
let canonical = CanonicalizedModule {
|
let canonical = CanonicalizedModule {
|
||||||
module,
|
module,
|
||||||
module_output,
|
|
||||||
module_timing,
|
module_timing,
|
||||||
src,
|
src,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue