pub ident: Ident,
pub id: NodeId,
pub bounds: OwnedSlice<TyParamBound>,
- pub default: Option<P<Ty>>
+ pub default: Option<P<Ty>>,
+ pub span: Span
}
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
fn strip_bounds(&self, bounds: &Generics) -> Generics;
fn typaram(&self,
+ span: Span,
id: ast::Ident,
bounds: OwnedSlice<ast::TyParamBound>,
default: Option<P<ast::Ty>>) -> ast::TyParam;
}
fn typaram(&self,
+ span: Span,
id: ast::Ident,
bounds: OwnedSlice<ast::TyParamBound>,
default: Option<P<ast::Ty>>) -> ast::TyParam {
ident: id,
id: ast::DUMMY_NODE_ID,
bounds: bounds,
- default: default
+ default: default,
+ span: span
}
}
// 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,
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<ast::Lifetime> , ty_params: Vec<ast::TyParam> ) -> Generics {
ident: tp.ident,
id: id,
bounds: tp.bounds.map(|x| fold_ty_param_bound(x, fld)),
- default: tp.default.map(|x| fld.fold_ty(x))
+ default: tp.default.map(|x| fld.fold_ty(x)),
+ span: tp.span
}
}
// matches typaram = IDENT optbounds ( EQ ty )?
fn parse_ty_param(&mut self) -> TyParam {
let ident = self.parse_ident();
+ let span = self.span;
let (_, opt_bounds) = self.parse_optional_ty_param_bounds(false);
// For typarams we don't care about the difference b/w "<T>" and "<T:>".
let bounds = opt_bounds.unwrap_or_default();
ident: ident,
id: ast::DUMMY_NODE_ID,
bounds: bounds,
- default: default
+ default: default,
+ span: span,
}
}