aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-24 10:24:37 -0700
committerPatrick Walton <[email protected]>2011-03-24 10:29:15 -0700
commit2c21195b216a93b8a97de1cab45da76ddb24b90b (patch)
treee8b63131b39aa625152dc33d9669ba7221f35e5f /src
parentrustc: Don't try to export symbols for crazy architectures from rustllvm.dll.... (diff)
downloadrust-2c21195b216a93b8a97de1cab45da76ddb24b90b.tar.xz
rust-2c21195b216a93b8a97de1cab45da76ddb24b90b.zip
rustc: Emit a better error message when a type is used where a value was expected
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/typeck.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index a52b39e2..47ef81c1 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -184,6 +184,11 @@ fn ty_params_and_ty_for_def(@fn_ctxt fcx, &ast.def defn)
ret tup(none[vec[ast.def_id]], plain_ty(ty.ty_nil));
}
+ case (ast.def_ty(_)) {
+ fcx.ccx.sess.err("expected value but found type");
+ fail;
+ }
+
case (_) {
// FIXME: handle other names.
fcx.ccx.sess.unimpl("definition variant");