Skip to content

Commit 7fc3b3a

Browse files
committed
Automatically #[derive] the AddressSpace default implementation
As @jfrimmel points out, the standard integer types implement `Default`.
1 parent da214b8 commit 7fc3b3a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/librustc_target/abi/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,15 +752,9 @@ impl FieldsShape {
752752
/// An identifier that specifies the address space that some operation
753753
/// should operate on. Special address spaces have an effect on code generation,
754754
/// depending on the target and the address spaces it implements.
755-
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
755+
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Default)]
756756
pub struct AddressSpace(pub u32);
757757

758-
impl Default for AddressSpace {
759-
fn default() -> Self {
760-
AddressSpace(0)
761-
}
762-
}
763-
764758
/// Describes how values of the type are passed by target ABIs,
765759
/// in terms of categories of C types there are ABI rules for.
766760
#[derive(Clone, PartialEq, Eq, Hash, Debug, HashStable_Generic)]

0 commit comments

Comments
 (0)