This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +33
-3
lines changed
rustc_trait_selection/src Expand file tree Collapse file tree 9 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 21
21
22
22
// tidy-alphabetical-start
23
23
#![ allow( internal_features) ]
24
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
24
25
#![ cfg_attr( doc, recursion_limit = "256" ) ] // FIXME(nnethercote): will be removed by #124141
25
26
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
26
27
#![ doc( rust_logo) ]
Original file line number Diff line number Diff line change 1
1
// tidy-alphabetical-start
2
2
#![ allow( internal_features) ]
3
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
3
4
#![ cfg_attr( doc, recursion_limit = "256" ) ] // FIXME(nnethercote): will be removed by #124141
4
5
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
5
6
#![ doc( rust_logo) ]
Original file line number Diff line number Diff line change 29
29
#![ allow( rustc:: diagnostic_outside_of_impl) ]
30
30
#![ allow( rustc:: potential_query_instability) ]
31
31
#![ allow( rustc:: untranslatable_diagnostic) ]
32
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
32
33
#![ cfg_attr( doc, recursion_limit = "256" ) ] // FIXME(nnethercote): will be removed by #124141
33
34
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
34
35
#![ doc( rust_logo) ]
Original file line number Diff line number Diff line change 11
11
#![ allow( rustc:: diagnostic_outside_of_impl) ]
12
12
#![ allow( rustc:: potential_query_instability) ]
13
13
#![ allow( rustc:: untranslatable_diagnostic) ]
14
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
14
15
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
15
16
#![ doc( rust_logo) ]
16
17
#![ feature( assert_matches) ]
Original file line number Diff line number Diff line change 3
3
// tidy-alphabetical-start
4
4
#![ allow( internal_features) ]
5
5
#![ allow( rustc:: internal) ]
6
+ #![ cfg_attr( bootstrap, feature( ptr_sub_ptr) ) ]
6
7
#![ cfg_attr( test, feature( test) ) ]
7
8
#![ doc(
8
9
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ,
Original file line number Diff line number Diff line change @@ -280,13 +280,27 @@ impl<'a> MemDecoder<'a> {
280
280
#[ inline]
281
281
pub fn len ( & self ) -> usize {
282
282
// SAFETY: This recovers the length of the original slice, only using members we never modify.
283
- unsafe { self . end . offset_from_unsigned ( self . start ) }
283
+ #[ cfg( bootstrap) ]
284
+ unsafe {
285
+ return self . end . sub_ptr ( self . start ) ;
286
+ }
287
+ #[ cfg( not( bootstrap) ) ]
288
+ unsafe {
289
+ self . end . offset_from_unsigned ( self . start )
290
+ }
284
291
}
285
292
286
293
#[ inline]
287
294
pub fn remaining ( & self ) -> usize {
288
295
// SAFETY: This type guarantees current <= end.
289
- unsafe { self . end . offset_from_unsigned ( self . current ) }
296
+ #[ cfg( bootstrap) ]
297
+ unsafe {
298
+ return self . end . sub_ptr ( self . current ) ;
299
+ }
300
+ #[ cfg( not( bootstrap) ) ]
301
+ unsafe {
302
+ self . end . offset_from_unsigned ( self . current )
303
+ }
290
304
}
291
305
292
306
#[ cold]
@@ -400,7 +414,14 @@ impl<'a> Decoder for MemDecoder<'a> {
400
414
#[ inline]
401
415
fn position ( & self ) -> usize {
402
416
// SAFETY: This type guarantees start <= current
403
- unsafe { self . current . offset_from_unsigned ( self . start ) }
417
+ #[ cfg( bootstrap) ]
418
+ unsafe {
419
+ return self . current . sub_ptr ( self . start ) ;
420
+ }
421
+ #[ cfg( not( bootstrap) ) ]
422
+ unsafe {
423
+ self . current . offset_from_unsigned ( self . start )
424
+ }
404
425
}
405
426
}
406
427
Original file line number Diff line number Diff line change 14
14
#![ allow( internal_features) ]
15
15
#![ allow( rustc:: diagnostic_outside_of_impl) ]
16
16
#![ allow( rustc:: untranslatable_diagnostic) ]
17
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
17
18
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
18
19
#![ doc( rust_logo) ]
19
20
#![ feature( assert_matches) ]
Original file line number Diff line number Diff line change 22
22
#![ allow( clippy:: collapsible_if, clippy:: collapsible_else_if) ]
23
23
#![ allow( rustc:: diagnostic_outside_of_impl) ]
24
24
#![ allow( rustc:: untranslatable_diagnostic) ]
25
+ #![ cfg_attr( bootstrap, feature( os_str_display) ) ]
25
26
26
27
extern crate thin_vec;
27
28
Original file line number Diff line number Diff line change
1
+ #![ cfg_attr( bootstrap, feature( extract_if) ) ]
2
+ #![ cfg_attr( bootstrap, feature( unsigned_is_multiple_of) ) ]
1
3
#![ feature( rustc_private) ]
2
4
#![ feature( cfg_match) ]
3
5
#![ feature( cell_update) ]
You can’t perform that action at this time.
0 commit comments