File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 11use std:: convert:: TryFrom ;
2- #[ cfg( any ( nightly , feature = "nightly" ) ) ]
2+ #[ cfg( feature = "nightly" ) ]
33use std:: ops:: { ControlFlow , FromResidual , Try } ;
44
55use crate :: bindings;
@@ -116,7 +116,7 @@ impl From<HostingError> for HostingResult {
116116 }
117117}
118118
119- #[ cfg( any ( nightly , feature = "nightly" ) ) ]
119+ #[ cfg( feature = "nightly" ) ]
120120impl Try for HostingResult {
121121 type Output = HostingSuccess ;
122122 type Residual = HostingError ;
@@ -131,7 +131,7 @@ impl Try for HostingResult {
131131 }
132132}
133133
134- #[ cfg( any ( nightly , feature = "nightly" ) ) ]
134+ #[ cfg( feature = "nightly" ) ]
135135impl FromResidual for HostingResult {
136136 fn from_residual ( r : HostingError ) -> Self {
137137 HostingResult ( Err ( r) )
Original file line number Diff line number Diff line change @@ -112,20 +112,20 @@ pub enum LoadHostfxrError {
112112}
113113
114114const unsafe fn maybe_uninit_slice_assume_init_ref < T > ( slice : & [ MaybeUninit < T > ] ) -> & [ T ] {
115- #[ cfg( any ( nightly , feature = "nightly" ) ) ]
115+ #[ cfg( feature = "nightly" ) ]
116116 unsafe {
117117 MaybeUninit :: slice_assume_init_ref ( slice)
118118 }
119- #[ cfg( not( any ( nightly , feature = "nightly" ) ) ) ]
119+ #[ cfg( not( feature = "nightly" ) ) ]
120120 unsafe {
121- & * ( slice as * const [ MaybeUninit < T > ] as * const [ T ] )
121+ & * ( std :: ptr :: from_ref :: < [ MaybeUninit < T > ] > ( slice ) as * const [ T ] )
122122 }
123123}
124124
125125fn maybe_uninit_uninit_array < T , const LEN : usize > ( ) -> [ MaybeUninit < T > ; LEN ] {
126- #[ cfg( any ( nightly , feature = "nightly" ) ) ]
126+ #[ cfg( feature = "nightly" ) ]
127127 return MaybeUninit :: < T > :: uninit_array :: < LEN > ( ) ;
128- #[ cfg( not( any ( nightly , feature = "nightly" ) ) ) ]
128+ #[ cfg( not( feature = "nightly" ) ) ]
129129 unsafe {
130130 MaybeUninit :: < [ MaybeUninit < T > ; LEN ] > :: uninit ( ) . assume_init ( )
131131 }
Original file line number Diff line number Diff line change @@ -36,4 +36,5 @@ pub(crate) trait ToStringErrorInner: Debug + Display + Error + Clone {
3636 fn index ( & self ) -> Option < usize > ;
3737}
3838
39+ #[ allow( dead_code) ]
3940pub ( crate ) trait MissingNulTerminatorInner : Debug + Display + Error + Clone { }
Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ impl PdCStr {
6767 pub ( crate ) fn from_inner ( inner : & PdCStrInnerImpl ) -> & Self {
6868 // Safety:
6969 // Safe because PdCStr has the same layout as PdCStrInnerImpl
70- unsafe { & * ( inner as * const PdCStrInnerImpl as * const PdCStr ) }
70+ unsafe { & * ( std :: ptr :: from_ref :: < PdCStrInnerImpl > ( inner ) as * const PdCStr ) }
7171 }
7272 #[ inline]
7373 pub ( crate ) fn as_inner ( & self ) -> & PdCStrInnerImpl {
7474 // Safety:
7575 // Safe because PdCStr has the same layout as PdCStrInnerImpl
76- unsafe { & * ( self as * const PdCStr as * const PdCStrInnerImpl ) }
76+ unsafe { & * ( std :: ptr :: from_ref :: < PdCStr > ( self ) as * const PdCStrInnerImpl ) }
7777 }
7878
7979 /// Returns a raw pointer to the string.
You can’t perform that action at this time.
0 commit comments