Skip to content

Commit 47e6540

Browse files
committed
Disallow calling generic methods through a boxed iface
1 parent 5e647d7 commit 47e6540

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rustc/middle/typeck.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,10 @@ fn lookup_method_inner(fcx: @fn_ctxt, expr: @ast::expr,
18491849
tcx.sess.span_fatal(
18501850
expr.span, "can not call a method that contains a \
18511851
self type through a boxed iface");
1852+
} else if (*m.tps).len() > 0u {
1853+
tcx.sess.span_fatal(
1854+
expr.span, "can not call a generic method through a \
1855+
boxed iface");
18521856
}
18531857
ret some({method_ty: fty,
18541858
n_tps: vec::len(*m.tps),

0 commit comments

Comments
 (0)