@@ -150,24 +150,28 @@ impl DebruijnIndex {
150
150
///
151
151
/// you would need to shift the index for `'a` into a new binder.
152
152
#[ must_use]
153
+ #[ inline]
153
154
pub fn shifted_in ( self , amount : u32 ) -> DebruijnIndex {
154
155
DebruijnIndex :: from_u32 ( self . as_u32 ( ) + amount)
155
156
}
156
157
157
158
/// Update this index in place by shifting it "in" through
158
159
/// `amount` number of binders.
160
+ #[ inline]
159
161
pub fn shift_in ( & mut self , amount : u32 ) {
160
162
* self = self . shifted_in ( amount) ;
161
163
}
162
164
163
165
/// Returns the resulting index when this value is moved out from
164
166
/// `amount` number of new binders.
165
167
#[ must_use]
168
+ #[ inline]
166
169
pub fn shifted_out ( self , amount : u32 ) -> DebruijnIndex {
167
170
DebruijnIndex :: from_u32 ( self . as_u32 ( ) - amount)
168
171
}
169
172
170
173
/// Update in place by shifting out from `amount` binders.
174
+ #[ inline]
171
175
pub fn shift_out ( & mut self , amount : u32 ) {
172
176
* self = self . shifted_out ( amount) ;
173
177
}
@@ -192,6 +196,7 @@ impl DebruijnIndex {
192
196
/// If we invoke `shift_out_to_binder` and the region is in fact
193
197
/// bound by one of the binders we are shifting out of, that is an
194
198
/// error (and should fail an assertion failure).
199
+ #[ inline]
195
200
pub fn shifted_out_to_binder ( self , to_binder : DebruijnIndex ) -> Self {
196
201
self . shifted_out ( to_binder. as_u32 ( ) - INNERMOST . as_u32 ( ) )
197
202
}
0 commit comments