pub fn parse_where_clause(&mut self) -> PResult<'a, ast::WhereClause> {
        maybe_whole!(self, NtWhereClause);

        let mut where_clause = WhereClause {
            id: ast::DUMMY_NODE_ID,
            predicates: Vec::new(),
        };

        if !self.eat_keyword(keywords::Where) {
            return Ok(where_clause);
        }

        let mut parsed_something = false;
        loop {
            let lo = self.span.lo;
            match self.token {
                token::OpenDelim(token::Brace) => {
                    break
                }

                token::Lifetime(..) => {
                    let bounded_lifetime =
                        try!(self.parse_lifetime());

                    self.eat(&token::Colon);

                    let bounds =
                        try!(self.parse_lifetimes(token::BinOp(token::Plus)));

                    let hi = self.last_span.hi;
                    let span = mk_sp(lo, hi);

                    where_clause.predicates.push(ast::WherePredicate::RegionPredicate(
                        ast::WhereRegionPredicate {
                            span: span,
                            lifetime: bounded_lifetime,
                            bounds: bounds
                        }
                    ));

                    parsed_something = true;
                }

                _ => {
                    let bound_lifetimes = if self.eat_keyword(keywords::For) {
                        // Higher ranked constraint.
                        try!(self.expect(&token::Lt));
                        let lifetime_defs = try!(self.parse_lifetime_defs());
                        try!(self.expect_gt());
                        lifetime_defs
                    } else {
                        vec![]
                    };

                    let bounded_ty = try!(self.parse_ty());

                    if self.eat(&token::Colon) {
                        let bounds = try!(self.parse_ty_param_bounds(BoundParsingMode::Bare));
                        let hi = self.last_span.hi;
                        let span = mk_sp(lo, hi);

                        if bounds.is_empty() {
                            self.span_err(span,
                                          "each predicate in a `where` clause must have \
                                           at least one bound in it");
                        }

                        where_clause.predicates.push(ast::WherePredicate::BoundPredicate(
                                ast::WhereBoundPredicate {
                                    span: span,
                                    bound_lifetimes: bound_lifetimes,
                                    bounded_ty: bounded_ty,
                                    bounds: bounds,
                        }));

                        parsed_something = true;
                    } else if self.eat(&token::Eq) {
                        // let ty = try!(self.parse_ty());
                        let hi = self.last_span.hi;
                        let span = mk_sp(lo, hi);
                        // where_clause.predicates.push(
                        //     ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {
                        //         id: ast::DUMMY_NODE_ID,
                        //         span: span,
                        //         path: panic!("NYI"), //bounded_ty,
                        //         ty: ty,
                        // }));
                        // parsed_something = true;
                        // // FIXME(#18433)
                        self.span_err(span,
                                     "equality constraints are not yet supported \
                                     in where clauses (#20041)");
                    } else {
                        let last_span = self.last_span;
                        self.span_err(last_span,
                              "unexpected token in `where` clause");
                    }
                }
            };

            if !self.eat(&token::Comma) {
                break
            }
        }

        if !parsed_something {
            let last_span = self.last_span;
            self.span_err(last_span,
                          "a `where` clause must have at least one predicate \
                           in it");
        }

        Ok(where_clause)
    }
/// Parses an optional `where` clause and places it in `generics`.
///
/// ```ignore
/// where T : Trait<U, V> + 'b, 'a : 'b
/// ```
Parses an optional `where` clause and places it in `generics`.
Parses an optional ` where ` clause and places it in ` generics ` .
pub fn parse_where_clause(&mut self) -> PResult<'a, ast::WhereClause> {
        maybe_whole!(self, NtWhereClause);
        let mut where_clause = WhereClause {
            id: ast::DUMMY_NODE_ID,
            predicates: Vec::new(),
        };
        if !self.eat_keyword(keywords::Where) {
            return Ok(where_clause);
        }
        let mut parsed_something = false;
        loop {
            let lo = self.span.lo;
            match self.token {
                token::OpenDelim(token::Brace) => {
                    break
                }
                token::Lifetime(..) => {
                    let bounded_lifetime =
                        try!(self.parse_lifetime());
                    self.eat(&token::Colon);
                    let bounds =
                        try!(self.parse_lifetimes(token::BinOp(token::Plus)));
                    let hi = self.last_span.hi;
                    let span = mk_sp(lo, hi);
                    where_clause.predicates.push(ast::WherePredicate::RegionPredicate(
                        ast::WhereRegionPredicate {
                            span: span,
                            lifetime: bounded_lifetime,
                            bounds: bounds
                        }
                    ));
                    parsed_something = true;
                }
                _ => {
                    let bound_lifetimes = if self.eat_keyword(keywords::For) {
                        // Higher ranked constraint.
                        try!(self.expect(&token::Lt));
                        let lifetime_defs = try!(self.parse_lifetime_defs());
                        try!(self.expect_gt());
                        lifetime_defs
                    } else {
                        vec![]
                    };
                    let bounded_ty = try!(self.parse_ty());
                    if self.eat(&token::Colon) {
                        let bounds = try!(self.parse_ty_param_bounds(BoundParsingMode::Bare));
                        let hi = self.last_span.hi;
                        let span = mk_sp(lo, hi);
                        if bounds.is_empty() {
                            self.span_err(span,
                                          "each predicate in a `where` clause must have \
                                           at least one bound in it");
                        }
                        where_clause.predicates.push(ast::WherePredicate::BoundPredicate(
                                ast::WhereBoundPredicate {
                                    span: span,
                                    bound_lifetimes: bound_lifetimes,
                                    bounded_ty: bounded_ty,
                                    bounds: bounds,
                        }));
                        parsed_something = true;
                    } else if self.eat(&token::Eq) {
                        // let ty = try!(self.parse_ty());
                        let hi = self.last_span.hi;
                        let span = mk_sp(lo, hi);
                        // where_clause.predicates.push(
                        //     ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {
                        //         id: ast::DUMMY_NODE_ID,
                        //         span: span,
                        //         path: panic!("NYI"), //bounded_ty,
                        //         ty: ty,
                        // }));
                        // parsed_something = true;
                        // // FIXME(#18433)
                        self.span_err(span,
                                     "equality constraints are not yet supported \
                                     in where clauses (#20041)");
                    } else {
                        let last_span = self.last_span;
                        self.span_err(last_span,
                              "unexpected token in `where` clause");
                    }
                }
            };
            if !self.eat(&token::Comma) {
                break
            }
        }
        if !parsed_something {
            let last_span = self.last_span;
            self.span_err(last_span,
                          "a `where` clause must have at least one predicate \
                           in it");
        }
        Ok(where_clause)
    }
pub fn parse_where_clause ( & mut self ) -> PResult < ' a , ast :: WhereClause > { maybe_whole ! ( self NtWhereClause ) ; let mut where_clause = WhereClause { id : ast :: DUMMY_NODE_ID , predicates : Vec :: new ( ) , } ; if ! self . eat_keyword ( keywords :: Where ) { return Ok ( where_clause ) ; } let mut parsed_something = false ; loop { let lo = self . span . lo ; match self . token { token :: OpenDelim ( token :: Brace ) => { break } token :: Lifetime ( .. ) => { let bounded_lifetime = try ! ( self parse_lifetime ( ) ) ; self . eat ( & token :: Colon ) ; let bounds = try ! ( self parse_lifetimes ( token BinOp ( token Plus ) ) ) ; let hi = self . last_span . hi ; let span = mk_sp ( lo , hi ) ; where_clause . predicates . push ( ast :: WherePredicate :: RegionPredicate ( ast :: WhereRegionPredicate { span : span , lifetime : bounded_lifetime , bounds : bounds } ) ) ; parsed_something = true ; } _ => { let bound_lifetimes = if self . eat_keyword ( keywords :: For ) { // Higher ranked constraint. try ! ( self expect ( token Lt ) ) ; let lifetime_defs = try ! ( self parse_lifetime_defs ( ) ) ; try ! ( self expect_gt ( ) ) ; lifetime_defs } else { vec ! [ ] } ; let bounded_ty = try ! ( self parse_ty ( ) ) ; if self . eat ( & token :: Colon ) { let bounds = try ! ( self parse_ty_param_bounds ( BoundParsingMode Bare ) ) ; let hi = self . last_span . hi ; let span = mk_sp ( lo , hi ) ; if bounds . is_empty ( ) { self . span_err ( span , " \
 " ) ; } where_clause . predicates . push ( ast :: WherePredicate :: BoundPredicate ( ast :: WhereBoundPredicate { span : span , bound_lifetimes : bound_lifetimes , bounded_ty : bounded_ty , bounds : bounds , } ) ) ; parsed_something = true ; } else if self . eat ( & token :: Eq ) { // let ty = try!(self.parse_ty()); let hi = self . last_span . hi ; let span = mk_sp ( lo , hi ) ; // where_clause.predicates.push( //     ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { //         id: ast::DUMMY_NODE_ID, //         span: span, //         path: panic!("NYI"), //bounded_ty, //         ty: ty, // })); // parsed_something = true; // // FIXME(#18433) self . span_err ( span , " \
 " ) ; } else { let last_span = self . last_span ; self . span_err ( last_span , " " ) ; } } } ; if ! self . eat ( & token :: Comma ) { break } } if ! parsed_something { let last_span = self . last_span ; self . span_err ( last_span , " \
 " ) ; } Ok ( where_clause ) }
Parses an optional `where` clause and places it in `generics`.
Parses an optional ` where ` clause and places it in ` generics ` .
&mut self
&mut self