@@ -50,6 +50,7 @@ use ty::query;
50
50
use ty:: steal:: Steal ;
51
51
use ty:: BindingMode ;
52
52
use ty:: CanonicalTy ;
53
+ use ty:: CanonicalPolyFnSig ;
53
54
use util:: nodemap:: { DefIdSet , ItemLocalMap } ;
54
55
use util:: nodemap:: { FxHashMap , FxHashSet } ;
55
56
use smallvec:: SmallVec ;
@@ -344,10 +345,6 @@ pub struct TypeckTables<'tcx> {
344
345
/// belongs, but it may not exist if it's a tuple field (`tuple.0`).
345
346
field_indices : ItemLocalMap < usize > ,
346
347
347
- /// Stores the canonicalized types provided by the user. See also
348
- /// `AscribeUserType` statement in MIR.
349
- user_provided_tys : ItemLocalMap < CanonicalTy < ' tcx > > ,
350
-
351
348
/// Stores the types for various nodes in the AST. Note that this table
352
349
/// is not guaranteed to be populated until after typeck. See
353
350
/// typeck::check::fn_ctxt for details.
@@ -359,6 +356,14 @@ pub struct TypeckTables<'tcx> {
359
356
/// other items.
360
357
node_substs : ItemLocalMap < & ' tcx Substs < ' tcx > > ,
361
358
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
+
362
367
/// Stores the substitutions that the user explicitly gave (if any)
363
368
/// attached to `id`. These will not include any inferred
364
369
/// values. The canonical form is used to capture things like `_`
@@ -442,6 +447,7 @@ impl<'tcx> TypeckTables<'tcx> {
442
447
type_dependent_defs : ItemLocalMap ( ) ,
443
448
field_indices : ItemLocalMap ( ) ,
444
449
user_provided_tys : ItemLocalMap ( ) ,
450
+ user_provided_sigs : Default :: default ( ) ,
445
451
node_types : ItemLocalMap ( ) ,
446
452
node_substs : ItemLocalMap ( ) ,
447
453
user_substs : ItemLocalMap ( ) ,
@@ -513,6 +519,20 @@ impl<'tcx> TypeckTables<'tcx> {
513
519
}
514
520
}
515
521
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
+
516
536
pub fn node_types ( & self ) -> LocalTableInContext < ' _ , Ty < ' tcx > > {
517
537
LocalTableInContext {
518
538
local_id_root : self . local_id_root ,
@@ -748,6 +768,7 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeckTables<'gcx> {
748
768
ref type_dependent_defs,
749
769
ref field_indices,
750
770
ref user_provided_tys,
771
+ ref user_provided_sigs,
751
772
ref node_types,
752
773
ref node_substs,
753
774
ref user_substs,
@@ -771,6 +792,7 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for TypeckTables<'gcx> {
771
792
type_dependent_defs. hash_stable ( hcx, hasher) ;
772
793
field_indices. hash_stable ( hcx, hasher) ;
773
794
user_provided_tys. hash_stable ( hcx, hasher) ;
795
+ user_provided_sigs. hash_stable ( hcx, hasher) ;
774
796
node_types. hash_stable ( hcx, hasher) ;
775
797
node_substs. hash_stable ( hcx, hasher) ;
776
798
user_substs. hash_stable ( hcx, hasher) ;
0 commit comments