We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3015b8 commit 05b7eb6Copy full SHA for 05b7eb6
src/comp/middle/typeck.rs
@@ -527,7 +527,17 @@ mod collect {
527
fn ty_of_arg(@ctxt cx, &ast::arg a) -> ty::arg {
528
auto ty_mode = ast_mode_to_mode(a.mode);
529
auto f = bind getter(cx, _);
530
- ret rec(mode=ty_mode, ty=ast_ty_to_ty(cx.tcx, f, a.ty));
+ auto tt = ast_ty_to_ty(cx.tcx, f, a.ty);
531
+ if (ty::type_has_dynamic_size(cx.tcx, tt)) {
532
+ alt (ty_mode) {
533
+ case (mo_val) {
534
+ cx.tcx.sess.span_err(a.ty.span,
535
+ "Dynamically sized arguments must be passed by alias");
536
+ }
537
+ case (_) { }
538
539
540
+ ret rec(mode=ty_mode, ty=tt);
541
}
542
543
fn ty_of_method(@ctxt cx, &@ast::method m) -> ty::method {
0 commit comments