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