|
2 | 2 | #![recursion_limit = "256"]
|
3 | 3 |
|
4 | 4 | use rustc_ast as ast;
|
| 5 | +use rustc_ast::{BorrowKind, CaptureBy, IsAuto, ImplPolarity, Mutability}; |
5 | 6 | use rustc_ast::util::parser::{self, AssocOp, Fixity};
|
6 | 7 | use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent};
|
7 | 8 | use rustc_ast_pretty::pp::{self, Breaks};
|
@@ -477,7 +478,7 @@ impl<'a> State<'a> {
|
477 | 478 | }
|
478 | 479 | hir::ForeignItemKind::Static(ref t, m) => {
|
479 | 480 | self.head(visibility_qualified(&item.vis, "static"));
|
480 |
| - if m == hir::Mutability::Mut { |
| 481 | + if m == Mutability::Mut { |
481 | 482 | self.word_space("mut");
|
482 | 483 | }
|
483 | 484 | self.print_ident(item.ident);
|
@@ -598,7 +599,7 @@ impl<'a> State<'a> {
|
598 | 599 | }
|
599 | 600 | hir::ItemKind::Static(ref ty, m, expr) => {
|
600 | 601 | self.head(visibility_qualified(&item.vis, "static"));
|
601 |
| - if m == hir::Mutability::Mut { |
| 602 | + if m == Mutability::Mut { |
602 | 603 | self.word_space("mut");
|
603 | 604 | }
|
604 | 605 | self.print_ident(item.ident);
|
@@ -719,7 +720,7 @@ impl<'a> State<'a> {
|
719 | 720 | self.word_nbsp("const");
|
720 | 721 | }
|
721 | 722 |
|
722 |
| - if let hir::ImplPolarity::Negative(_) = polarity { |
| 723 | + if let ImplPolarity::Negative(_) = polarity { |
723 | 724 | self.s.word("!");
|
724 | 725 | }
|
725 | 726 |
|
@@ -1257,14 +1258,14 @@ impl<'a> State<'a> {
|
1257 | 1258 |
|
1258 | 1259 | fn print_expr_addr_of(
|
1259 | 1260 | &mut self,
|
1260 |
| - kind: hir::BorrowKind, |
1261 |
| - mutability: hir::Mutability, |
| 1261 | + kind: BorrowKind, |
| 1262 | + mutability: Mutability, |
1262 | 1263 | expr: &hir::Expr<'_>,
|
1263 | 1264 | ) {
|
1264 | 1265 | self.s.word("&");
|
1265 | 1266 | match kind {
|
1266 |
| - hir::BorrowKind::Ref => self.print_mutability(mutability, false), |
1267 |
| - hir::BorrowKind::Raw => { |
| 1267 | + BorrowKind::Ref => self.print_mutability(mutability, false), |
| 1268 | + BorrowKind::Raw => { |
1268 | 1269 | self.word_nbsp("raw");
|
1269 | 1270 | self.print_mutability(mutability, true);
|
1270 | 1271 | }
|
@@ -1825,11 +1826,11 @@ impl<'a> State<'a> {
|
1825 | 1826 | match binding_mode {
|
1826 | 1827 | hir::BindingAnnotation::Ref => {
|
1827 | 1828 | self.word_nbsp("ref");
|
1828 |
| - self.print_mutability(hir::Mutability::Not, false); |
| 1829 | + self.print_mutability(Mutability::Not, false); |
1829 | 1830 | }
|
1830 | 1831 | hir::BindingAnnotation::RefMut => {
|
1831 | 1832 | self.word_nbsp("ref");
|
1832 |
| - self.print_mutability(hir::Mutability::Mut, false); |
| 1833 | + self.print_mutability(Mutability::Mut, false); |
1833 | 1834 | }
|
1834 | 1835 | hir::BindingAnnotation::Unannotated => {}
|
1835 | 1836 | hir::BindingAnnotation::Mutable => {
|
@@ -2114,10 +2115,10 @@ impl<'a> State<'a> {
|
2114 | 2115 | }
|
2115 | 2116 | }
|
2116 | 2117 |
|
2117 |
| - pub fn print_capture_clause(&mut self, capture_clause: hir::CaptureBy) { |
| 2118 | + pub fn print_capture_clause(&mut self, capture_clause: CaptureBy) { |
2118 | 2119 | match capture_clause {
|
2119 |
| - hir::CaptureBy::Value => self.word_space("move"), |
2120 |
| - hir::CaptureBy::Ref => {} |
| 2120 | + CaptureBy::Value => self.word_space("move"), |
| 2121 | + CaptureBy::Ref => {} |
2121 | 2122 | }
|
2122 | 2123 | }
|
2123 | 2124 |
|
@@ -2268,10 +2269,10 @@ impl<'a> State<'a> {
|
2268 | 2269 | }
|
2269 | 2270 | }
|
2270 | 2271 |
|
2271 |
| - pub fn print_mutability(&mut self, mutbl: hir::Mutability, print_const: bool) { |
| 2272 | + pub fn print_mutability(&mut self, mutbl: Mutability, print_const: bool) { |
2272 | 2273 | match mutbl {
|
2273 |
| - hir::Mutability::Mut => self.word_nbsp("mut"), |
2274 |
| - hir::Mutability::Not => { |
| 2274 | + Mutability::Mut => self.word_nbsp("mut"), |
| 2275 | + Mutability::Not => { |
2275 | 2276 | if print_const {
|
2276 | 2277 | self.word_nbsp("const")
|
2277 | 2278 | }
|
@@ -2410,10 +2411,10 @@ impl<'a> State<'a> {
|
2410 | 2411 | }
|
2411 | 2412 | }
|
2412 | 2413 |
|
2413 |
| - pub fn print_is_auto(&mut self, s: hir::IsAuto) { |
| 2414 | + pub fn print_is_auto(&mut self, s: IsAuto) { |
2414 | 2415 | match s {
|
2415 |
| - hir::IsAuto::Yes => self.word_nbsp("auto"), |
2416 |
| - hir::IsAuto::No => {} |
| 2416 | + IsAuto::Yes => self.word_nbsp("auto"), |
| 2417 | + IsAuto::No => {} |
2417 | 2418 | }
|
2418 | 2419 | }
|
2419 | 2420 | }
|
|
0 commit comments