@@ -34,13 +34,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<*mut U> for *mut T {}
3434pub trait DispatchFromDyn < T > { }
3535
3636// &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 { }
3838// &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 { }
4040// *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 { }
4242// *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 { }
4444impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < Box < U > > for Box < T > { }
4545
4646#[ lang = "receiver" ]
@@ -285,7 +285,6 @@ impl PartialEq for u32 {
285285 }
286286}
287287
288-
289288impl PartialEq for u64 {
290289 fn eq ( & self , other : & u64 ) -> bool {
291290 ( * self ) == ( * other)
@@ -358,7 +357,7 @@ impl<T: ?Sized> PartialEq for *const T {
358357 }
359358}
360359
361- impl < T : PartialEq > PartialEq for Option < T > {
360+ impl < T : PartialEq > PartialEq for Option < T > {
362361 fn eq ( & self , other : & Self ) -> bool {
363362 match ( self , other) {
364363 ( Some ( lhs) , Some ( rhs) ) => * lhs == * rhs,
@@ -469,7 +468,11 @@ pub fn panic(_msg: &'static str) -> ! {
469468#[ track_caller]
470469fn panic_bounds_check ( index : usize , len : usize ) -> ! {
471470 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+ ) ;
473476 intrinsics:: abort ( ) ;
474477 }
475478}
@@ -495,9 +498,8 @@ pub trait Deref {
495498}
496499
497500#[ repr( transparent) ]
498- #[ rustc_layout_scalar_valid_range_start( 1 ) ]
499501#[ 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 ) } > ) ;
501503
502504impl < T : ?Sized , U : ?Sized > CoerceUnsized < NonNull < U > > for NonNull < T > where T : Unsize < U > { }
503505impl < T : ?Sized , U : ?Sized > DispatchFromDyn < NonNull < U > > for NonNull < T > where T : Unsize < U > { }
@@ -585,7 +587,7 @@ pub mod libc {
585587 // functions. legacy_stdio_definitions.lib which provides the printf wrapper functions as normal
586588 // symbols to link against.
587589 #[ 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" ) ) ]
589591 extern "C" {
590592 pub fn printf ( format : * const i8 , ...) -> i32 ;
591593 }
@@ -624,7 +626,7 @@ impl<T> Index<usize> for [T] {
624626 }
625627}
626628
627- extern {
629+ extern "C" {
628630 type VaListImpl ;
629631}
630632
@@ -634,23 +636,33 @@ pub struct VaList<'a>(&'a mut VaListImpl);
634636
635637#[ rustc_builtin_macro]
636638#[ rustc_macro_transparency = "semitransparent" ]
637- pub macro stringify( $( $t: tt) * ) { /* compiler built-in */ }
639+ pub macro stringify( $( $t: tt) * ) {
640+ /* compiler built-in */
641+ }
638642
639643#[ rustc_builtin_macro]
640644#[ rustc_macro_transparency = "semitransparent" ]
641- pub macro file ( ) { /* compiler built-in */ }
645+ pub macro file ( ) {
646+ /* compiler built-in */
647+ }
642648
643649#[ rustc_builtin_macro]
644650#[ rustc_macro_transparency = "semitransparent" ]
645- pub macro line ( ) { /* compiler built-in */ }
651+ pub macro line ( ) {
652+ /* compiler built-in */
653+ }
646654
647655#[ rustc_builtin_macro]
648656#[ rustc_macro_transparency = "semitransparent" ]
649- pub macro cfg ( ) { /* compiler built-in */ }
657+ pub macro cfg ( ) {
658+ /* compiler built-in */
659+ }
650660
651661#[ rustc_builtin_macro]
652662#[ rustc_macro_transparency = "semitransparent" ]
653- pub macro global_asm ( ) { /* compiler built-in */ }
663+ pub macro global_asm ( ) {
664+ /* compiler built-in */
665+ }
654666
655667pub static A_STATIC : u8 = 42 ;
656668
0 commit comments