Skip to content

Commit 8416762

Browse files
authored
Merge pull request #45 from bugadani/core
Reference _the_ core module
2 parents 899662c + 638f5b0 commit 8416762

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/expand.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn specialization() -> TokenStream {
3535
fn __displaydoc_display(&self) -> Self;
3636
}
3737

38-
impl<T: core::fmt::Display> DisplayToDisplayDoc for &T {
38+
impl<T: ::core::fmt::Display> DisplayToDisplayDoc for &T {
3939
fn __displaydoc_display(&self) -> Self {
4040
self
4141
}
@@ -90,8 +90,8 @@ fn impl_struct(input: &DeriveInput, data: &DataStruct) -> Result<TokenStream> {
9090
Fields::Unit => quote!(_),
9191
};
9292
quote! {
93-
impl #impl_generics core::fmt::Display for #ty #ty_generics #where_clause {
94-
fn fmt(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
93+
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause {
94+
fn fmt(&self, formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
9595
// NB: This destructures the fields of `self` into named variables (for unnamed
9696
// fields, it uses _0, _1, etc as above). The `#[allow(unused_variables)]`
9797
// section means it doesn't have to parse the individual field references out of
@@ -365,8 +365,8 @@ fn impl_enum(input: &DeriveInput, data: &DataEnum) -> Result<TokenStream> {
365365

366366
if data.variants.is_empty() {
367367
Ok(quote! {
368-
impl #impl_generics core::fmt::Display for #ty #ty_generics #where_clause {
369-
fn fmt(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
368+
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause {
369+
fn fmt(&self, formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
370370
unreachable!("empty enums cannot be instantiated and thus cannot be printed")
371371
}
372372
}
@@ -394,8 +394,8 @@ fn impl_enum(input: &DeriveInput, data: &DataEnum) -> Result<TokenStream> {
394394
})
395395
.collect::<Result<Vec<_>>>()?;
396396
Ok(quote! {
397-
impl #impl_generics core::fmt::Display for #ty #ty_generics #where_clause {
398-
fn fmt(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
397+
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause {
398+
fn fmt(&self, formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
399399
#[allow(unused_variables)]
400400
match self {
401401
#(#arms,)*

0 commit comments

Comments
 (0)