}
/// Parse a list of paths inside `#[derive(path_0, ..., path_n)]`.
- crate fn parse_derive_paths(&mut self) -> PResult<'a, Vec<Path>> {
+ pub fn parse_derive_paths(&mut self) -> PResult<'a, Vec<Path>> {
self.expect(&token::OpenDelim(token::Paren))?;
let mut list = Vec::new();
while !self.eat(&token::CloseDelim(token::Paren)) {
// Parse lifetime argument.
args.push(GenericArg::Lifetime(self.expect_lifetime()));
misplaced_assoc_ty_constraints.append(&mut assoc_ty_constraints);
- } else if self.check_ident() && self.look_ahead(1,
- |t| t == &token::Eq || t == &token::Colon) {
+ } else if self.check_ident()
+ && self.look_ahead(1, |t| t == &token::Eq || t == &token::Colon)
+ {
// Parse associated type constraint.
let lo = self.token.span;
let ident = self.parse_ident()?;
} else {
unreachable!();
};
+
let span = lo.to(self.prev_span);
+
+ // Gate associated type bounds, e.g., `Iterator<Item: Ord>`.
+ if let AssocTyConstraintKind::Bound { .. } = kind {
+ self.sess.gated_spans.associated_type_bounds.borrow_mut().push(span);
+ }
+
constraints.push(AssocTyConstraint {
id: ast::DUMMY_NODE_ID,
ident,