File tree 2 files changed +20
-0
lines changed
testsuite/rust/compile/torture
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ class RustLangItem
73
73
MUT_PTR,
74
74
CONST_SLICE_PTR,
75
75
76
+ // https://github.com/rust-lang/rust/blob/master/library/core/src/marker.rs
77
+ PHANTOM_DATA,
78
+
76
79
// functions
77
80
FN_ONCE,
78
81
FN_ONCE_OUTPUT,
@@ -222,6 +225,10 @@ class RustLangItem
222
225
{
223
226
return ItemType::CONST_SLICE_PTR;
224
227
}
228
+ else if (item.compare (" phantom_data" ) == 0 )
229
+ {
230
+ return ItemType::PHANTOM_DATA;
231
+ }
225
232
else if (item.compare (" fn_once" ) == 0 )
226
233
{
227
234
return ItemType::FN_ONCE;
@@ -308,6 +315,8 @@ class RustLangItem
308
315
return " mut_ptr" ;
309
316
case CONST_SLICE_PTR:
310
317
return " const_slice_ptr" ;
318
+ case PHANTOM_DATA:
319
+ return " phantom_data" ;
311
320
case FN_ONCE:
312
321
return " fn_once" ;
313
322
case FN_ONCE_OUTPUT:
Original file line number Diff line number Diff line change
1
+ // { dg-options "-w" }
2
+ #[ lang = "phantom_data" ]
3
+ struct PhantomData < T > ;
4
+
5
+ trait Hash {
6
+ fn hash < H > ( & self , state : & mut H ) ;
7
+ }
8
+
9
+ impl < T > Hash for PhantomData < T > {
10
+ fn hash < H > ( & self , state : & mut H ) { }
11
+ }
You can’t perform that action at this time.
0 commit comments