Skip to content

Commit

Permalink
fix up an unwanted compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Aug 11, 2023
1 parent a86ed60 commit 6a966d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion tests/compile-fail/bitflags_custom_bits.rs
Expand Up @@ -125,7 +125,7 @@ impl ParseHex for MyInt {

impl WriteHex for MyInt {
fn write_hex<W: fmt::Write>(&self, writer: W) -> fmt::Result {
LowerHex::fmt(&self.0, writer)
write!(writer, "{:x}", self.0)
}
}

Expand Down
15 changes: 0 additions & 15 deletions tests/compile-fail/bitflags_custom_bits.stderr
Expand Up @@ -19,18 +19,3 @@ note: required by a bound in `PublicFlags::Primitive`
|
| type Primitive: Primitive;
| ^^^^^^^^^ required by this bound in `PublicFlags::Primitive`

error[E0308]: mismatched types
--> tests/compile-fail/bitflags_custom_bits.rs:128:32
|
127 | fn write_hex<W: fmt::Write>(&self, writer: W) -> fmt::Result {
| - this type parameter
128 | LowerHex::fmt(&self.0, writer)
| ------------- ^^^^^^ expected `&mut Formatter<'_>`, found type parameter `W`
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut Formatter<'_>`
found type parameter `W`
note: method defined here
--> $RUST/core/src/fmt/mod.rs

0 comments on commit 6a966d7

Please sign in to comment.