Skip to content

Commit 6c7b21f

Browse files
committed
---
yaml --- r: 37241 b: refs/heads/try c: b38092e h: refs/heads/master i: 37239: cdae555 v: v3
1 parent 8267e20 commit 6c7b21f

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
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: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: bbc46d527d70ac0bcab6c2b0763f059efc27a142
5+
refs/heads/try: b38092e9a2b5965ab8b8e73580e4d39ed701330a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/rustc/middle/ty.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,10 @@ fn subst(cx: ctxt,
14731473
fold_regions_and_ty(
14741474
cx, typ,
14751475
|r| match r {
1476-
re_bound(br_self) => substs.self_r.get(),
1476+
re_bound(br_self) => substs.self_r.expect(
1477+
#fmt("ty::subst: \
1478+
Reference to self region when given substs with no \
1479+
self region, ty = %s", ty_to_str(cx, typ))),
14771480
_ => r
14781481
},
14791482
|t| do_subst(cx, substs, t),
@@ -3910,9 +3913,11 @@ fn normalize_ty(cx: ctxt, t: t) -> t {
39103913
ty_enum(did, r) =>
39113914
match r.self_r {
39123915
Some(_) =>
3913-
// This enum has a self region. Get rid of it
3916+
// Use re_static since trans doesn't care about regions
39143917
mk_enum(cx, did,
3915-
{self_r: None, self_ty: None, tps: r.tps}),
3918+
{self_r: Some(ty::re_static),
3919+
self_ty: None,
3920+
tps: r.tps}),
39163921
None =>
39173922
t
39183923
},
@@ -3921,7 +3926,8 @@ fn normalize_ty(cx: ctxt, t: t) -> t {
39213926
match r.self_r {
39223927
Some(_) =>
39233928
// Ditto.
3924-
mk_class(cx, did, {self_r: None, self_ty: None, tps: r.tps}),
3929+
mk_class(cx, did, {self_r: Some(ty::re_static), self_ty: None,
3930+
tps: r.tps}),
39253931
None =>
39263932
t
39273933
},

branches/try/src/test/run-pass/issue-3447.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test
21
struct list<T> {
32
element: &self/T,
43
mut next: Option<@list<T>>
@@ -11,13 +10,13 @@ impl<T> list<T>{
1110
next: option::None
1211
};
1312

14-
self.next = Some(@newList);
13+
self.next = Some(@(move newList));
1514
}
1615
}
1716

1817
fn main() {
1918
let s = @"str";
20-
let ls: list<@str> = list {
19+
let ls = list {
2120
element: &s,
2221
next: option::None
2322
};

0 commit comments

Comments
 (0)