Add parser support for generalized where clauses
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
This commit is contained in:
@@ -814,17 +814,24 @@ pub fn noop_fold_where_predicate<T: Folder>(
|
||||
fld: &mut T)
|
||||
-> WherePredicate {
|
||||
match pred {
|
||||
ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate{id,
|
||||
ident,
|
||||
ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate{bounded_ty,
|
||||
bounds,
|
||||
span}) => {
|
||||
ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate {
|
||||
id: fld.new_id(id),
|
||||
ident: fld.fold_ident(ident),
|
||||
bounded_ty: fld.fold_ty(bounded_ty),
|
||||
bounds: bounds.move_map(|x| fld.fold_ty_param_bound(x)),
|
||||
span: fld.new_span(span)
|
||||
})
|
||||
}
|
||||
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{lifetime,
|
||||
bound,
|
||||
span}) => {
|
||||
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate {
|
||||
span: fld.new_span(span),
|
||||
lifetime: fld.fold_lifetime(lifetime),
|
||||
bound: fld.fold_lifetime(bound)
|
||||
})
|
||||
}
|
||||
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{id,
|
||||
path,
|
||||
ty,
|
||||
|
||||
Reference in New Issue
Block a user