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