From f10f50b42639718b2580d10802f05f2b6ff209d5 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Mon, 5 Dec 2016 03:51:11 +0000 Subject: Refactor how global paths are represented (for both ast and hir). --- src/libsyntax_ext/concat_idents.rs | 1 - src/libsyntax_ext/deriving/generic/mod.rs | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/concat_idents.rs b/src/libsyntax_ext/concat_idents.rs index 1381490efa1..1fc1bdff593 100644 --- a/src/libsyntax_ext/concat_idents.rs +++ b/src/libsyntax_ext/concat_idents.rs @@ -61,7 +61,6 @@ pub fn expand_syntax_ext<'cx>(cx: &'cx mut ExtCtxt, fn path(&self) -> ast::Path { ast::Path { span: self.span, - global: false, segments: vec![self.ident.into()], } } diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 51199819dfc..7f187d8d1c1 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -363,15 +363,12 @@ fn find_type_parameters(ty: &ast::Ty, impl<'a, 'b> visit::Visitor<'a> for Visitor<'a, 'b> { fn visit_ty(&mut self, ty: &'a ast::Ty) { - match ty.node { - ast::TyKind::Path(_, ref path) if !path.global => { - if let Some(segment) = path.segments.first() { - if self.ty_param_names.contains(&segment.identifier.name) { - self.types.push(P(ty.clone())); - } + if let ast::TyKind::Path(_, ref path) = ty.node { + if let Some(segment) = path.segments.first() { + if self.ty_param_names.contains(&segment.identifier.name) { + self.types.push(P(ty.clone())); } } - _ => {} } visit::walk_ty(self, ty) -- cgit 1.4.1-3-g733a5