-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
use std::fmt;
struct ErrorFmt;
impl fmt::Debug for ErrorFmt {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Err(fmt::Error)
}
}
struct A {
field: ErrorFmt,
}
impl fmt::Debug for A {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_map()
.entry(&"field", &ErrorFmt)
.finish()
}
}
fn main() {
println!("{:?}", A { field: ErrorFmt });
}
thread 'main' panicked at 'attempted to finish a map with a partial entry', src/libcore/fmt/builders.rs:924:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
I think the assert should just be removed so that the error gets propagated up?
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.