bootstrap/core/build_steps/test/
compiletest.rs1use std::fmt;
2
3#[derive(Clone, Copy, PartialEq, Eq, Hash)]
11pub(crate) enum CompiletestMode {
12 Assembly,
14 Codegen,
15 CodegenUnits,
16 CoverageMap,
17 CoverageRun,
18 Crashes,
19 Debuginfo,
20 Incremental,
21 MirOpt,
22 Pretty,
23 RunMake,
24 Rustdoc,
25 RustdocJs,
26 RustdocJson,
27 Ui,
28 }
30
31impl CompiletestMode {
32 pub(crate) const fn as_str(self) -> &'static str {
39 match self {
40 Self::Assembly => "assembly",
42 Self::Codegen => "codegen",
43 Self::CodegenUnits => "codegen-units",
44 Self::CoverageMap => "coverage-map",
45 Self::CoverageRun => "coverage-run",
46 Self::Crashes => "crashes",
47 Self::Debuginfo => "debuginfo",
48 Self::Incremental => "incremental",
49 Self::MirOpt => "mir-opt",
50 Self::Pretty => "pretty",
51 Self::RunMake => "run-make",
52 Self::Rustdoc => "rustdoc",
53 Self::RustdocJs => "rustdoc-js",
54 Self::RustdocJson => "rustdoc-json",
55 Self::Ui => "ui",
56 }
58 }
59}
60
61impl fmt::Display for CompiletestMode {
62 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
63 f.write_str(self.as_str())
64 }
65}
66
67impl fmt::Debug for CompiletestMode {
68 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
69 <Self as fmt::Display>::fmt(self, f)
70 }
71}