diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-08-06 12:34:08 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-08-06 15:36:30 -0700 |
| commit | ecaf9e39c9435fa2de4fe393c4b263be36eb2d99 (patch) | |
| tree | 775f69be65adff65551d96173dd797e32e2c3157 /src/rustc/front | |
| parent | d3a9bb1bd4a1d510bbaca2ab1121e4c85a239247 (diff) | |
| download | rust-ecaf9e39c9435fa2de4fe393c4b263be36eb2d99.tar.gz rust-ecaf9e39c9435fa2de4fe393c4b263be36eb2d99.zip | |
Convert alt to match. Stop parsing alt
Diffstat (limited to 'src/rustc/front')
| -rw-r--r-- | src/rustc/front/config.rs | 4 | ||||
| -rw-r--r-- | src/rustc/front/intrinsic_inject.rs | 2 | ||||
| -rw-r--r-- | src/rustc/front/test.rs | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/rustc/front/config.rs b/src/rustc/front/config.rs index 92035856ddf..ee9000b80e0 100644 --- a/src/rustc/front/config.rs +++ b/src/rustc/front/config.rs @@ -82,9 +82,9 @@ fn fold_foreign_mod(cx: ctxt, nm: ast::foreign_mod, fn filter_stmt(cx: ctxt, &&stmt: @ast::stmt) -> option<@ast::stmt> { - alt stmt.node { + match stmt.node { ast::stmt_decl(decl, _) => { - alt decl.node { + match decl.node { ast::decl_item(item) => { if item_in_cfg(cx, item) { option::some(stmt) diff --git a/src/rustc/front/intrinsic_inject.rs b/src/rustc/front/intrinsic_inject.rs index cc80a524f31..85770b7b6dd 100644 --- a/src/rustc/front/intrinsic_inject.rs +++ b/src/rustc/front/intrinsic_inject.rs @@ -15,7 +15,7 @@ fn inject_intrinsic(sess: session, ~[], sess.parse_sess); let item = - alt item { + match item { some(i) => i, none => { sess.fatal(~"no item found in intrinsic module"); diff --git a/src/rustc/front/test.rs b/src/rustc/front/test.rs index 66e430f27cd..9c54f6fa981 100644 --- a/src/rustc/front/test.rs +++ b/src/rustc/front/test.rs @@ -70,7 +70,7 @@ fn fold_mod(_cx: test_ctxt, m: ast::_mod, fld: fold::ast_fold) -> ast::_mod { // FIXME (#2403): This is sloppy. Instead we should have some mechanism to // indicate to the translation pass which function we want to be main. fn nomain(&&item: @ast::item) -> option<@ast::item> { - alt item.node { + match item.node { ast::item_fn(_, _, _) => { if *item.ident == ~"main" { option::none @@ -102,7 +102,7 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) -> debug!{"current path: %s", ast_util::path_name_i(cx.path)}; if is_test_fn(i) { - alt i.node { + match i.node { ast::item_fn(decl, _, _) if decl.purity == ast::unsafe_fn => { cx.sess.span_fatal( i.span, @@ -129,7 +129,7 @@ fn is_test_fn(i: @ast::item) -> bool { vec::len(attr::find_attrs_by_name(i.attrs, ~"test")) > 0u; fn has_test_signature(i: @ast::item) -> bool { - alt i.node { + match i.node { ast::item_fn(decl, tps, _) => { let input_cnt = vec::len(decl.inputs); let no_output = decl.output.node == ast::ty_nil; @@ -246,7 +246,7 @@ fn mk_path(cx: test_ctxt, path: ~[ast::ident]) -> ~[ast::ident] { // the paths with std:: let is_std = { let items = attr::find_linkage_metas(cx.crate.node.attrs); - alt attr::last_meta_item_value_str_by_name(items, ~"name") { + match attr::last_meta_item_value_str_by_name(items, ~"name") { some(@~"std") => true, _ => false } |
