Skip to content

Commit df06d2d

Browse files
committed
---
yaml --- r: 21847 b: refs/heads/snap-stage3 c: 4cad58c h: refs/heads/master i: 21845: 40ffa2f 21843: 346b09d 21839: edd4df6 v: v3
1 parent a7c6012 commit df06d2d

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 39d33a653fd4aebae813ec6ad83ea2ea6009c64f
4+
refs/heads/snap-stage3: 4cad58c4645c7e2247e0655d4c1d7d70ae75339b
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/rustc/middle/typeck/check/regionck.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,15 @@ fn visit_expr(expr: @ast::expr, &&rcx: @rcx, v: rvt) {
183183
// `constrain_auto_ref()` on all exprs. But that causes a
184184
// lot of spurious errors because of how the region
185185
// hierarchy is setup.
186-
let tcx = rcx.fcx.tcx();
187186
if rcx.fcx.ccx.method_map.contains_key(callee.id) {
188187
match callee.node {
189188
ast::expr_field(base, _, _) => {
190189
constrain_auto_ref(rcx, base);
191190
}
192191
_ => {
193-
tcx.sess.span_bug(
194-
callee.span,
195-
~"call of method that is not a field");
192+
// This can happen if you have code like
193+
// (x[0])() where `x[0]` is overloaded. Just
194+
// ignore it.
196195
}
197196
}
198197
} else {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use dvec::DVec;
2+
3+
fn foo() -> int { 22 }
4+
5+
fn main() {
6+
let x = DVec::<@fn() -> int>();
7+
x.push(foo);
8+
assert (x[0])() == 22;
9+
}

0 commit comments

Comments
 (0)