@@ -962,38 +962,38 @@ enum TypeParameters<'a, 'b> {
962
962
RibKind < ' a > ) ,
963
963
}
964
964
965
- // The rib kind controls the translation of local
966
- // definitions (`Def::Local`) to upvars (`Def::Upvar`).
965
+ /// The rib kind controls the translation of local
966
+ /// definitions (`Def::Local`) to upvars (`Def::Upvar`).
967
967
#[ derive( Copy , Clone , Debug ) ]
968
968
enum RibKind < ' a > {
969
- // No translation needs to be applied.
969
+ /// No translation needs to be applied.
970
970
NormalRibKind ,
971
971
972
- // We passed through a closure scope at the given node ID.
973
- // Translate upvars as appropriate.
972
+ /// We passed through a closure scope at the given node ID.
973
+ /// Translate upvars as appropriate.
974
974
ClosureRibKind ( NodeId /* func id */ ) ,
975
975
976
- // We passed through an impl or trait and are now in one of its
977
- // methods or associated types. Allow references to ty params that impl or trait
978
- // binds. Disallow any other upvars (including other ty params that are
979
- // upvars).
976
+ /// We passed through an impl or trait and are now in one of its
977
+ /// methods or associated types. Allow references to ty params that impl or trait
978
+ /// binds. Disallow any other upvars (including other ty params that are
979
+ /// upvars).
980
980
TraitOrImplItemRibKind ,
981
981
982
- // We passed through an item scope. Disallow upvars.
982
+ /// We passed through an item scope. Disallow upvars.
983
983
ItemRibKind ,
984
984
985
- // We're in a constant item. Can't refer to dynamic stuff.
985
+ /// We're in a constant item. Can't refer to dynamic stuff.
986
986
ConstantItemRibKind ,
987
987
988
- // We passed through a module.
988
+ /// We passed through a module.
989
989
ModuleRibKind ( Module < ' a > ) ,
990
990
991
- // We passed through a `macro_rules!` statement
991
+ /// We passed through a `macro_rules!` statement
992
992
MacroDefinition ( DefId ) ,
993
993
994
- // All bindings in this rib are type parameters that can't be used
995
- // from the default of a type parameter because they're not declared
996
- // before said type parameter. Also see the `visit_generics` override.
994
+ /// All bindings in this rib are type parameters that can't be used
995
+ /// from the default of a type parameter because they're not declared
996
+ /// before said type parameter. Also see the `visit_generics` override.
997
997
ForwardTyParamBanRibKind ,
998
998
}
999
999
@@ -1198,7 +1198,7 @@ impl<'a> fmt::Debug for ModuleData<'a> {
1198
1198
}
1199
1199
}
1200
1200
1201
- // Records a possibly-private value, type, or module definition.
1201
+ /// Records a possibly-private value, type, or module definition.
1202
1202
#[ derive( Clone , Debug ) ]
1203
1203
pub struct NameBinding < ' a > {
1204
1204
kind : NameBindingKind < ' a > ,
@@ -1408,36 +1408,36 @@ pub struct Resolver<'a> {
1408
1408
1409
1409
prelude : Option < Module < ' a > > ,
1410
1410
1411
- // n.b. This is used only for better diagnostics, not name resolution itself.
1411
+ /// n.b. This is used only for better diagnostics, not name resolution itself.
1412
1412
has_self : FxHashSet < DefId > ,
1413
1413
1414
- // Names of fields of an item `DefId` accessible with dot syntax.
1415
- // Used for hints during error reporting.
1414
+ /// Names of fields of an item `DefId` accessible with dot syntax.
1415
+ /// Used for hints during error reporting.
1416
1416
field_names : FxHashMap < DefId , Vec < Name > > ,
1417
1417
1418
- // All imports known to succeed or fail.
1418
+ /// All imports known to succeed or fail.
1419
1419
determined_imports : Vec < & ' a ImportDirective < ' a > > ,
1420
1420
1421
- // All non-determined imports.
1421
+ /// All non-determined imports.
1422
1422
indeterminate_imports : Vec < & ' a ImportDirective < ' a > > ,
1423
1423
1424
- // The module that represents the current item scope.
1424
+ /// The module that represents the current item scope.
1425
1425
current_module : Module < ' a > ,
1426
1426
1427
- // The current set of local scopes for types and values.
1428
- // FIXME #4948: Reuse ribs to avoid allocation.
1427
+ /// The current set of local scopes for types and values.
1428
+ /// FIXME #4948: Reuse ribs to avoid allocation.
1429
1429
ribs : PerNS < Vec < Rib < ' a > > > ,
1430
1430
1431
- // The current set of local scopes, for labels.
1431
+ /// The current set of local scopes, for labels.
1432
1432
label_ribs : Vec < Rib < ' a > > ,
1433
1433
1434
- // The trait that the current context can refer to.
1434
+ /// The trait that the current context can refer to.
1435
1435
current_trait_ref : Option < ( Module < ' a > , TraitRef ) > ,
1436
1436
1437
- // The current self type if inside an impl (used for better errors).
1437
+ /// The current self type if inside an impl (used for better errors).
1438
1438
current_self_type : Option < Ty > ,
1439
1439
1440
- // The idents for the primitive types.
1440
+ /// The idents for the primitive types.
1441
1441
primitive_type_table : PrimitiveTypeTable ,
1442
1442
1443
1443
def_map : DefMap ,
@@ -1446,20 +1446,20 @@ pub struct Resolver<'a> {
1446
1446
pub export_map : ExportMap ,
1447
1447
pub trait_map : TraitMap ,
1448
1448
1449
- // A map from nodes to anonymous modules.
1450
- // Anonymous modules are pseudo-modules that are implicitly created around items
1451
- // contained within blocks.
1452
- //
1453
- // For example, if we have this:
1454
- //
1455
- // fn f() {
1456
- // fn g() {
1457
- // ...
1458
- // }
1459
- // }
1460
- //
1461
- // There will be an anonymous module created around `g` with the ID of the
1462
- // entry block for `f`.
1449
+ /// A map from nodes to anonymous modules.
1450
+ /// Anonymous modules are pseudo-modules that are implicitly created around items
1451
+ /// contained within blocks.
1452
+ ///
1453
+ /// For example, if we have this:
1454
+ ///
1455
+ /// fn f() {
1456
+ /// fn g() {
1457
+ /// ...
1458
+ /// }
1459
+ /// }
1460
+ ///
1461
+ /// There will be an anonymous module created around `g` with the ID of the
1462
+ /// entry block for `f`.
1463
1463
block_map : NodeMap < Module < ' a > > ,
1464
1464
module_map : FxHashMap < DefId , Module < ' a > > ,
1465
1465
extern_module_map : FxHashMap < ( DefId , bool /* MacrosOnly? */ ) , Module < ' a > > ,
@@ -1487,7 +1487,8 @@ pub struct Resolver<'a> {
1487
1487
1488
1488
arenas : & ' a ResolverArenas < ' a > ,
1489
1489
dummy_binding : & ' a NameBinding < ' a > ,
1490
- use_extern_macros : bool , // true if `#![feature(use_extern_macros)]`
1490
+ /// true if `#![feature(use_extern_macros)]`
1491
+ use_extern_macros : bool ,
1491
1492
1492
1493
crate_loader : & ' a mut CrateLoader ,
1493
1494
macro_names : FxHashSet < Ident > ,
@@ -1501,29 +1502,29 @@ pub struct Resolver<'a> {
1501
1502
pub whitelisted_legacy_custom_derives : Vec < Name > ,
1502
1503
pub found_unresolved_macro : bool ,
1503
1504
1504
- // List of crate local macros that we need to warn about as being unused.
1505
- // Right now this only includes macro_rules! macros, and macros 2.0.
1505
+ /// List of crate local macros that we need to warn about as being unused.
1506
+ /// Right now this only includes macro_rules! macros, and macros 2.0.
1506
1507
unused_macros : FxHashSet < DefId > ,
1507
1508
1508
- // Maps the `Mark` of an expansion to its containing module or block.
1509
+ /// Maps the `Mark` of an expansion to its containing module or block.
1509
1510
invocations : FxHashMap < Mark , & ' a InvocationData < ' a > > ,
1510
1511
1511
- // Avoid duplicated errors for "name already defined".
1512
+ /// Avoid duplicated errors for "name already defined".
1512
1513
name_already_seen : FxHashMap < Name , Span > ,
1513
1514
1514
- // If `#![feature(proc_macro)]` is set
1515
+ /// If `#![feature(proc_macro)]` is set
1515
1516
proc_macro_enabled : bool ,
1516
1517
1517
- // A set of procedural macros imported by `#[macro_use]` that have already been warned about
1518
+ /// A set of procedural macros imported by `#[macro_use]` that have already been warned about
1518
1519
warned_proc_macros : FxHashSet < Name > ,
1519
1520
1520
1521
potentially_unused_imports : Vec < & ' a ImportDirective < ' a > > ,
1521
1522
1522
- // This table maps struct IDs into struct constructor IDs,
1523
- // it's not used during normal resolution, only for better error reporting.
1523
+ /// This table maps struct IDs into struct constructor IDs,
1524
+ /// it's not used during normal resolution, only for better error reporting.
1524
1525
struct_constructors : DefIdMap < ( Def , ty:: Visibility ) > ,
1525
1526
1526
- // Only used for better errors on `fn(): fn()`
1527
+ /// Only used for better errors on `fn(): fn()`
1527
1528
current_type_ascription : Vec < Span > ,
1528
1529
1529
1530
injected_crate : Option < Module < ' a > > ,
0 commit comments