@@ -34,13 +34,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
34
34
pub trait DispatchFromDyn < T > { }
35
35
36
36
// &T -> &U
37
- impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < & ' a U > for & ' a T { }
37
+ impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < & ' a U > for & ' a T { }
38
38
// &mut T -> &mut U
39
- impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < & ' a mut U > for & ' a mut T { }
39
+ impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < & ' a mut U > for & ' a mut T { }
40
40
// *const T -> *const U
41
- impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < * const U > for * const T { }
41
+ impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < * const U > for * const T { }
42
42
// *mut T -> *mut U
43
- impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < * mut U > for * mut T { }
43
+ impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < * mut U > for * mut T { }
44
44
impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < Box < U > > for Box < T > { }
45
45
46
46
#[ lang = "receiver" ]
@@ -285,7 +285,6 @@ impl PartialEq for u32 {
285
285
}
286
286
}
287
287
288
-
289
288
impl PartialEq for u64 {
290
289
fn eq ( & self , other : & u64 ) -> bool {
291
290
( * self ) == ( * other)
@@ -358,7 +357,7 @@ impl<T: ?Sized> PartialEq for *const T {
358
357
}
359
358
}
360
359
361
- impl < T : PartialEq > PartialEq for Option < T > {
360
+ impl < T : PartialEq > PartialEq for Option < T > {
362
361
fn eq ( & self , other : & Self ) -> bool {
363
362
match ( self , other) {
364
363
( Some ( lhs) , Some ( rhs) ) => * lhs == * rhs,
@@ -469,7 +468,11 @@ pub fn panic(_msg: &'static str) -> ! {
469
468
#[ track_caller]
470
469
fn panic_bounds_check ( index : usize , len : usize ) -> ! {
471
470
unsafe {
472
- libc:: printf ( "index out of bounds: the len is %d but the index is %d\n \0 " as * const str as * const i8 , len, index) ;
471
+ libc:: printf (
472
+ "index out of bounds: the len is %d but the index is %d\n \0 " as * const str as * const i8 ,
473
+ len,
474
+ index,
475
+ ) ;
473
476
intrinsics:: abort ( ) ;
474
477
}
475
478
}
@@ -495,9 +498,8 @@ pub trait Deref {
495
498
}
496
499
497
500
#[ repr( transparent) ]
498
- #[ rustc_layout_scalar_valid_range_start( 1 ) ]
499
501
#[ rustc_nonnull_optimization_guaranteed]
500
- pub struct NonNull < T : ?Sized > ( pub * const T ) ;
502
+ pub struct NonNull < T : ?Sized > ( pub Ranged < * const T , { 1 ..= ( usize :: MAX as u128 ) } > ) ;
501
503
502
504
impl < T : ?Sized , U : ?Sized > CoerceUnsized < NonNull < U > > for NonNull < T > where T : Unsize < U > { }
503
505
impl < T : ?Sized , U : ?Sized > DispatchFromDyn < NonNull < U > > for NonNull < T > where T : Unsize < U > { }
@@ -585,7 +587,7 @@ pub mod libc {
585
587
// functions. legacy_stdio_definitions.lib which provides the printf wrapper functions as normal
586
588
// symbols to link against.
587
589
#[ cfg_attr( unix, link( name = "c" ) ) ]
588
- #[ cfg_attr( target_env= "msvc" , link( name= "legacy_stdio_definitions" ) ) ]
590
+ #[ cfg_attr( target_env = "msvc" , link( name = "legacy_stdio_definitions" ) ) ]
589
591
extern "C" {
590
592
pub fn printf ( format : * const i8 , ...) -> i32 ;
591
593
}
@@ -624,7 +626,7 @@ impl<T> Index<usize> for [T] {
624
626
}
625
627
}
626
628
627
- extern {
629
+ extern "C" {
628
630
type VaListImpl ;
629
631
}
630
632
@@ -634,23 +636,33 @@ pub struct VaList<'a>(&'a mut VaListImpl);
634
636
635
637
#[ rustc_builtin_macro]
636
638
#[ rustc_macro_transparency = "semitransparent" ]
637
- pub macro stringify( $( $t: tt) * ) { /* compiler built-in */ }
639
+ pub macro stringify( $( $t: tt) * ) {
640
+ /* compiler built-in */
641
+ }
638
642
639
643
#[ rustc_builtin_macro]
640
644
#[ rustc_macro_transparency = "semitransparent" ]
641
- pub macro file ( ) { /* compiler built-in */ }
645
+ pub macro file ( ) {
646
+ /* compiler built-in */
647
+ }
642
648
643
649
#[ rustc_builtin_macro]
644
650
#[ rustc_macro_transparency = "semitransparent" ]
645
- pub macro line ( ) { /* compiler built-in */ }
651
+ pub macro line ( ) {
652
+ /* compiler built-in */
653
+ }
646
654
647
655
#[ rustc_builtin_macro]
648
656
#[ rustc_macro_transparency = "semitransparent" ]
649
- pub macro cfg ( ) { /* compiler built-in */ }
657
+ pub macro cfg ( ) {
658
+ /* compiler built-in */
659
+ }
650
660
651
661
#[ rustc_builtin_macro]
652
662
#[ rustc_macro_transparency = "semitransparent" ]
653
- pub macro global_asm ( ) { /* compiler built-in */ }
663
+ pub macro global_asm ( ) {
664
+ /* compiler built-in */
665
+ }
654
666
655
667
pub static A_STATIC : u8 = 42 ;
656
668
0 commit comments