self.print_lifetime(lifetime)?;
}
}
- hir::TyImplTrait(ref bounds) => {
- self.print_bounds("impl ", &bounds[..])?;
+ hir::TyImplTraitExistential(ref existty, ref _lifetimes) => {
+ self.print_bounds("impl", &existty.bounds[..])?;
+ }
+ hir::TyImplTraitUniversal(_, ref bounds) => {
+ self.print_bounds("impl", &bounds[..])?;
}
hir::TyArray(ref ty, v) => {
self.s.word("[")?;
Fixity::None => (prec + 1, prec + 1),
};
+ let left_prec = match (&lhs.node, op.node) {
+ // These cases need parens: `x as i32 < y` has the parser thinking that `i32 < y` is
+ // the beginning of a path type. It starts trying to parse `x as (i32 < y ...` instead
+ // of `(x as i32) < ...`. We need to convince it _not_ to do that.
+ (&hir::ExprCast { .. }, hir::BinOp_::BiLt) |
+ (&hir::ExprCast { .. }, hir::BinOp_::BiShl) => parser::PREC_FORCE_PAREN,
+ _ => left_prec,
+ };
+
self.print_expr_maybe_paren(lhs, left_prec)?;
self.s.space()?;
self.word_space(op.node.as_str())?;