diff options
| author | Patrick Walton <[email protected]> | 2010-08-20 17:14:47 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-08-20 17:15:27 -0700 |
| commit | ed92925083ebe26e6e3a9cec6b1f3906f9ce2dd1 (patch) | |
| tree | 8c9929c674f4e497c251c3ba636ad4ad27d7bf8c /src/boot | |
| parent | Stringify op tokens. (diff) | |
| download | rust-ed92925083ebe26e6e3a9cec6b1f3906f9ce2dd1.tar.xz rust-ed92925083ebe26e6e3a9cec6b1f3906f9ce2dd1.zip | |
Warn when the value of "spawn" is unused, as it's useless
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/fe/item.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml index 91a0c3dd..e9e0e62a 100644 --- a/src/boot/fe/item.ml +++ b/src/boot/fe/item.ml @@ -508,7 +508,11 @@ and parse_stmts (ps:pstate) : Ast.stmt array = let stmts = expand_tags_to_stmts ps item in spans ps stmts apos (Ast.STMT_decl decl) - | _ -> + | token -> + if token = SPAWN then + prerr_endline ("warning: \"spawn\" with unused result spawns a " ^ + "task that immediately dies"); + let (lstmts, lval) = ctxt "stmt: lval" parse_lval ps in let stmts = match peek ps with |