@@ -50,6 +50,7 @@ use ty::query;
5050use ty:: steal:: Steal ;
5151use ty:: BindingMode ;
5252use ty:: CanonicalTy ;
53+ use ty:: CanonicalPolyFnSig ;
5354use util:: nodemap:: { DefIdSet , ItemLocalMap } ;
5455use util:: nodemap:: { FxHashMap , FxHashSet } ;
5556use smallvec:: SmallVec ;
@@ -344,10 +345,6 @@ pub struct TypeckTables<'tcx> {
344345 /// belongs, but it may not exist if it's a tuple field (`tuple.0`).
345346 field_indices : ItemLocalMap < usize > ,
346347
347- /// Stores the canonicalized types provided by the user. See also
348- /// `AscribeUserType` statement in MIR.
349- user_provided_tys : ItemLocalMap < CanonicalTy < ' tcx > > ,
350-
351348 /// Stores the types for various nodes in the AST. Note that this table
352349 /// is not guaranteed to be populated until after typeck. See
353350 /// typeck::check::fn_ctxt for details.
@@ -359,6 +356,14 @@ pub struct TypeckTables<'tcx> {
359356 /// other items.
360357 node_substs : ItemLocalMap < & ' tcx Substs < ' tcx > > ,
361358
359+ /// Stores the canonicalized types provided by the user. See also
360+ /// `AscribeUserType` statement in MIR.
361+ user_provided_tys : ItemLocalMap < CanonicalTy < ' tcx > > ,
362+
363+ /// Stores the canonicalized types provided by the user. See also
364+ /// `AscribeUserType` statement in MIR.
365+ user_provided_sigs : ItemLocalMap < CanonicalPolyFnSig < ' tcx > > ,
366+
362367 /// Stores the substitutions that the user explicitly gave (if any)
363368 /// attached to `id`. These will not include any inferred
364369 /// values. The canonical form is used to capture things like `_`
@@ -442,6 +447,7 @@ impl<'tcx> TypeckTables<'tcx> {
442447 type_dependent_defs : ItemLocalMap ( ) ,
443448 field_indices : ItemLocalMap ( ) ,
444449 user_provided_tys : ItemLocalMap ( ) ,
450+ user_provided_sigs : Default :: default ( ) ,
445451 node_types : ItemLocalMap ( ) ,
446452 node_substs : ItemLocalMap ( ) ,
447453 user_substs : ItemLocalMap ( ) ,
@@ -513,6 +519,20 @@ impl<'tcx> TypeckTables<'tcx> {
513519 }
514520 }
515521
522+ pub fn user_provided_sigs ( & self ) -> LocalTableInContext < ' _ , CanonicalPolyFnSig < ' tcx > > {
523+ LocalTableInContext {
524+ local_id_root : self . local_id_root ,
525+ data : & self . user_provided_sigs
526+ }
527+ }
528+
529+ pub fn user_provided_sigs_mut ( & mut self ) -> LocalTableInContextMut < ' _ , CanonicalPolyFnSig < ' tcx > > {
530+ LocalTableInContextMut {
531+ local_id_root : self . local_id_root ,
532+ data : & mut self . user_provided_sigs
533+ }
534+ }
535+
516536 pub fn node_types ( & self ) -> LocalTableInContext < ' _ , Ty < ' tcx > > {
517537 LocalTableInContext {
518538 local_id_root : self . local_id_root ,
@@ -748,6 +768,7 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeckTables<'gcx> {
748768 ref type_dependent_defs,
749769 ref field_indices,
750770 ref user_provided_tys,
771+ ref user_provided_sigs,
751772 ref node_types,
752773 ref node_substs,
753774 ref user_substs,
@@ -771,6 +792,7 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeckTables<'gcx> {
771792 type_dependent_defs. hash_stable ( hcx, hasher) ;
772793 field_indices. hash_stable ( hcx, hasher) ;
773794 user_provided_tys. hash_stable ( hcx, hasher) ;
795+ user_provided_sigs. hash_stable ( hcx, hasher) ;
774796 node_types. hash_stable ( hcx, hasher) ;
775797 node_substs. hash_stable ( hcx, hasher) ;
776798 user_substs. hash_stable ( hcx, hasher) ;
0 commit comments