@@ -18,6 +18,7 @@ use middle::infer::{uok, ures};
18
18
use middle:: infer:: InferCtxt ;
19
19
use std:: cell:: RefCell ;
20
20
use std:: fmt:: Debug ;
21
+ use std:: marker:: PhantomData ;
21
22
use syntax:: ast;
22
23
use util:: snapshot_vec as sv;
23
24
@@ -79,7 +80,7 @@ pub struct UnificationTable<K:UnifyKey> {
79
80
/// made during the snapshot may either be *committed* or *rolled back*.
80
81
pub struct Snapshot < K : UnifyKey > {
81
82
// Link snapshot to the key type `K` of the table.
82
- marker : marker:: CovariantType < K > ,
83
+ marker : marker:: PhantomData < K > ,
83
84
snapshot : sv:: Snapshot ,
84
85
}
85
86
@@ -92,7 +93,7 @@ pub struct Node<K:UnifyKey> {
92
93
}
93
94
94
95
#[ derive( Copy ) ]
95
- pub struct Delegate < K > ;
96
+ pub struct Delegate < K > ( PhantomData < K > ) ;
96
97
97
98
// We can't use V:LatticeValue, much as I would like to,
98
99
// because frequently the pattern is that V=Option<U> for some
@@ -102,14 +103,14 @@ pub struct Delegate<K>;
102
103
impl < K : UnifyKey > UnificationTable < K > {
103
104
pub fn new ( ) -> UnificationTable < K > {
104
105
UnificationTable {
105
- values : sv:: SnapshotVec :: new ( Delegate ) ,
106
+ values : sv:: SnapshotVec :: new ( Delegate ( PhantomData ) ) ,
106
107
}
107
108
}
108
109
109
110
/// Starts a new snapshot. Each snapshot must be either
110
111
/// rolled back or committed in a "LIFO" (stack) order.
111
112
pub fn snapshot ( & mut self ) -> Snapshot < K > {
112
- Snapshot { marker : marker:: CovariantType :: < K > ,
113
+ Snapshot { marker : marker:: PhantomData :: < K > ,
113
114
snapshot : self . values . start_snapshot ( ) }
114
115
}
115
116
0 commit comments