diff --git a/crates/libs/result/src/error.rs b/crates/libs/result/src/error.rs index ecc6373118..5560b927c9 100644 --- a/crates/libs/result/src/error.rs +++ b/crates/libs/result/src/error.rs @@ -267,11 +267,6 @@ impl ErrorT { } } - /// The error code describing the error. - pub const fn code(&self) -> HRESULT { - self.code.to_hresult() - } - /// The error message describing the error. pub fn message(&self) -> String { if let Some(message) = self.detail.message() { @@ -288,6 +283,15 @@ impl ErrorT { } } +// This is a separate impl block because Rust 1.60.0 (our MSRV) rejects const fns that have +// trait bounds on them, so we place it in a separate impl without any bounds. +impl ErrorT { + /// The error code describing the error. + pub const fn code(&self) -> HRESULT { + self.code.to_hresult() + } +} + #[cfg(feature = "std")] impl std::error::Error for ErrorT {}