Skip to content

Commit fa141e0

Browse files
committed
---
yaml --- r: 187005 b: refs/heads/try c: 62b5177 h: refs/heads/master i: 187003: 223dc08 v: v3
1 parent 07fb949 commit fa141e0

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
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 199b992e6306ead7a2be1e086768879983c08a20
5+
refs/heads/try: 62b517772a11e2ff5accffd03e1832535f9bdc1d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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/try/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)