Skip to content

defmt::Format implementation for raw pointers diverges from core::Debug implementation #603

@japaric

Description

@japaric

defmt

defmt::println!("{:?}", 1 as *const u8);

output:

 1
└─ hello::__cortex_m_rt_main @ src/bin/hello.rs:8

core::fmt

println!("{:?}", 1 as *const u8);

output:

0x1

defmt should also include the 0x prefix.

The current format makes it hard to tell that the number is a hexadecimal value. For example,

defmt::trace!(256 as *const u8);

produces:

TRACE 256 as * const u8 = 100

100 looks like one-hundred

Metadata

Metadata

Labels

difficulty: easyPretty easy to solvegood first issueGood for newcomerspriority: mediumMedium priority for the Knurling teamstatus: needs PRIssue just needs a Pull Request implementing the changestype: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions