Skip to content

Commit c84f913

Browse files
committed
Copy is enforced by Register trait
1 parent 6387aad commit c84f913

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

src/generate/generic.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ pub struct Reg<REG: Register> {
3535

3636
unsafe impl<REG: Register> Send for Reg<REG> where REG::Ux: Send {}
3737

38-
impl<REG: Register> Reg<REG>
39-
where
40-
REG::Ux: Copy,
41-
{
38+
impl<REG: Register> Reg<REG> {
4239
/// Returns the underlying memory address of register.
4340
///
4441
/// ```ignore
@@ -50,10 +47,7 @@ where
5047
}
5148
}
5249

53-
impl<REG: Readable> Reg<REG>
54-
where
55-
REG::Ux: Copy,
56-
{
50+
impl<REG: Readable> Reg<REG> {
5751
/// Reads the contents of a `Readable` register.
5852
///
5953
/// You can read the raw contents of a register by using `bits`:
@@ -75,10 +69,7 @@ where
7569
}
7670
}
7771

78-
impl<REG: Resettable + Writable> Reg<REG>
79-
where
80-
REG::Ux: Copy,
81-
{
72+
impl<REG: Resettable + Writable> Reg<REG> {
8273
/// Writes the reset value to `Writable` register.
8374
///
8475
/// Resets the register to its initial state.
@@ -119,7 +110,7 @@ where
119110

120111
impl<REG: Writable> Reg<REG>
121112
where
122-
REG::Ux: Copy + Default,
113+
REG::Ux: Default,
123114
{
124115
/// Writes 0 to a `Writable` register.
125116
///
@@ -139,10 +130,7 @@ where
139130
}
140131
}
141132

142-
impl<REG: Readable + Writable> Reg<REG>
143-
where
144-
REG::Ux: Copy,
145-
{
133+
impl<REG: Readable + Writable> Reg<REG> {
146134
/// Modifies the contents of the register by reading and then writing it.
147135
///
148136
/// E.g. to do a read-modify-write sequence to change parts of a register:
@@ -191,10 +179,7 @@ pub struct R<REG: Register> {
191179
_reg: marker::PhantomData<REG>,
192180
}
193181

194-
impl<REG: Register> R<REG>
195-
where
196-
REG::Ux: Copy,
197-
{
182+
impl<REG: Register> R<REG> {
198183
/// Reads raw bits from register.
199184
#[inline(always)]
200185
pub fn bits(&self) -> REG::Ux {

0 commit comments

Comments
 (0)