@@ -267,11 +267,11 @@ impl<'tcx> QueryDescription for queries::symbol_name<'tcx> {
267
267
macro_rules! define_maps {
268
268
( <$tcx: tt>
269
269
$( $( #[ $attr: meta] ) *
270
- pub $name: ident: $node: ident( $K: ty) -> $V: ty) ,* ) => {
270
+ [ $ ( $ pub: tt ) * ] $name: ident: $node: ident( $K: ty) -> $V: ty) ,* ) => {
271
271
pub struct Maps <$tcx> {
272
272
providers: IndexVec <CrateNum , Providers <$tcx>>,
273
273
query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
274
- $( $( #[ $attr] ) * pub $name: RefCell <DepTrackingMap <queries:: $name<$tcx>>>) ,*
274
+ $( $( #[ $attr] ) * $ ( $ pub) * $name: RefCell <DepTrackingMap <queries:: $name<$tcx>>>) ,*
275
275
}
276
276
277
277
impl <$tcx> Maps <$tcx> {
@@ -434,52 +434,52 @@ macro_rules! define_maps {
434
434
// the driver creates (using several `rustc_*` crates).
435
435
define_maps ! { <' tcx>
436
436
/// Records the type of every item.
437
- pub type_of: ItemSignature ( DefId ) -> Ty <' tcx>,
437
+ [ pub ] type_of: ItemSignature ( DefId ) -> Ty <' tcx>,
438
438
439
439
/// Maps from the def-id of an item (trait/struct/enum/fn) to its
440
440
/// associated generics and predicates.
441
- pub generics_of: ItemSignature ( DefId ) -> & ' tcx ty:: Generics ,
442
- pub predicates_of: ItemSignature ( DefId ) -> ty:: GenericPredicates <' tcx>,
441
+ [ ] generics_of: ItemSignature ( DefId ) -> & ' tcx ty:: Generics ,
442
+ [ ] predicates_of: ItemSignature ( DefId ) -> ty:: GenericPredicates <' tcx>,
443
443
444
444
/// Maps from the def-id of a trait to the list of
445
445
/// super-predicates. This is a subset of the full list of
446
446
/// predicates. We store these in a separate map because we must
447
447
/// evaluate them even during type conversion, often before the
448
448
/// full predicates are available (note that supertraits have
449
449
/// additional acyclicity requirements).
450
- pub super_predicates_of: ItemSignature ( DefId ) -> ty:: GenericPredicates <' tcx>,
450
+ [ ] super_predicates_of: ItemSignature ( DefId ) -> ty:: GenericPredicates <' tcx>,
451
451
452
452
/// To avoid cycles within the predicates of a single item we compute
453
453
/// per-type-parameter predicates for resolving `T::AssocTy`.
454
- pub type_param_predicates: TypeParamPredicates ( ( DefId , DefId ) )
454
+ [ ] type_param_predicates: TypeParamPredicates ( ( DefId , DefId ) )
455
455
-> ty:: GenericPredicates <' tcx>,
456
456
457
- pub trait_def: ItemSignature ( DefId ) -> & ' tcx ty:: TraitDef ,
458
- pub adt_def: ItemSignature ( DefId ) -> & ' tcx ty:: AdtDef ,
459
- pub adt_destructor: AdtDestructor ( DefId ) -> Option <ty:: Destructor >,
460
- pub adt_sized_constraint: SizedConstraint ( DefId ) -> & ' tcx [ Ty <' tcx>] ,
461
- pub adt_dtorck_constraint: DtorckConstraint ( DefId ) -> ty:: DtorckConstraint <' tcx>,
457
+ [ ] trait_def: ItemSignature ( DefId ) -> & ' tcx ty:: TraitDef ,
458
+ [ ] adt_def: ItemSignature ( DefId ) -> & ' tcx ty:: AdtDef ,
459
+ [ ] adt_destructor: AdtDestructor ( DefId ) -> Option <ty:: Destructor >,
460
+ [ ] adt_sized_constraint: SizedConstraint ( DefId ) -> & ' tcx [ Ty <' tcx>] ,
461
+ [ ] adt_dtorck_constraint: DtorckConstraint ( DefId ) -> ty:: DtorckConstraint <' tcx>,
462
462
463
463
/// True if this is a foreign item (i.e., linked via `extern { ... }`).
464
- pub is_foreign_item: IsForeignItem ( DefId ) -> bool ,
464
+ [ ] is_foreign_item: IsForeignItem ( DefId ) -> bool ,
465
465
466
466
/// Maps from def-id of a type or region parameter to its
467
467
/// (inferred) variance.
468
- pub variances_of: ItemSignature ( DefId ) -> Rc <Vec <ty:: Variance >>,
468
+ [ pub ] variances_of: ItemSignature ( DefId ) -> Rc <Vec <ty:: Variance >>,
469
469
470
470
/// Maps from an impl/trait def-id to a list of the def-ids of its items
471
- pub associated_item_def_ids: AssociatedItemDefIds ( DefId ) -> Rc <Vec <DefId >>,
471
+ [ ] associated_item_def_ids: AssociatedItemDefIds ( DefId ) -> Rc <Vec <DefId >>,
472
472
473
473
/// Maps from a trait item to the trait item "descriptor"
474
- pub associated_item: AssociatedItems ( DefId ) -> ty:: AssociatedItem ,
474
+ [ ] associated_item: AssociatedItems ( DefId ) -> ty:: AssociatedItem ,
475
475
476
- pub impl_trait_ref: ItemSignature ( DefId ) -> Option <ty:: TraitRef <' tcx>>,
477
- pub impl_polarity: ItemSignature ( DefId ) -> hir:: ImplPolarity ,
476
+ [ pub ] impl_trait_ref: ItemSignature ( DefId ) -> Option <ty:: TraitRef <' tcx>>,
477
+ [ ] impl_polarity: ItemSignature ( DefId ) -> hir:: ImplPolarity ,
478
478
479
479
/// Maps a DefId of a type to a list of its inherent impls.
480
480
/// Contains implementations of methods that are inherent to a type.
481
481
/// Methods in these implementations don't need to be exported.
482
- pub inherent_impls: InherentImpls ( DefId ) -> Rc <Vec <DefId >>,
482
+ [ ] inherent_impls: InherentImpls ( DefId ) -> Rc <Vec <DefId >>,
483
483
484
484
/// Maps from the def-id of a function/method or const/static
485
485
/// to its MIR. Mutation is done at an item granularity to
@@ -488,57 +488,57 @@ define_maps! { <'tcx>
488
488
///
489
489
/// Note that cross-crate MIR appears to be always borrowed
490
490
/// (in the `RefCell` sense) to prevent accidental mutation.
491
- pub mir: Mir ( DefId ) -> & ' tcx RefCell <mir:: Mir <' tcx>>,
491
+ [ pub ] mir: Mir ( DefId ) -> & ' tcx RefCell <mir:: Mir <' tcx>>,
492
492
493
493
/// Maps DefId's that have an associated Mir to the result
494
494
/// of the MIR qualify_consts pass. The actual meaning of
495
495
/// the value isn't known except to the pass itself.
496
- pub mir_const_qualif: Mir ( DefId ) -> u8 ,
496
+ [ ] mir_const_qualif: Mir ( DefId ) -> u8 ,
497
497
498
498
/// Records the type of each closure. The def ID is the ID of the
499
499
/// expression defining the closure.
500
- pub closure_kind: ItemSignature ( DefId ) -> ty:: ClosureKind ,
500
+ [ ] closure_kind: ItemSignature ( DefId ) -> ty:: ClosureKind ,
501
501
502
502
/// Records the type of each closure. The def ID is the ID of the
503
503
/// expression defining the closure.
504
- pub closure_type: ItemSignature ( DefId ) -> ty:: PolyFnSig <' tcx>,
504
+ [ ] closure_type: ItemSignature ( DefId ) -> ty:: PolyFnSig <' tcx>,
505
505
506
506
/// Caches CoerceUnsized kinds for impls on custom types.
507
- pub coerce_unsized_info: ItemSignature ( DefId )
507
+ [ ] coerce_unsized_info: ItemSignature ( DefId )
508
508
-> ty:: adjustment:: CoerceUnsizedInfo ,
509
509
510
- pub typeck_item_bodies: typeck_item_bodies_dep_node( CrateNum ) -> CompileResult ,
510
+ [ ] typeck_item_bodies: typeck_item_bodies_dep_node( CrateNum ) -> CompileResult ,
511
511
512
- pub typeck_tables_of: TypeckTables ( DefId ) -> & ' tcx ty:: TypeckTables <' tcx>,
512
+ [ ] typeck_tables_of: TypeckTables ( DefId ) -> & ' tcx ty:: TypeckTables <' tcx>,
513
513
514
- pub coherent_trait: coherent_trait_dep_node( ( CrateNum , DefId ) ) -> ( ) ,
514
+ [ ] coherent_trait: coherent_trait_dep_node( ( CrateNum , DefId ) ) -> ( ) ,
515
515
516
- pub borrowck: BorrowCheck ( DefId ) -> ( ) ,
516
+ [ ] borrowck: BorrowCheck ( DefId ) -> ( ) ,
517
517
518
518
/// Gets a complete map from all types to their inherent impls.
519
519
/// Not meant to be used directly outside of coherence.
520
520
/// (Defined only for LOCAL_CRATE)
521
- pub crate_inherent_impls: crate_inherent_impls_dep_node( CrateNum ) -> CrateInherentImpls ,
521
+ [ ] crate_inherent_impls: crate_inherent_impls_dep_node( CrateNum ) -> CrateInherentImpls ,
522
522
523
523
/// Checks all types in the krate for overlap in their inherent impls. Reports errors.
524
524
/// Not meant to be used directly outside of coherence.
525
525
/// (Defined only for LOCAL_CRATE)
526
- pub crate_inherent_impls_overlap_check: crate_inherent_impls_dep_node( CrateNum ) -> ( ) ,
526
+ [ ] crate_inherent_impls_overlap_check: crate_inherent_impls_dep_node( CrateNum ) -> ( ) ,
527
527
528
528
/// Results of evaluating const items or constants embedded in
529
529
/// other items (such as enum variant explicit discriminants).
530
- pub const_eval: const_eval_dep_node( ( DefId , & ' tcx Substs <' tcx>) )
530
+ [ ] const_eval: const_eval_dep_node( ( DefId , & ' tcx Substs <' tcx>) )
531
531
-> const_val:: EvalResult <' tcx>,
532
532
533
533
/// Performs the privacy check and computes "access levels".
534
- pub privacy_access_levels: PrivacyAccessLevels ( CrateNum ) -> Rc <AccessLevels >,
534
+ [ ] privacy_access_levels: PrivacyAccessLevels ( CrateNum ) -> Rc <AccessLevels >,
535
535
536
- pub reachable_set: reachability_dep_node( CrateNum ) -> Rc <NodeSet >,
536
+ [ ] reachable_set: reachability_dep_node( CrateNum ) -> Rc <NodeSet >,
537
537
538
- pub mir_shims: mir_shim_dep_node( ty:: InstanceDef <' tcx>) -> & ' tcx RefCell <mir:: Mir <' tcx>>,
538
+ [ ] mir_shims: mir_shim_dep_node( ty:: InstanceDef <' tcx>) -> & ' tcx RefCell <mir:: Mir <' tcx>>,
539
539
540
- pub def_symbol_name: SymbolName ( DefId ) -> ty:: SymbolName ,
541
- pub symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName
540
+ [ ] def_symbol_name: SymbolName ( DefId ) -> ty:: SymbolName ,
541
+ [ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName
542
542
}
543
543
544
544
fn coherent_trait_dep_node ( ( _, def_id) : ( CrateNum , DefId ) ) -> DepNode < DefId > {
0 commit comments