File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
rustc_data_structures/src Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,12 @@ where
565565 }
566566}
567567
568+ impl_stable_traits_for_trivial_type ! ( :: std:: ffi:: OsStr ) ;
569+ impl_stable_traits_for_trivial_type ! ( :: std:: ffi:: OsString ) ;
570+
571+ impl_stable_traits_for_trivial_type ! ( :: std:: ffi:: CStr ) ;
572+ impl_stable_traits_for_trivial_type ! ( :: std:: ffi:: CString ) ;
573+
568574impl_stable_traits_for_trivial_type ! ( :: std:: path:: Path ) ;
569575impl_stable_traits_for_trivial_type ! ( :: std:: path:: PathBuf ) ;
570576
Original file line number Diff line number Diff line change 1+ use std:: ffi:: { CStr , OsStr } ;
12use std:: intrinsics:: transmute_unchecked;
23use std:: mem:: MaybeUninit ;
34
@@ -65,6 +66,18 @@ impl<T> EraseType for &'_ [T] {
6566 type Result = [ u8 ; size_of :: < & ' static [ ( ) ] > ( ) ] ;
6667}
6768
69+ impl EraseType for & ' _ str {
70+ type Result = [ u8 ; size_of :: < & ' static str > ( ) ] ;
71+ }
72+
73+ impl EraseType for & ' _ OsStr {
74+ type Result = [ u8 ; size_of :: < & ' static OsStr > ( ) ] ;
75+ }
76+
77+ impl EraseType for & ' _ CStr {
78+ type Result = [ u8 ; size_of :: < & ' static CStr > ( ) ] ;
79+ }
80+
6881impl < T > EraseType for & ' _ ty:: List < T > {
6982 type Result = [ u8 ; size_of :: < & ' static ty:: List < ( ) > > ( ) ] ;
7083}
@@ -180,6 +193,18 @@ impl<T> EraseType for Option<&'_ [T]> {
180193 type Result = [ u8 ; size_of :: < Option < & ' static [ ( ) ] > > ( ) ] ;
181194}
182195
196+ impl EraseType for Option < & ' _ str > {
197+ type Result = [ u8 ; size_of :: < Option < & ' static str > > ( ) ] ;
198+ }
199+
200+ impl EraseType for Option < & ' _ OsStr > {
201+ type Result = [ u8 ; size_of :: < Option < & ' static OsStr > > ( ) ] ;
202+ }
203+
204+ impl EraseType for Option < & ' _ CStr > {
205+ type Result = [ u8 ; size_of :: < Option < & ' static CStr > > ( ) ] ;
206+ }
207+
183208impl EraseType for Option < mir:: DestructuredConstant < ' _ > > {
184209 type Result = [ u8 ; size_of :: < Option < mir:: DestructuredConstant < ' static > > > ( ) ] ;
185210}
You can’t perform that action at this time.
0 commit comments