Merge inherent impl blocks for `Diverges

This commit is contained in:
Aaron Hill 2019-09-18 21:57:50 -04:00
parent 034a8fd1df
commit d67528ff7d
No known key found for this signature in database
GPG Key ID: B4087E510E98B164

View File

@ -470,16 +470,6 @@ pub enum Diverges {
WarnedAlways
}
impl Diverges {
/// Creates a `Diverges::Always` with the provided `span` and the default note message.
fn always(span: Span) -> Diverges {
Diverges::Always {
span,
custom_note: None
}
}
}
// Convenience impls for combinig `Diverges`.
impl ops::BitAnd for Diverges {
@ -509,6 +499,14 @@ impl ops::BitOrAssign for Diverges {
}
impl Diverges {
/// Creates a `Diverges::Always` with the provided `span` and the default note message.
fn always(span: Span) -> Diverges {
Diverges::Always {
span,
custom_note: None
}
}
fn is_always(self) -> bool {
// Enum comparison ignores the
// contents of fields, so we just