about summary refs log tree commit diff
path: root/src/libsyntax_ext/deriving/debug.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-12-06 10:50:55 -0800
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-12-09 17:22:07 -0800
commit9c7969d3df6ce1cd5370eea32f18a08dc1f0850d (patch)
treecb7d5f2d7ed8deaba3a2320a0ea8a4cc1000b600 /src/libsyntax_ext/deriving/debug.rs
parent8db163e53dab4f188a60bf24b4d6ebeb1ea5cab1 (diff)
downloadrust-9c7969d3df6ce1cd5370eea32f18a08dc1f0850d.tar.gz
rust-9c7969d3df6ce1cd5370eea32f18a08dc1f0850d.zip
Use hygiene to access the injected crate (`core` or `std`) from builtin macros.
Diffstat (limited to 'src/libsyntax_ext/deriving/debug.rs')
-rw-r--r--src/libsyntax_ext/deriving/debug.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs
index ab6dd04520c..82fc09fca69 100644
--- a/src/libsyntax_ext/deriving/debug.rs
+++ b/src/libsyntax_ext/deriving/debug.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use deriving::path_std;
 use deriving::generic::*;
 use deriving::generic::ty::*;
 
@@ -24,13 +25,13 @@ pub fn expand_deriving_debug(cx: &mut ExtCtxt,
                              item: &Annotatable,
                              push: &mut FnMut(Annotatable)) {
     // &mut ::std::fmt::Formatter
-    let fmtr = Ptr(Box::new(Literal(path_std!(cx, core::fmt::Formatter))),
+    let fmtr = Ptr(Box::new(Literal(path_std!(cx, fmt::Formatter))),
                    Borrowed(None, ast::Mutability::Mutable));
 
     let trait_def = TraitDef {
         span,
         attributes: Vec::new(),
-        path: path_std!(cx, core::fmt::Debug),
+        path: path_std!(cx, fmt::Debug),
         additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
         is_unsafe: false,
@@ -40,7 +41,7 @@ pub fn expand_deriving_debug(cx: &mut ExtCtxt,
                           generics: LifetimeBounds::empty(),
                           explicit_self: borrowed_explicit_self(),
                           args: vec![fmtr],
-                          ret_ty: Literal(path_std!(cx, core::fmt::Result)),
+                          ret_ty: Literal(path_std!(cx, fmt::Result)),
                           attributes: Vec::new(),
                           is_unsafe: false,
                           unify_fieldless_variants: false,