Skip to content

Commit d6b0e77

Browse files
bors[bot]couchand
andauthored
Merge #471
471: Writable::Writer needs DerefMut trait bound r=burrbull a=couchand Otherwise, a call to `bits` in the closure passed to `write`/`modify` in a function where the register is bound only on the `Writable` trait will fail to typecheck. This only causes an issue for code written to be generic over a `Writable` register, so I suspect I'm the only one that's so far been bitten by the bug. In any case, apologies for shipping broken code! Co-authored-by: Andrew Dona-Couch <[email protected]>
2 parents 73d42ff + 1737ce4 commit d6b0e77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generate/generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub trait Readable: RegisterSpec {
2121
/// Registers marked with `Readable` can be also `modify`'ed.
2222
pub trait Writable: RegisterSpec {
2323
/// Writer type argument to `write`, et al.
24-
type Writer: core::convert::From<W<Self>> + core::ops::Deref<Target = W<Self>>;
24+
type Writer: core::convert::From<W<Self>> + core::ops::DerefMut<Target = W<Self>>;
2525
}
2626

2727
/// Reset value of the register.

0 commit comments

Comments
 (0)