14
14
//! - [`Generics`], [`GenericParam`], [`WhereClause`]: Metadata associated with generic parameters.
15
15
//! - [`EnumDef`] and [`Variant`]: Enum declaration.
16
16
//! - [`Lit`] and [`LitKind`]: Literal expressions.
17
- //! - [`MacroDef`], [`MacStmtStyle`], [`Mac `], [`MacDelimeter`]: Macro definition and invocation.
17
+ //! - [`MacroDef`], [`MacStmtStyle`], [`MacCall `], [`MacDelimeter`]: Macro definition and invocation.
18
18
//! - [`Attribute`]: Metadata associated with item.
19
19
//! - [`UnOp`], [`UnOpKind`], [`BinOp`], [`BinOpKind`]: Unary and binary operators.
20
20
@@ -513,7 +513,7 @@ impl Pat {
513
513
TyKind :: Path ( None , Path :: from_ident ( * ident) )
514
514
}
515
515
PatKind :: Path ( qself, path) => TyKind :: Path ( qself. clone ( ) , path. clone ( ) ) ,
516
- PatKind :: Mac ( mac) => TyKind :: Mac ( mac. clone ( ) ) ,
516
+ PatKind :: MacCall ( mac) => TyKind :: MacCall ( mac. clone ( ) ) ,
517
517
// `&mut? P` can be reinterpreted as `&mut? T` where `T` is `P` reparsed as a type.
518
518
PatKind :: Ref ( pat, mutbl) => {
519
519
pat. to_ty ( ) . map ( |ty| TyKind :: Rptr ( None , MutTy { ty, mutbl : * mutbl } ) ) ?
@@ -567,7 +567,7 @@ impl Pat {
567
567
| PatKind :: Range ( ..)
568
568
| PatKind :: Ident ( ..)
569
569
| PatKind :: Path ( ..)
570
- | PatKind :: Mac ( _) => { }
570
+ | PatKind :: MacCall ( _) => { }
571
571
}
572
572
}
573
573
@@ -682,7 +682,7 @@ pub enum PatKind {
682
682
Paren ( P < Pat > ) ,
683
683
684
684
/// A macro pattern; pre-expansion.
685
- Mac ( Mac ) ,
685
+ MacCall ( MacCall ) ,
686
686
}
687
687
688
688
#[ derive(
@@ -881,9 +881,9 @@ impl Stmt {
881
881
pub fn add_trailing_semicolon ( mut self ) -> Self {
882
882
self . kind = match self . kind {
883
883
StmtKind :: Expr ( expr) => StmtKind :: Semi ( expr) ,
884
- StmtKind :: Mac ( mac) => {
885
- StmtKind :: Mac ( mac. map ( |( mac, _style, attrs) | ( mac, MacStmtStyle :: Semicolon , attrs) ) )
886
- }
884
+ StmtKind :: MacCall ( mac) => StmtKind :: MacCall (
885
+ mac. map ( |( mac, _style, attrs) | ( mac, MacStmtStyle :: Semicolon , attrs) ) ,
886
+ ) ,
887
887
kind => kind,
888
888
} ;
889
889
self
@@ -917,7 +917,7 @@ pub enum StmtKind {
917
917
/// Just a trailing semi-colon.
918
918
Empty ,
919
919
/// Macro.
920
- Mac ( P < ( Mac , MacStmtStyle , AttrVec ) > ) ,
920
+ MacCall ( P < ( MacCall , MacStmtStyle , AttrVec ) > ) ,
921
921
}
922
922
923
923
#[ derive( Clone , Copy , PartialEq , RustcEncodable , RustcDecodable , Debug ) ]
@@ -1057,7 +1057,7 @@ impl Expr {
1057
1057
let kind = match & self . kind {
1058
1058
// Trivial conversions.
1059
1059
ExprKind :: Path ( qself, path) => TyKind :: Path ( qself. clone ( ) , path. clone ( ) ) ,
1060
- ExprKind :: Mac ( mac) => TyKind :: Mac ( mac. clone ( ) ) ,
1060
+ ExprKind :: MacCall ( mac) => TyKind :: MacCall ( mac. clone ( ) ) ,
1061
1061
1062
1062
ExprKind :: Paren ( expr) => expr. to_ty ( ) . map ( TyKind :: Paren ) ?,
1063
1063
@@ -1127,7 +1127,7 @@ impl Expr {
1127
1127
ExprKind :: Continue ( ..) => ExprPrecedence :: Continue ,
1128
1128
ExprKind :: Ret ( ..) => ExprPrecedence :: Ret ,
1129
1129
ExprKind :: InlineAsm ( ..) => ExprPrecedence :: InlineAsm ,
1130
- ExprKind :: Mac ( ..) => ExprPrecedence :: Mac ,
1130
+ ExprKind :: MacCall ( ..) => ExprPrecedence :: Mac ,
1131
1131
ExprKind :: Struct ( ..) => ExprPrecedence :: Struct ,
1132
1132
ExprKind :: Repeat ( ..) => ExprPrecedence :: Repeat ,
1133
1133
ExprKind :: Paren ( ..) => ExprPrecedence :: Paren ,
@@ -1259,7 +1259,7 @@ pub enum ExprKind {
1259
1259
InlineAsm ( P < InlineAsm > ) ,
1260
1260
1261
1261
/// A macro invocation; pre-expansion.
1262
- Mac ( Mac ) ,
1262
+ MacCall ( MacCall ) ,
1263
1263
1264
1264
/// A struct literal expression.
1265
1265
///
@@ -1345,13 +1345,13 @@ pub enum Movability {
1345
1345
/// Represents a macro invocation. The `path` indicates which macro
1346
1346
/// is being invoked, and the `args` are arguments passed to it.
1347
1347
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1348
- pub struct Mac {
1348
+ pub struct MacCall {
1349
1349
pub path : Path ,
1350
1350
pub args : P < MacArgs > ,
1351
1351
pub prior_type_ascription : Option < ( Span , bool ) > ,
1352
1352
}
1353
1353
1354
- impl Mac {
1354
+ impl MacCall {
1355
1355
pub fn span ( & self ) -> Span {
1356
1356
self . path . span . to ( self . args . span ( ) . unwrap_or ( self . path . span ) )
1357
1357
}
@@ -1881,7 +1881,7 @@ pub enum TyKind {
1881
1881
/// Inferred type of a `self` or `&self` argument in a method.
1882
1882
ImplicitSelf ,
1883
1883
/// A macro in the type position.
1884
- Mac ( Mac ) ,
1884
+ MacCall ( MacCall ) ,
1885
1885
/// Placeholder for a kind that has failed to be defined.
1886
1886
Err ,
1887
1887
/// Placeholder for a `va_list`.
@@ -2574,7 +2574,7 @@ pub enum ItemKind {
2574
2574
/// A macro invocation.
2575
2575
///
2576
2576
/// E.g., `foo!(..)`.
2577
- Mac ( Mac ) ,
2577
+ MacCall ( MacCall ) ,
2578
2578
2579
2579
/// A macro definition.
2580
2580
MacroDef ( MacroDef ) ,
@@ -2586,7 +2586,7 @@ impl ItemKind {
2586
2586
match self {
2587
2587
Use ( ..) | Static ( ..) | Const ( ..) | Fn ( ..) | Mod ( ..) | GlobalAsm ( ..) | TyAlias ( ..)
2588
2588
| Struct ( ..) | Union ( ..) | Trait ( ..) | TraitAlias ( ..) | MacroDef ( ..) => "a" ,
2589
- ExternCrate ( ..) | ForeignMod ( ..) | Mac ( ..) | Enum ( ..) | Impl { .. } => "an" ,
2589
+ ExternCrate ( ..) | ForeignMod ( ..) | MacCall ( ..) | Enum ( ..) | Impl { .. } => "an" ,
2590
2590
}
2591
2591
}
2592
2592
@@ -2606,7 +2606,7 @@ impl ItemKind {
2606
2606
ItemKind :: Union ( ..) => "union" ,
2607
2607
ItemKind :: Trait ( ..) => "trait" ,
2608
2608
ItemKind :: TraitAlias ( ..) => "trait alias" ,
2609
- ItemKind :: Mac ( ..) => "item macro invocation" ,
2609
+ ItemKind :: MacCall ( ..) => "item macro invocation" ,
2610
2610
ItemKind :: MacroDef ( ..) => "macro definition" ,
2611
2611
ItemKind :: Impl { .. } => "implementation" ,
2612
2612
}
@@ -2648,14 +2648,14 @@ pub enum AssocItemKind {
2648
2648
/// An associated type.
2649
2649
TyAlias ( Defaultness , Generics , GenericBounds , Option < P < Ty > > ) ,
2650
2650
/// A macro expanding to associated items.
2651
- Macro ( Mac ) ,
2651
+ MacCall ( MacCall ) ,
2652
2652
}
2653
2653
2654
2654
impl AssocItemKind {
2655
2655
pub fn defaultness ( & self ) -> Defaultness {
2656
2656
match * self {
2657
2657
Self :: Const ( def, ..) | Self :: Fn ( def, ..) | Self :: TyAlias ( def, ..) => def,
2658
- Self :: Macro ( ..) => Defaultness :: Final ,
2658
+ Self :: MacCall ( ..) => Defaultness :: Final ,
2659
2659
}
2660
2660
}
2661
2661
}
@@ -2666,7 +2666,7 @@ impl From<AssocItemKind> for ItemKind {
2666
2666
AssocItemKind :: Const ( a, b, c) => ItemKind :: Const ( a, b, c) ,
2667
2667
AssocItemKind :: Fn ( a, b, c, d) => ItemKind :: Fn ( a, b, c, d) ,
2668
2668
AssocItemKind :: TyAlias ( a, b, c, d) => ItemKind :: TyAlias ( a, b, c, d) ,
2669
- AssocItemKind :: Macro ( a) => ItemKind :: Mac ( a) ,
2669
+ AssocItemKind :: MacCall ( a) => ItemKind :: MacCall ( a) ,
2670
2670
}
2671
2671
}
2672
2672
}
@@ -2679,7 +2679,7 @@ impl TryFrom<ItemKind> for AssocItemKind {
2679
2679
ItemKind :: Const ( a, b, c) => AssocItemKind :: Const ( a, b, c) ,
2680
2680
ItemKind :: Fn ( a, b, c, d) => AssocItemKind :: Fn ( a, b, c, d) ,
2681
2681
ItemKind :: TyAlias ( a, b, c, d) => AssocItemKind :: TyAlias ( a, b, c, d) ,
2682
- ItemKind :: Mac ( a) => AssocItemKind :: Macro ( a) ,
2682
+ ItemKind :: MacCall ( a) => AssocItemKind :: MacCall ( a) ,
2683
2683
_ => return Err ( item_kind) ,
2684
2684
} )
2685
2685
}
@@ -2695,7 +2695,7 @@ pub enum ForeignItemKind {
2695
2695
/// A foreign type.
2696
2696
TyAlias ( Defaultness , Generics , GenericBounds , Option < P < Ty > > ) ,
2697
2697
/// A macro expanding to foreign items.
2698
- Macro ( Mac ) ,
2698
+ MacCall ( MacCall ) ,
2699
2699
}
2700
2700
2701
2701
impl From < ForeignItemKind > for ItemKind {
@@ -2704,7 +2704,7 @@ impl From<ForeignItemKind> for ItemKind {
2704
2704
ForeignItemKind :: Static ( a, b, c) => ItemKind :: Static ( a, b, c) ,
2705
2705
ForeignItemKind :: Fn ( a, b, c, d) => ItemKind :: Fn ( a, b, c, d) ,
2706
2706
ForeignItemKind :: TyAlias ( a, b, c, d) => ItemKind :: TyAlias ( a, b, c, d) ,
2707
- ForeignItemKind :: Macro ( a) => ItemKind :: Mac ( a) ,
2707
+ ForeignItemKind :: MacCall ( a) => ItemKind :: MacCall ( a) ,
2708
2708
}
2709
2709
}
2710
2710
}
@@ -2717,7 +2717,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
2717
2717
ItemKind :: Static ( a, b, c) => ForeignItemKind :: Static ( a, b, c) ,
2718
2718
ItemKind :: Fn ( a, b, c, d) => ForeignItemKind :: Fn ( a, b, c, d) ,
2719
2719
ItemKind :: TyAlias ( a, b, c, d) => ForeignItemKind :: TyAlias ( a, b, c, d) ,
2720
- ItemKind :: Mac ( a) => ForeignItemKind :: Macro ( a) ,
2720
+ ItemKind :: MacCall ( a) => ForeignItemKind :: MacCall ( a) ,
2721
2721
_ => return Err ( item_kind) ,
2722
2722
} )
2723
2723
}
0 commit comments