diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-03-25 21:14:18 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-05-25 05:52:09 +0000 |
| commit | 7fdc1fb2e40bc8fc5f1f59eb3b9d180619bcb210 (patch) | |
| tree | 3eafc3d795855f4eee2360daa08ac0144aa3104d /src/libsyntax_ext/deriving | |
| parent | 8497061a49cde5b70c416f2c964d1f252d82a7a0 (diff) | |
| download | rust-7fdc1fb2e40bc8fc5f1f59eb3b9d180619bcb210.tar.gz rust-7fdc1fb2e40bc8fc5f1f59eb3b9d180619bcb210.zip | |
Hygienize lifetimes.
Diffstat (limited to 'src/libsyntax_ext/deriving')
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/ty.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax_ext/deriving/generic/ty.rs b/src/libsyntax_ext/deriving/generic/ty.rs index cfd52381538..9c89f99cbb5 100644 --- a/src/libsyntax_ext/deriving/generic/ty.rs +++ b/src/libsyntax_ext/deriving/generic/ty.rs @@ -118,14 +118,14 @@ pub fn nil_ty<'r>() -> Ty<'r> { fn mk_lifetime(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Option<ast::Lifetime> { match *lt { - Some(ref s) => Some(cx.lifetime(span, cx.ident_of(*s).name)), + Some(s) => Some(cx.lifetime(span, Ident::from_str(s))), None => None, } } fn mk_lifetimes(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Vec<ast::Lifetime> { match *lt { - Some(ref s) => vec![cx.lifetime(span, cx.ident_of(*s).name)], + Some(s) => vec![cx.lifetime(span, Ident::from_str(s))], None => vec![], } } @@ -243,11 +243,11 @@ impl<'a> LifetimeBounds<'a> { -> Generics { let lifetimes = self.lifetimes .iter() - .map(|&(ref lt, ref bounds)| { + .map(|&(lt, ref bounds)| { let bounds = bounds.iter() - .map(|b| cx.lifetime(span, cx.ident_of(*b).name)) + .map(|b| cx.lifetime(span, Ident::from_str(b))) .collect(); - cx.lifetime_def(span, cx.ident_of(*lt).name, vec![], bounds) + cx.lifetime_def(span, Ident::from_str(lt), vec![], bounds) }) .collect(); let ty_params = self.bounds @@ -277,7 +277,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, respan(span, match *ptr { Borrowed(ref lt, mutbl) => { - let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s).name)); + let lt = lt.map(|s| cx.lifetime(span, Ident::from_str(s))); SelfKind::Region(lt, mutbl) } Raw(_) => { |
