From ce5fd302702a76e4b65a94128189b0f2d3a22c32 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 30 May 2013 21:01:25 -0400 Subject: [PATCH] Fix parser test --- src/libsyntax/parse/mod.rs | 2 +- .../borrowck-pat-by-value-binding.rs | 2 +- .../compile-fail/noncopyable-match-pattern.rs | 23 ------------------- .../resolve-inconsistent-binding-mode.rs | 2 +- 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 src/test/compile-fail/noncopyable-match-pattern.rs 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) { fn match_const_opt_by_value(v: &const Option) { 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 or the MIT license -// , 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(_) => {} } }