@@ -18,6 +18,7 @@ use middle::infer::{uok, ures};
1818use middle:: infer:: InferCtxt ;
1919use std:: cell:: RefCell ;
2020use std:: fmt:: Debug ;
21+ use std:: marker:: PhantomData ;
2122use syntax:: ast;
2223use util:: snapshot_vec as sv;
2324
@@ -79,7 +80,7 @@ pub struct UnificationTable<K:UnifyKey> {
7980/// made during the snapshot may either be *committed* or *rolled back*.
8081pub struct Snapshot < K : UnifyKey > {
8182 // Link snapshot to the key type `K` of the table.
82- marker : marker:: CovariantType < K > ,
83+ marker : marker:: PhantomData < K > ,
8384 snapshot : sv:: Snapshot ,
8485}
8586
@@ -92,7 +93,7 @@ pub struct Node<K:UnifyKey> {
9293}
9394
9495#[ derive( Copy ) ]
95- pub struct Delegate < K > ;
96+ pub struct Delegate < K > ( PhantomData < K > ) ;
9697
9798// We can't use V:LatticeValue, much as I would like to,
9899// because frequently the pattern is that V=Option<U> for some
@@ -102,14 +103,14 @@ pub struct Delegate<K>;
102103impl < K : UnifyKey > UnificationTable < K > {
103104 pub fn new ( ) -> UnificationTable < K > {
104105 UnificationTable {
105- values : sv:: SnapshotVec :: new ( Delegate ) ,
106+ values : sv:: SnapshotVec :: new ( Delegate ( PhantomData ) ) ,
106107 }
107108 }
108109
109110 /// Starts a new snapshot. Each snapshot must be either
110111 /// rolled back or committed in a "LIFO" (stack) order.
111112 pub fn snapshot ( & mut self ) -> Snapshot < K > {
112- Snapshot { marker : marker:: CovariantType :: < K > ,
113+ Snapshot { marker : marker:: PhantomData :: < K > ,
113114 snapshot : self . values . start_snapshot ( ) }
114115 }
115116
0 commit comments