Skip to content

Commit 6a966d7

Browse files
committed
fix up an unwanted compiler error
1 parent a86ed60 commit 6a966d7

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

tests/compile-fail/bitflags_custom_bits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl ParseHex for MyInt {
125125

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

tests/compile-fail/bitflags_custom_bits.stderr

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,3 @@ note: required by a bound in `PublicFlags::Primitive`
1919
|
2020
| type Primitive: Primitive;
2121
| ^^^^^^^^^ required by this bound in `PublicFlags::Primitive`
22-
23-
error[E0308]: mismatched types
24-
--> tests/compile-fail/bitflags_custom_bits.rs:128:32
25-
|
26-
127 | fn write_hex<W: fmt::Write>(&self, writer: W) -> fmt::Result {
27-
| - this type parameter
28-
128 | LowerHex::fmt(&self.0, writer)
29-
| ------------- ^^^^^^ expected `&mut Formatter<'_>`, found type parameter `W`
30-
| |
31-
| arguments to this function are incorrect
32-
|
33-
= note: expected mutable reference `&mut Formatter<'_>`
34-
found type parameter `W`
35-
note: method defined here
36-
--> $RUST/core/src/fmt/mod.rs

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy