Skip to content

Commit cf61b6b

Browse files
committed
---
yaml --- r: 14818 b: refs/heads/try c: 1077677 h: refs/heads/master v: v3
1 parent bae1262 commit cf61b6b

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 014dd547a03df624539c968ab99816d5e7c23363
5+
refs/heads/try: 107767731a887cac817a4124d9fc52e62e54bd9c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

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

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ fn resolve_ty(ty: @ast::ty, cx: ctxt, visitor: visit::vt<ctxt>) {
104104

105105
alt ty.node {
106106
ast::ty_rptr({id: region_id, node: node}, _) {
107-
let region;
108107
alt node {
109-
ast::re_inferred { region = inferred_region; }
108+
ast::re_inferred | ast::re_self { /* no-op */ }
110109
ast::re_named(ident) {
111110
// If at item scope, introduce or reuse a binding. If at
112111
// block scope, require that the binding be introduced.
113112
let bindings = cx.bindings;
113+
let region;
114114
alt list::find(*bindings, {|b| ident == b.name}) {
115115
some(binding) { region = ty::re_named(binding.id); }
116116
none {
@@ -138,34 +138,11 @@ fn resolve_ty(ty: @ast::ty, cx: ctxt, visitor: visit::vt<ctxt>) {
138138
}
139139
}
140140
}
141-
}
142-
143-
ast::re_self {
144-
// For blocks, "self" means "the current block".
145-
//
146-
// TODO: What do we do in an alt?
147-
//
148-
// FIXME: Doesn't work in type items.
149141

150-
alt cx.parent {
151-
pa_item(item_id) | pa_nested_fn(item_id) {
152-
let def_id = {crate: ast::local_crate,
153-
node: item_id};
154-
region = ty::re_caller(def_id);
155-
}
156-
pa_block(block_id) {
157-
region = ty::re_block(block_id);
158-
}
159-
pa_crate {
160-
cx.sess.span_bug(ty.span,
161-
"region type outside item?!");
162-
}
163-
}
142+
let ast_type_to_region = cx.region_map.ast_type_to_region;
143+
ast_type_to_region.insert(region_id, region);
164144
}
165-
166145
}
167-
168-
cx.region_map.ast_type_to_region.insert(region_id, region);
169146
}
170147
_ { /* nothing to do */ }
171148
}

0 commit comments

Comments
 (0)