1pub mod command;
7pub mod diagnostic;
8pub mod env;
9pub mod error;
10pub mod version;
11
12pub use command::{CommandOutput, CommandRunner};
13pub use diagnostic::{
14 DiagnosticReport, DiagnosticSeverity, GhcDiagnostic, QuickFix, SourceSpan, TextEdit,
15};
16pub use env::EnvVars;
17pub use error::{Error, ErrorCode, Fix, Result};
18pub use version::Version;
19
20#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22#[repr(u8)]
23pub enum ExitCode {
24 Success = 0,
26 GeneralError = 1,
28 UsageError = 2,
30 ConfigError = 3,
32 ToolchainError = 4,
34 BuildError = 5,
36}
37
38impl From<ExitCode> for i32 {
39 fn from(code: ExitCode) -> Self {
40 code as i32
41 }
42}
43
44impl From<ExitCode> for std::process::ExitCode {
45 fn from(code: ExitCode) -> Self {
46 std::process::ExitCode::from(code as u8)
47 }
48}