diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-12-06 10:50:55 -0800 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-12-09 17:22:07 -0800 |
| commit | 9c7969d3df6ce1cd5370eea32f18a08dc1f0850d (patch) | |
| tree | cb7d5f2d7ed8deaba3a2320a0ea8a4cc1000b600 /src/libsyntax_ext/deriving/bounds.rs | |
| parent | 8db163e53dab4f188a60bf24b4d6ebeb1ea5cab1 (diff) | |
| download | rust-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/bounds.rs')
| -rw-r--r-- | src/libsyntax_ext/deriving/bounds.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libsyntax_ext/deriving/bounds.rs b/src/libsyntax_ext/deriving/bounds.rs index 0bc802283fb..7f03001d9c6 100644 --- a/src/libsyntax_ext/deriving/bounds.rs +++ b/src/libsyntax_ext/deriving/bounds.rs @@ -8,9 +8,9 @@ // 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::*; - use syntax::ast::MetaItem; use syntax::ext::base::{Annotatable, ExtCtxt}; use syntax_pos::Span; @@ -28,15 +28,10 @@ pub fn expand_deriving_copy(cx: &mut ExtCtxt, mitem: &MetaItem, item: &Annotatable, push: &mut FnMut(Annotatable)) { - let mut v = cx.crate_root.map(|s| vec![s]).unwrap_or(Vec::new()); - v.push("marker"); - v.push("Copy"); - let path = Path::new(v); - let trait_def = TraitDef { span, attributes: Vec::new(), - path, + path: path_std!(cx, marker::Copy), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), is_unsafe: false, |
