@@ -11,10 +11,10 @@ use crate::crate_def::{CrateDef, CrateDefItems, CrateDefType};
1111use crate :: mir:: alloc:: { AllocId , read_target_int, read_target_uint} ;
1212use crate :: mir:: mono:: StaticDef ;
1313use crate :: target:: MachineInfo ;
14- use crate :: { Filename , IndexedVal , Opaque } ;
14+ use crate :: { Filename , IndexedVal , Opaque , ReferencesTls } ;
1515
1616#[ derive( Copy , Clone , Eq , PartialEq , Hash , Serialize ) ]
17- pub struct Ty ( usize ) ;
17+ pub struct Ty ( usize , ReferencesTls ) ;
1818
1919impl Debug for Ty {
2020 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
@@ -152,7 +152,7 @@ pub enum TyConstKind {
152152}
153153
154154#[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
155- pub struct TyConstId ( usize ) ;
155+ pub struct TyConstId ( usize , ReferencesTls ) ;
156156
157157/// Represents a constant in MIR
158158#[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
@@ -213,7 +213,7 @@ impl MirConst {
213213}
214214
215215#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , Serialize ) ]
216- pub struct MirConstId ( usize ) ;
216+ pub struct MirConstId ( usize , ReferencesTls ) ;
217217
218218type Ident = Opaque ;
219219
@@ -256,7 +256,7 @@ pub struct Placeholder<T> {
256256}
257257
258258#[ derive( Clone , Copy , PartialEq , Eq , Hash , Serialize ) ]
259- pub struct Span ( usize ) ;
259+ pub struct Span ( usize , ReferencesTls ) ;
260260
261261impl Debug for Span {
262262 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
@@ -1560,14 +1560,15 @@ macro_rules! index_impl {
15601560 ( $name: ident) => {
15611561 impl crate :: IndexedVal for $name {
15621562 fn to_val( index: usize ) -> Self {
1563- $name( index)
1563+ $name( index, $crate :: ReferencesTLS )
15641564 }
15651565 fn to_index( & self ) -> usize {
15661566 self . 0
15671567 }
15681568 }
15691569 } ;
15701570}
1571+ pub ( crate ) use index_impl;
15711572
15721573index_impl ! ( TyConstId ) ;
15731574index_impl ! ( MirConstId ) ;
@@ -1588,7 +1589,7 @@ index_impl!(Span);
15881589/// `c` is in the variant with the `VariantIdx` of `1`, and
15891590/// `g` is in the variant with the `VariantIdx` of `0`.
15901591#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , Serialize ) ]
1591- pub struct VariantIdx ( usize ) ;
1592+ pub struct VariantIdx ( usize , ReferencesTls ) ;
15921593
15931594index_impl ! ( VariantIdx ) ;
15941595
0 commit comments