From c3b2f2b0c6f074fb98add56a1977d407e294c9ed Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Thu, 3 Apr 2014 13:53:57 +1300 Subject: Add a span to ast::TyParam --- src/libsyntax/ext/build.rs | 5 ++++- src/libsyntax/ext/deriving/generic.rs | 2 +- src/libsyntax/ext/deriving/ty.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 203edf6590f..c1289ef9858 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -66,6 +66,7 @@ pub trait AstBuilder { fn strip_bounds(&self, bounds: &Generics) -> Generics; fn typaram(&self, + span: Span, id: ast::Ident, bounds: OwnedSlice, default: Option>) -> ast::TyParam; @@ -368,6 +369,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { } fn typaram(&self, + span: Span, id: ast::Ident, bounds: OwnedSlice, default: Option>) -> ast::TyParam { @@ -375,7 +377,8 @@ impl<'a> AstBuilder for ExtCtxt<'a> { ident: id, id: ast::DUMMY_NODE_ID, bounds: bounds, - default: default + default: default, + span: span } } diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 1d4aa08f9e3..c040361a8eb 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -380,7 +380,7 @@ impl<'a> TraitDef<'a> { // require the current trait bounds.push(cx.typarambound(trait_path.clone())); - cx.typaram(ty_param.ident, OwnedSlice::from_vec(bounds), None) + cx.typaram(self.span, ty_param.ident, OwnedSlice::from_vec(bounds), None) })); let trait_generics = Generics { lifetimes: lifetimes, diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index c4ca2601f60..a6bbad62b8e 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -193,7 +193,7 @@ fn mk_ty_param(cx: &ExtCtxt, span: Span, name: &str, bounds: &[Path], let path = b.to_path(cx, span, self_ident, self_generics); cx.typarambound(path) }).collect(); - cx.typaram(cx.ident_of(name), bounds, None) + cx.typaram(span, cx.ident_of(name), bounds, None) } fn mk_generics(lifetimes: Vec , ty_params: Vec ) -> Generics { -- cgit 1.4.1-3-g733a5