Skip to content

Commit 6084b39

Browse files
chrysnemilio
authored andcommitted
Debug implementation: use core if selected
Contributes-To: #1100
1 parent 14da023 commit 6084b39

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/codegen/impl_debug.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ pub fn gen_debug_impl(
4242
format_string.push_str(" }}");
4343
tokens.insert(0, quote! { #format_string });
4444

45+
let prefix = ctx.trait_prefix();
46+
4547
quote! {
46-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
48+
fn fmt(&self, f: &mut ::#prefix::fmt::Formatter) -> ::#prefix ::fmt::Result {
4749
write!(f, #( #tokens ),*)
4850
}
4951
}

src/codegen/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,8 +1920,10 @@ impl CodeGenerator for CompInfo {
19201920
self.kind(),
19211921
);
19221922

1923+
let prefix = ctx.trait_prefix();
1924+
19231925
result.push(quote! {
1924-
impl #generics ::std::fmt::Debug for #ty_for_impl {
1926+
impl #generics ::#prefix::fmt::Debug for #ty_for_impl {
19251927
#impl_
19261928
}
19271929
});

0 commit comments

Comments
 (0)