Skip to content

Commit 3d109ca

Browse files
bugadaniManishearth
authored andcommitted
Reference _the_ core module
1 parent e500225 commit 3d109ca

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/expand.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn specialization() -> TokenStream {
3636
fn __displaydoc_display(&self) -> Self;
3737
}
3838

39-
impl<T: core::fmt::Display> DisplayToDisplayDoc for &T {
39+
impl<T: ::core::fmt::Display> DisplayToDisplayDoc for &T {
4040
fn __displaydoc_display(&self) -> Self {
4141
self
4242
}
@@ -49,17 +49,17 @@ fn specialization() -> TokenStream {
4949
extern crate std;
5050

5151
trait PathToDisplayDoc {
52-
fn __displaydoc_display(&self) -> std::path::Display<'_>;
52+
fn __displaydoc_display(&self) -> ::std::path::Display<'_>;
5353
}
5454

55-
impl PathToDisplayDoc for std::path::Path {
56-
fn __displaydoc_display(&self) -> std::path::Display<'_> {
55+
impl PathToDisplayDoc for ::std::path::Path {
56+
fn __displaydoc_display(&self) -> ::std::path::Display<'_> {
5757
self.display()
5858
}
5959
}
6060

61-
impl PathToDisplayDoc for std::path::PathBuf {
62-
fn __displaydoc_display(&self) -> std::path::Display<'_> {
61+
impl PathToDisplayDoc for ::std::path::PathBuf {
62+
fn __displaydoc_display(&self) -> ::std::path::Display<'_> {
6363
self.display()
6464
}
6565
}
@@ -91,8 +91,8 @@ fn impl_struct(input: &DeriveInput, data: &DataStruct) -> Result<TokenStream> {
9191
Fields::Unit => quote!(_),
9292
};
9393
quote! {
94-
impl #impl_generics core::fmt::Display for #ty #ty_generics #where_clause {
95-
fn fmt(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
94+
impl #impl_generics ::core::fmt::Display for #ty #ty_generics #where_clause {
95+
fn fmt(&self, formatter: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
9696
// NB: This destructures the fields of `self` into named variables (for unnamed
9797
// fields, it uses _0, _1, etc as above). The `#[allow(unused_variables)]`
9898
// section means it doesn't have to parse the individual field references out of
@@ -366,8 +366,8 @@ fn impl_enum(input: &DeriveInput, data: &DataEnum) -> Result<TokenStream> {
366366

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

0 commit comments

Comments
 (0)