diff --git a/lib/codegen/src/isa/mod.rs b/lib/codegen/src/isa/mod.rs index b95c32f967..33e78c96da 100644 --- a/lib/codegen/src/isa/mod.rs +++ b/lib/codegen/src/isa/mod.rs @@ -120,12 +120,14 @@ pub fn lookup(triple: Triple) -> Result { } /// Describes reason for target lookup failure -#[derive(PartialEq, Eq, Copy, Clone, Debug)] +#[derive(Fail, PartialEq, Eq, Copy, Clone, Debug)] pub enum LookupError { /// Support for this target was disabled in the current build. + #[fail(display = "Support for this target is disabled")] SupportDisabled, /// Support for this target has not yet been implemented. + #[fail(display = "Support for this target has not been implemented yet")] Unsupported, } diff --git a/lib/codegen/src/settings.rs b/lib/codegen/src/settings.rs index da0ac133aa..15274d3811 100644 --- a/lib/codegen/src/settings.rs +++ b/lib/codegen/src/settings.rs @@ -147,15 +147,18 @@ impl Configurable for Builder { } /// An error produced when changing a setting. -#[derive(Debug, PartialEq, Eq)] +#[derive(Fail, Debug, PartialEq, Eq)] pub enum SetError { /// No setting by this name exists. + #[fail(display = "No existing setting with this name")] BadName, /// Type mismatch for setting (e.g., setting an enum setting as a bool). + #[fail(display = "Trying to set a setting with the wrong type")] BadType, /// This is not a valid value for this setting. + #[fail(display = "Unexpected value for a setting")] BadValue, }