File tree 2 files changed +31
-0
lines changed
rustc_data_structures/src
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,12 @@ where
565
565
}
566
566
}
567
567
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
+
568
574
impl_stable_traits_for_trivial_type ! ( :: std:: path:: Path ) ;
569
575
impl_stable_traits_for_trivial_type ! ( :: std:: path:: PathBuf ) ;
570
576
Original file line number Diff line number Diff line change
1
+ use std:: ffi:: { CStr , OsStr } ;
1
2
use std:: intrinsics:: transmute_unchecked;
2
3
use std:: mem:: MaybeUninit ;
3
4
@@ -65,6 +66,18 @@ impl<T> EraseType for &'_ [T] {
65
66
type Result = [ u8 ; size_of :: < & ' static [ ( ) ] > ( ) ] ;
66
67
}
67
68
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
+
68
81
impl < T > EraseType for & ' _ ty:: List < T > {
69
82
type Result = [ u8 ; size_of :: < & ' static ty:: List < ( ) > > ( ) ] ;
70
83
}
@@ -180,6 +193,18 @@ impl<T> EraseType for Option<&'_ [T]> {
180
193
type Result = [ u8 ; size_of :: < Option < & ' static [ ( ) ] > > ( ) ] ;
181
194
}
182
195
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
+
183
208
impl EraseType for Option < mir:: DestructuredConstant < ' _ > > {
184
209
type Result = [ u8 ; size_of :: < Option < mir:: DestructuredConstant < ' static > > > ( ) ] ;
185
210
}
You can’t perform that action at this time.
0 commit comments