Skip to content

Commit 6f709d9

Browse files
committed
---
yaml --- r: 184167 b: refs/heads/beta c: 62b5177 h: refs/heads/master i: 184165: 8d3ccdb 184163: aa86552 184159: 0bfec7b v: v3
1 parent 2831be3 commit 6f709d9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 199b992e6306ead7a2be1e086768879983c08a20
34+
refs/heads/beta: 62b517772a11e2ff5accffd03e1832535f9bdc1d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: c65fb1a81e5dc58cf171cc47f65de9e6e2119247

branches/beta/src/librustc/middle/infer/type_variable.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use self::UndoEntry::*;
1414

1515
use middle::ty::{self, Ty};
1616
use std::cmp::min;
17+
use std::marker::PhantomData;
1718
use std::mem;
1819
use std::u32;
1920
use util::snapshot_vec as sv;
@@ -42,7 +43,7 @@ enum UndoEntry {
4243
Relate(ty::TyVid, ty::TyVid),
4344
}
4445

45-
struct Delegate<'tcx>;
46+
struct Delegate<'tcx>(PhantomData<&'tcx ()>);
4647

4748
type Relation = (RelationDir, ty::TyVid);
4849

@@ -64,7 +65,7 @@ impl RelationDir {
6465

6566
impl<'tcx> TypeVariableTable<'tcx> {
6667
pub fn new() -> TypeVariableTable<'tcx> {
67-
TypeVariableTable { values: sv::SnapshotVec::new(Delegate) }
68+
TypeVariableTable { values: sv::SnapshotVec::new(Delegate(PhantomData)) }
6869
}
6970

7071
fn relations<'a>(&'a mut self, a: ty::TyVid) -> &'a mut Vec<Relation> {

branches/beta/src/librustc/middle/infer/unify.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use middle::infer::{uok, ures};
1818
use middle::infer::InferCtxt;
1919
use std::cell::RefCell;
2020
use std::fmt::Debug;
21+
use std::marker::PhantomData;
2122
use syntax::ast;
2223
use 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*.
8081
pub 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>;
102103
impl<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

Comments
 (0)