1
1
// The Rust abstract syntax tree.
2
2
3
- pub use self :: GenericArgs :: * ;
4
- pub use self :: UnsafeSource :: * ;
5
- pub use symbol:: { Ident , Symbol as Name } ;
6
- pub use util:: parser:: ExprPrecedence ;
7
-
8
- use ext:: hygiene:: { Mark , SyntaxContext } ;
9
- use print:: pprust;
10
- use ptr:: P ;
3
+ pub use GenericArgs :: * ;
4
+ pub use UnsafeSource :: * ;
5
+ pub use crate :: symbol:: { Ident , Symbol as Name } ;
6
+ pub use crate :: util:: parser:: ExprPrecedence ;
7
+
8
+ use crate :: ext:: hygiene:: { Mark , SyntaxContext } ;
9
+ use crate :: print:: pprust;
10
+ use crate :: ptr:: P ;
11
+ use crate :: source_map:: { dummy_spanned, respan, Spanned } ;
12
+ use crate :: symbol:: { keywords, Symbol } ;
13
+ use crate :: tokenstream:: TokenStream ;
14
+ use crate :: ThinVec ;
15
+
11
16
use rustc_data_structures:: indexed_vec:: Idx ;
12
17
#[ cfg( target_arch = "x86_64" ) ]
13
18
use rustc_data_structures:: static_assert;
14
19
use rustc_target:: spec:: abi:: Abi ;
15
- use source_map:: { dummy_spanned, respan, Spanned } ;
16
- use symbol:: { keywords, Symbol } ;
17
20
use syntax_pos:: { Span , DUMMY_SP } ;
18
- use tokenstream:: TokenStream ;
19
- use ThinVec ;
20
21
21
22
use rustc_data_structures:: fx:: FxHashSet ;
22
23
use rustc_data_structures:: sync:: Lrc ;
@@ -31,7 +32,7 @@ pub struct Label {
31
32
}
32
33
33
34
impl fmt:: Debug for Label {
34
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
35
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
35
36
write ! ( f, "label({:?})" , self . ident)
36
37
}
37
38
}
@@ -43,7 +44,7 @@ pub struct Lifetime {
43
44
}
44
45
45
46
impl fmt:: Debug for Lifetime {
46
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
47
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
47
48
write ! (
48
49
f,
49
50
"lifetime({}: {})" ,
@@ -74,13 +75,13 @@ impl<'a> PartialEq<&'a str> for Path {
74
75
}
75
76
76
77
impl fmt:: Debug for Path {
77
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
78
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
78
79
write ! ( f, "path({})" , pprust:: path_to_string( self ) )
79
80
}
80
81
}
81
82
82
83
impl fmt:: Display for Path {
83
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
84
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
84
85
write ! ( f, "{}" , pprust:: path_to_string( self ) )
85
86
}
86
87
}
@@ -219,6 +220,7 @@ impl ParenthesizedArgs {
219
220
// hack to ensure that we don't try to access the private parts of `NodeId` in this module
220
221
mod node_id_inner {
221
222
use rustc_data_structures:: indexed_vec:: Idx ;
223
+ use rustc_data_structures:: newtype_index;
222
224
newtype_index ! {
223
225
pub struct NodeId {
224
226
ENCODABLE = custom
@@ -227,7 +229,7 @@ mod node_id_inner {
227
229
}
228
230
}
229
231
230
- pub use self :: node_id_inner:: NodeId ;
232
+ pub use node_id_inner:: NodeId ;
231
233
232
234
impl NodeId {
233
235
pub fn placeholder_from_mark ( mark : Mark ) -> Self {
@@ -240,7 +242,7 @@ impl NodeId {
240
242
}
241
243
242
244
impl fmt:: Display for NodeId {
243
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
245
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
244
246
fmt:: Display :: fmt ( & self . as_u32 ( ) , f)
245
247
}
246
248
}
@@ -478,7 +480,7 @@ pub struct Pat {
478
480
}
479
481
480
482
impl fmt:: Debug for Pat {
481
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
483
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
482
484
write ! ( f, "pat({}: {})" , self . id, pprust:: pat_to_string( self ) )
483
485
}
484
486
}
@@ -676,7 +678,7 @@ pub enum BinOpKind {
676
678
677
679
impl BinOpKind {
678
680
pub fn to_string ( & self ) -> & ' static str {
679
- use self :: BinOpKind :: * ;
681
+ use BinOpKind :: * ;
680
682
match * self {
681
683
Add => "+" ,
682
684
Sub => "-" ,
@@ -713,7 +715,7 @@ impl BinOpKind {
713
715
}
714
716
715
717
pub fn is_comparison ( & self ) -> bool {
716
- use self :: BinOpKind :: * ;
718
+ use BinOpKind :: * ;
717
719
match * self {
718
720
Eq | Lt | Le | Ne | Gt | Ge => true ,
719
721
And | Or | Add | Sub | Mul | Div | Rem | BitXor | BitAnd | BitOr | Shl | Shr => false ,
@@ -792,7 +794,7 @@ impl Stmt {
792
794
}
793
795
794
796
impl fmt:: Debug for Stmt {
795
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
797
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
796
798
write ! (
797
799
f,
798
800
"stmt({}: {})" ,
@@ -1030,7 +1032,7 @@ impl Expr {
1030
1032
}
1031
1033
1032
1034
impl fmt:: Debug for Expr {
1033
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1035
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1034
1036
write ! ( f, "expr({}: {})" , self . id, pprust:: expr_to_string( self ) )
1035
1037
}
1036
1038
}
@@ -1438,13 +1440,13 @@ pub enum IntTy {
1438
1440
}
1439
1441
1440
1442
impl fmt:: Debug for IntTy {
1441
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1443
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1442
1444
fmt:: Display :: fmt ( self , f)
1443
1445
}
1444
1446
}
1445
1447
1446
1448
impl fmt:: Display for IntTy {
1447
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1449
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1448
1450
write ! ( f, "{}" , self . ty_to_string( ) )
1449
1451
}
1450
1452
}
@@ -1519,13 +1521,13 @@ impl UintTy {
1519
1521
}
1520
1522
1521
1523
impl fmt:: Debug for UintTy {
1522
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1524
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1523
1525
fmt:: Display :: fmt ( self , f)
1524
1526
}
1525
1527
}
1526
1528
1527
1529
impl fmt:: Display for UintTy {
1528
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1530
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1529
1531
write ! ( f, "{}" , self . ty_to_string( ) )
1530
1532
}
1531
1533
}
@@ -1547,7 +1549,7 @@ pub struct Ty {
1547
1549
}
1548
1550
1549
1551
impl fmt:: Debug for Ty {
1550
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1552
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1551
1553
write ! ( f, "type({})" , pprust:: ty_to_string( self ) )
1552
1554
}
1553
1555
}
@@ -1832,7 +1834,7 @@ pub enum Defaultness {
1832
1834
}
1833
1835
1834
1836
impl fmt:: Display for Unsafety {
1835
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1837
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1836
1838
fmt:: Display :: fmt (
1837
1839
match * self {
1838
1840
Unsafety :: Normal => "normal" ,
@@ -1852,7 +1854,7 @@ pub enum ImplPolarity {
1852
1854
}
1853
1855
1854
1856
impl fmt:: Debug for ImplPolarity {
1855
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1857
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1856
1858
match * self {
1857
1859
ImplPolarity :: Positive => "positive" . fmt ( f) ,
1858
1860
ImplPolarity :: Negative => "negative" . fmt ( f) ,
0 commit comments