-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmod.rs
37 lines (26 loc) · 789 Bytes
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
mod constraint;
mod mangle;
mod monomorphize;
mod state;
pub mod trait_solver;
pub use self::state::*;
use crate::{diagnostics::Diagnostic, parser::ParsingCtx, Config};
pub fn infer(
root: &mut crate::hir::Root,
parsing_ctx: &mut ParsingCtx,
config: &Config,
) -> Result<crate::hir::Root, Diagnostic> {
if config.show_state {
super::hir::hir_printer::print(root);
}
let (tmp_resolutions, diags) = constraint::solve(root);
parsing_ctx.diagnostics.append(diags);
parsing_ctx.return_if_error()?;
let mut new_root = monomorphize::monomophize(root, tmp_resolutions);
mangle::mangle(&mut new_root);
if config.show_hir {
super::hir::hir_printer::print(&new_root);
}
parsing_ctx.return_if_error()?;
Ok(new_root)
}