diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-05-30 21:01:25 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-05-30 21:01:25 -0400 |
| commit | ce5fd302702a76e4b65a94128189b0f2d3a22c32 (patch) | |
| tree | 9378366d739d2758c7c06f885b8a47985935aa86 | |
| parent | 21951e503d14deaefab27d8d560319213fdf5712 (diff) | |
| download | rust-ce5fd302702a76e4b65a94128189b0f2d3a22c32.tar.gz rust-ce5fd302702a76e4b65a94128189b0f2d3a22c32.zip | |
Fix parser test
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/borrowck-pat-by-value-binding.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/noncopyable-match-pattern.rs | 23 | ||||
| -rw-r--r-- | src/test/compile-fail/resolve-inconsistent-binding-mode.rs | 2 |
4 files changed, 3 insertions, 26 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index c054bf55274..9d5cb131fec 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -485,7 +485,7 @@ mod test { #[test] fn parse_ident_pat () { let parser = string_to_parser(@~"b"); - assert_eq!(parser.parse_pat(false), + assert_eq!(parser.parse_pat(), @ast::pat{id:1, // fixme node: ast::pat_ident(ast::bind_infer, @ast::Path{ diff --git a/src/test/compile-fail/borrowck-pat-by-value-binding.rs b/src/test/compile-fail/borrowck-pat-by-value-binding.rs index d60ed3d0e37..e77f5245d7d 100644 --- a/src/test/compile-fail/borrowck-pat-by-value-binding.rs +++ b/src/test/compile-fail/borrowck-pat-by-value-binding.rs @@ -36,7 +36,7 @@ fn match_const_opt_by_imm_ref(v: &const Option<int>) { fn match_const_opt_by_value(v: &const Option<int>) { match *v { - Some(copy i) => process(i), + Some(i) => process(i), None => () } } diff --git a/src/test/compile-fail/noncopyable-match-pattern.rs b/src/test/compile-fail/noncopyable-match-pattern.rs deleted file mode 100644 index a7c8950486c..00000000000 --- a/src/test/compile-fail/noncopyable-match-pattern.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use std::unstable; - -fn main() { - unsafe { - let x = Some(unstable::sync::exclusive(false)); - match x { - Some(copy z) => { //~ ERROR copying a value of non-copyable type - do z.with |b| { assert!(!*b); } - } - None => fail!() - } - } -} diff --git a/src/test/compile-fail/resolve-inconsistent-binding-mode.rs b/src/test/compile-fail/resolve-inconsistent-binding-mode.rs index 33cc934c7b3..65fbbfc6e19 100644 --- a/src/test/compile-fail/resolve-inconsistent-binding-mode.rs +++ b/src/test/compile-fail/resolve-inconsistent-binding-mode.rs @@ -14,7 +14,7 @@ enum opts { fn matcher1(x: opts) { match x { - a(ref i) | b(copy i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 + a(ref i) | b(i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 c(_) => {} } } |
