File tree 7 files changed +20
-0
lines changed
7 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,7 @@ impl<'tcx> ut::UnifyKey for TyVidEqKey<'tcx> {
416
416
fn index ( & self ) -> u32 {
417
417
self . vid . as_u32 ( )
418
418
}
419
+ #[ inline]
419
420
fn from_index ( i : u32 ) -> Self {
420
421
TyVidEqKey :: from ( ty:: TyVid :: from_u32 ( i) )
421
422
}
Original file line number Diff line number Diff line change @@ -32,9 +32,11 @@ impl<'tcx> From<ty::RegionVid> for RegionVidKey<'tcx> {
32
32
33
33
impl < ' tcx > UnifyKey for RegionVidKey < ' tcx > {
34
34
type Value = UnifiedRegion < ' tcx > ;
35
+ #[ inline]
35
36
fn index ( & self ) -> u32 {
36
37
self . vid . as_u32 ( )
37
38
}
39
+ #[ inline]
38
40
fn from_index ( i : u32 ) -> Self {
39
41
RegionVidKey :: from ( ty:: RegionVid :: from_u32 ( i) )
40
42
}
@@ -118,9 +120,11 @@ pub struct ConstVarValue<'tcx> {
118
120
119
121
impl < ' tcx > UnifyKey for ty:: ConstVid < ' tcx > {
120
122
type Value = ConstVarValue < ' tcx > ;
123
+ #[ inline]
121
124
fn index ( & self ) -> u32 {
122
125
self . index
123
126
}
127
+ #[ inline]
124
128
fn from_index ( i : u32 ) -> Self {
125
129
ty:: ConstVid { index : i, phantom : PhantomData }
126
130
}
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ pub enum GenericArgKind<'tcx> {
48
48
}
49
49
50
50
impl < ' tcx > GenericArgKind < ' tcx > {
51
+ #[ inline]
51
52
fn pack ( self ) -> GenericArg < ' tcx > {
52
53
let ( tag, ptr) = match self {
53
54
GenericArgKind :: Lifetime ( lt) => {
@@ -94,18 +95,21 @@ impl<'tcx> PartialOrd for GenericArg<'tcx> {
94
95
}
95
96
96
97
impl < ' tcx > From < ty:: Region < ' tcx > > for GenericArg < ' tcx > {
98
+ #[ inline]
97
99
fn from ( r : ty:: Region < ' tcx > ) -> GenericArg < ' tcx > {
98
100
GenericArgKind :: Lifetime ( r) . pack ( )
99
101
}
100
102
}
101
103
102
104
impl < ' tcx > From < Ty < ' tcx > > for GenericArg < ' tcx > {
105
+ #[ inline]
103
106
fn from ( ty : Ty < ' tcx > ) -> GenericArg < ' tcx > {
104
107
GenericArgKind :: Type ( ty) . pack ( )
105
108
}
106
109
}
107
110
108
111
impl < ' tcx > From < ty:: Const < ' tcx > > for GenericArg < ' tcx > {
112
+ #[ inline]
109
113
fn from ( c : ty:: Const < ' tcx > ) -> GenericArg < ' tcx > {
110
114
GenericArgKind :: Const ( c) . pack ( )
111
115
}
Original file line number Diff line number Diff line change @@ -222,9 +222,11 @@ impl From<Local> for UnifyLocal {
222
222
223
223
impl UnifyKey for UnifyLocal {
224
224
type Value = ( ) ;
225
+ #[ inline]
225
226
fn index ( & self ) -> u32 {
226
227
self . 0 . as_u32 ( )
227
228
}
229
+ #[ inline]
228
230
fn from_index ( u : u32 ) -> Self {
229
231
Self ( Local :: from_u32 ( u) )
230
232
}
Original file line number Diff line number Diff line change @@ -172,10 +172,12 @@ impl LocalExpnId {
172
172
/// The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
173
173
pub const ROOT : LocalExpnId = LocalExpnId :: from_u32 ( 0 ) ;
174
174
175
+ #[ inline]
175
176
pub fn from_raw ( idx : ExpnIndex ) -> LocalExpnId {
176
177
LocalExpnId :: from_u32 ( idx. as_u32 ( ) )
177
178
}
178
179
180
+ #[ inline]
179
181
pub fn as_raw ( self ) -> ExpnIndex {
180
182
ExpnIndex :: from_u32 ( self . as_u32 ( ) )
181
183
}
Original file line number Diff line number Diff line change @@ -1541,11 +1541,13 @@ impl Default for TargetOptions {
1541
1541
impl Deref for Target {
1542
1542
type Target = TargetOptions ;
1543
1543
1544
+ #[ inline]
1544
1545
fn deref ( & self ) -> & Self :: Target {
1545
1546
& self . options
1546
1547
}
1547
1548
}
1548
1549
impl DerefMut for Target {
1550
+ #[ inline]
1549
1551
fn deref_mut ( & mut self ) -> & mut Self :: Target {
1550
1552
& mut self . options
1551
1553
}
Original file line number Diff line number Diff line change @@ -400,9 +400,11 @@ pub enum InferTy {
400
400
/// they carry no values.
401
401
impl UnifyKey for TyVid {
402
402
type Value = ( ) ;
403
+ #[ inline]
403
404
fn index ( & self ) -> u32 {
404
405
self . as_u32 ( )
405
406
}
407
+ #[ inline]
406
408
fn from_index ( i : u32 ) -> TyVid {
407
409
TyVid :: from_u32 ( i)
408
410
}
@@ -419,6 +421,7 @@ impl UnifyKey for IntVid {
419
421
fn index ( & self ) -> u32 {
420
422
self . index
421
423
}
424
+ #[ inline]
422
425
fn from_index ( i : u32 ) -> IntVid {
423
426
IntVid { index : i }
424
427
}
@@ -431,9 +434,11 @@ impl EqUnifyValue for FloatVarValue {}
431
434
432
435
impl UnifyKey for FloatVid {
433
436
type Value = Option < FloatVarValue > ;
437
+ #[ inline]
434
438
fn index ( & self ) -> u32 {
435
439
self . index
436
440
}
441
+ #[ inline]
437
442
fn from_index ( i : u32 ) -> FloatVid {
438
443
FloatVid { index : i }
439
444
}
You can’t perform that action at this time.
0 commit comments