diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py index 937c231a473e..e53d6c718c15 100755 --- a/src/etc/generate-keyword-tests.py +++ b/src/etc/generate-keyword-tests.py @@ -34,15 +34,17 @@ template = """// Copyright %d The Rust Project Developers. See the COPYRIGHT // option. This file may not be copied, modified, or distributed // except according to those terms. +// compile-flags: -Z parse-only + // This file was auto-generated using 'src/etc/generate-keyword-tests.py %s' fn main() { - let %s = "foo"; //~ error: ident + let %s = "foo"; //~ error: expected pattern, found keyword `%s` } """ test_dir = os.path.abspath( - os.path.join(os.path.dirname(__file__), '../test/compile-fail') + os.path.join(os.path.dirname(__file__), '../test/parse-fail') ) for kw in sys.argv[1:]: @@ -53,7 +55,7 @@ for kw in sys.argv[1:]: os.chmod(test_file, stat.S_IWUSR) with open(test_file, 'wt') as f: - f.write(template % (datetime.datetime.now().year, kw, kw)) + f.write(template % (datetime.datetime.now().year, kw, kw, kw)) # mark file read-only os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) diff --git a/src/test/compile-fail/keyword-false-as-identifier.rs b/src/test/compile-fail/keyword-false-as-identifier.rs index 60caca3da57e..e8af94f16b1b 100644 --- a/src/test/compile-fail/keyword-false-as-identifier.rs +++ b/src/test/compile-fail/keyword-false-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,10 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test -- FIXME #33010 - -// This file was auto-generated using 'src/etc/generate-keyword-tests.py false' - fn main() { - let false = "foo"; //~ error: ident + let false = "foo"; //~ error: mismatched types } diff --git a/src/test/compile-fail/keyword-true-as-identifier.rs b/src/test/compile-fail/keyword-true-as-identifier.rs index 716a0ebf21ce..90414fa912db 100644 --- a/src/test/compile-fail/keyword-true-as-identifier.rs +++ b/src/test/compile-fail/keyword-true-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,10 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-test -- FIXME #33010 - -// This file was auto-generated using 'src/etc/generate-keyword-tests.py true' - fn main() { - let true = "foo"; //~ error: ident + let true = "foo"; //~ error: mismatched types } diff --git a/src/test/parse-fail/keyword-as-as-identifier.rs b/src/test/parse-fail/keyword-as-as-identifier.rs index bc05a7c4f25f..c6070c456e8a 100644 --- a/src/test/parse-fail/keyword-as-as-identifier.rs +++ b/src/test/parse-fail/keyword-as-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py as' fn main() { - let as = "foo"; //~ error: ident + let as = "foo"; //~ error: expected pattern, found keyword `as` } diff --git a/src/test/parse-fail/keyword-box-as-identifier.rs b/src/test/parse-fail/keyword-box-as-identifier.rs new file mode 100644 index 000000000000..b5abe14dbe87 --- /dev/null +++ b/src/test/parse-fail/keyword-box-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +fn main() { + let box = "foo"; //~ error: expected pattern, found `=` +} diff --git a/src/test/parse-fail/keyword-break-as-identifier.rs b/src/test/parse-fail/keyword-break-as-identifier.rs index bd7527f399e5..65c775fa1b6c 100644 --- a/src/test/parse-fail/keyword-break-as-identifier.rs +++ b/src/test/parse-fail/keyword-break-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py break' fn main() { - let break = "foo"; //~ error: ident + let break = "foo"; //~ error: expected pattern, found keyword `break` } diff --git a/src/test/parse-fail/keyword-const-as-identifier.rs b/src/test/parse-fail/keyword-const-as-identifier.rs new file mode 100644 index 000000000000..6ecf14957e32 --- /dev/null +++ b/src/test/parse-fail/keyword-const-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py const' + +fn main() { + let const = "foo"; //~ error: expected pattern, found keyword `const` +} diff --git a/src/test/parse-fail/keyword-continue-as-identifier.rs b/src/test/parse-fail/keyword-continue-as-identifier.rs new file mode 100644 index 000000000000..87377ac83642 --- /dev/null +++ b/src/test/parse-fail/keyword-continue-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py continue' + +fn main() { + let continue = "foo"; //~ error: expected pattern, found keyword `continue` +} diff --git a/src/test/parse-fail/keyword-crate-as-identifier.rs b/src/test/parse-fail/keyword-crate-as-identifier.rs new file mode 100644 index 000000000000..8a914ca7b178 --- /dev/null +++ b/src/test/parse-fail/keyword-crate-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py crate' + +fn main() { + let crate = "foo"; //~ error: expected pattern, found keyword `crate` +} diff --git a/src/test/parse-fail/keyword-else-as-identifier.rs b/src/test/parse-fail/keyword-else-as-identifier.rs index 24bd18a738fb..6878f7fea039 100644 --- a/src/test/parse-fail/keyword-else-as-identifier.rs +++ b/src/test/parse-fail/keyword-else-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py else' fn main() { - let else = "foo"; //~ error: ident + let else = "foo"; //~ error: expected pattern, found keyword `else` } diff --git a/src/test/parse-fail/keyword-enum-as-identifier.rs b/src/test/parse-fail/keyword-enum-as-identifier.rs index e47452704142..042a02d79e00 100644 --- a/src/test/parse-fail/keyword-enum-as-identifier.rs +++ b/src/test/parse-fail/keyword-enum-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py enum' fn main() { - let enum = "foo"; //~ error: ident + let enum = "foo"; //~ error: expected pattern, found keyword `enum` } diff --git a/src/test/parse-fail/keyword-extern-as-identifier.rs b/src/test/parse-fail/keyword-extern-as-identifier.rs index 579cd9f91665..3bbe24ed56c6 100644 --- a/src/test/parse-fail/keyword-extern-as-identifier.rs +++ b/src/test/parse-fail/keyword-extern-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py extern' fn main() { - let extern = "foo"; //~ error: ident + let extern = "foo"; //~ error: expected pattern, found keyword `extern` } diff --git a/src/test/parse-fail/keyword-fn-as-identifier.rs b/src/test/parse-fail/keyword-fn-as-identifier.rs index 0ace9ddf1f07..0d454f67d1c0 100644 --- a/src/test/parse-fail/keyword-fn-as-identifier.rs +++ b/src/test/parse-fail/keyword-fn-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py fn' fn main() { - let fn = "foo"; //~ error: ident + let fn = "foo"; //~ error: expected pattern, found keyword `fn` } diff --git a/src/test/parse-fail/keyword-for-as-identifier.rs b/src/test/parse-fail/keyword-for-as-identifier.rs index 035c87b80bb9..d341669f7272 100644 --- a/src/test/parse-fail/keyword-for-as-identifier.rs +++ b/src/test/parse-fail/keyword-for-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py for' fn main() { - let for = "foo"; //~ error: ident + let for = "foo"; //~ error: expected pattern, found keyword `for` } diff --git a/src/test/parse-fail/keyword-if-as-identifier.rs b/src/test/parse-fail/keyword-if-as-identifier.rs index 1aad0a780f96..417e40425e03 100644 --- a/src/test/parse-fail/keyword-if-as-identifier.rs +++ b/src/test/parse-fail/keyword-if-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py if' fn main() { - let if = "foo"; //~ error: ident + let if = "foo"; //~ error: expected pattern, found keyword `if` } diff --git a/src/test/parse-fail/keyword-impl-as-identifier.rs b/src/test/parse-fail/keyword-impl-as-identifier.rs index 585109505d40..fe97c191f683 100644 --- a/src/test/parse-fail/keyword-impl-as-identifier.rs +++ b/src/test/parse-fail/keyword-impl-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py impl' fn main() { - let impl = "foo"; //~ error: ident + let impl = "foo"; //~ error: expected pattern, found keyword `impl` } diff --git a/src/test/parse-fail/keyword-in-as-identifier.rs b/src/test/parse-fail/keyword-in-as-identifier.rs new file mode 100644 index 000000000000..c0f9396b9810 --- /dev/null +++ b/src/test/parse-fail/keyword-in-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py in' + +fn main() { + let in = "foo"; //~ error: expected pattern, found keyword `in` +} diff --git a/src/test/parse-fail/keyword-let-as-identifier.rs b/src/test/parse-fail/keyword-let-as-identifier.rs index 07bc79016860..5d6dca78d783 100644 --- a/src/test/parse-fail/keyword-let-as-identifier.rs +++ b/src/test/parse-fail/keyword-let-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py let' fn main() { - let let = "foo"; //~ error: ident + let let = "foo"; //~ error: expected pattern, found keyword `let` } diff --git a/src/test/parse-fail/keyword-loop-as-identifier.rs b/src/test/parse-fail/keyword-loop-as-identifier.rs index 7b2b10a2d6dd..7c3d11d67f61 100644 --- a/src/test/parse-fail/keyword-loop-as-identifier.rs +++ b/src/test/parse-fail/keyword-loop-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py loop' fn main() { - let loop = "foo"; //~ error: ident + let loop = "foo"; //~ error: expected pattern, found keyword `loop` } diff --git a/src/test/parse-fail/keyword-match-as-identifier.rs b/src/test/parse-fail/keyword-match-as-identifier.rs index 528873c17943..7c727f44da76 100644 --- a/src/test/parse-fail/keyword-match-as-identifier.rs +++ b/src/test/parse-fail/keyword-match-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py match' fn main() { - let match = "foo"; //~ error: ident + let match = "foo"; //~ error: expected pattern, found keyword `match` } diff --git a/src/test/parse-fail/keyword-mod-as-identifier.rs b/src/test/parse-fail/keyword-mod-as-identifier.rs index b29bcbc76c3c..85b4cc2e02c6 100644 --- a/src/test/parse-fail/keyword-mod-as-identifier.rs +++ b/src/test/parse-fail/keyword-mod-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py mod' fn main() { - let mod = "foo"; //~ error: ident + let mod = "foo"; //~ error: expected pattern, found keyword `mod` } diff --git a/src/test/parse-fail/keyword-move-as-identifier.rs b/src/test/parse-fail/keyword-move-as-identifier.rs new file mode 100644 index 000000000000..b785ac0058cc --- /dev/null +++ b/src/test/parse-fail/keyword-move-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py move' + +fn main() { + let move = "foo"; //~ error: expected pattern, found keyword `move` +} diff --git a/src/test/parse-fail/keyword-mut-as-identifier.rs b/src/test/parse-fail/keyword-mut-as-identifier.rs index b637d07d8b6d..0aeca9b34ab8 100644 --- a/src/test/parse-fail/keyword-mut-as-identifier.rs +++ b/src/test/parse-fail/keyword-mut-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,8 +10,6 @@ // compile-flags: -Z parse-only -// This file was auto-generated using 'src/etc/generate-keyword-tests.py mut' - fn main() { - let mut = "foo"; //~ error: ident + let mut = "foo"; //~ error: expected identifier, found `=` } diff --git a/src/test/parse-fail/keyword-pub-as-identifier.rs b/src/test/parse-fail/keyword-pub-as-identifier.rs index 959bbfbf8826..923372869702 100644 --- a/src/test/parse-fail/keyword-pub-as-identifier.rs +++ b/src/test/parse-fail/keyword-pub-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py pub' fn main() { - let pub = "foo"; //~ error: ident + let pub = "foo"; //~ error: expected pattern, found keyword `pub` } diff --git a/src/test/parse-fail/keyword-ref-as-identifier.rs b/src/test/parse-fail/keyword-ref-as-identifier.rs index 3db6d11c2e89..a689c4eeea41 100644 --- a/src/test/parse-fail/keyword-ref-as-identifier.rs +++ b/src/test/parse-fail/keyword-ref-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,8 +10,6 @@ // compile-flags: -Z parse-only -// This file was auto-generated using 'src/etc/generate-keyword-tests.py ref' - fn main() { - let ref = "foo"; //~ error: ident + let ref = "foo"; //~ error: expected identifier, found `=` } diff --git a/src/test/parse-fail/keyword-return-as-identifier.rs b/src/test/parse-fail/keyword-return-as-identifier.rs index df8aeba6d716..bcf7f1375431 100644 --- a/src/test/parse-fail/keyword-return-as-identifier.rs +++ b/src/test/parse-fail/keyword-return-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py return' fn main() { - let return = "foo"; //~ error: ident + let return = "foo"; //~ error: expected pattern, found keyword `return` } diff --git a/src/test/parse-fail/keyword-self-as-identifier.rs b/src/test/parse-fail/keyword-self-as-identifier.rs index 0e0d07ca6a53..f8b93a1796bf 100644 --- a/src/test/parse-fail/keyword-self-as-identifier.rs +++ b/src/test/parse-fail/keyword-self-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,8 +10,6 @@ // compile-flags: -Z parse-only -// This file was auto-generated using 'src/etc/generate-keyword-tests.py self' - fn main() { - let self = "foo"; //~ error: ident + let Self = "foo"; //~ error: expected identifier, found keyword `Self` } diff --git a/src/test/parse-fail/keyword-static-as-identifier.rs b/src/test/parse-fail/keyword-static-as-identifier.rs index d5b529af4b80..793262266a39 100644 --- a/src/test/parse-fail/keyword-static-as-identifier.rs +++ b/src/test/parse-fail/keyword-static-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py static' fn main() { - let static = "foo"; //~ error: ident + let static = "foo"; //~ error: expected pattern, found keyword `static` } diff --git a/src/test/parse-fail/keyword-struct-as-identifier.rs b/src/test/parse-fail/keyword-struct-as-identifier.rs index 7d2160dfd293..591bd25db65d 100644 --- a/src/test/parse-fail/keyword-struct-as-identifier.rs +++ b/src/test/parse-fail/keyword-struct-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py struct' fn main() { - let struct = "foo"; //~ error: ident + let struct = "foo"; //~ error: expected pattern, found keyword `struct` } diff --git a/src/test/parse-fail/keyword-super-as-identifier.rs b/src/test/parse-fail/keyword-super-as-identifier.rs index 4d8669188686..a48683a4f54d 100644 --- a/src/test/parse-fail/keyword-super-as-identifier.rs +++ b/src/test/parse-fail/keyword-super-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,8 +10,6 @@ // compile-flags: -Z parse-only -// This file was auto-generated using 'src/etc/generate-keyword-tests.py super' - fn main() { - let super = "foo"; //~ error: ident + let super = "foo"; //~ error: expected identifier, found keyword `super` } diff --git a/src/test/parse-fail/keyword-trait-as-identifier.rs b/src/test/parse-fail/keyword-trait-as-identifier.rs index 7a8be0baa27f..bdb5d264b031 100644 --- a/src/test/parse-fail/keyword-trait-as-identifier.rs +++ b/src/test/parse-fail/keyword-trait-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py trait' fn main() { - let trait = "foo"; //~ error: ident + let trait = "foo"; //~ error: expected pattern, found keyword `trait` } diff --git a/src/test/parse-fail/keyword-type-as-identifier.rs b/src/test/parse-fail/keyword-type-as-identifier.rs index c76bea89ab40..2ba99d098dee 100644 --- a/src/test/parse-fail/keyword-type-as-identifier.rs +++ b/src/test/parse-fail/keyword-type-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py type' fn main() { - let type = "foo"; //~ error: ident + let type = "foo"; //~ error: expected pattern, found keyword `type` } diff --git a/src/test/parse-fail/keyword-unsafe-as-identifier.rs b/src/test/parse-fail/keyword-unsafe-as-identifier.rs index d3c48c6ded0d..a72723e566dd 100644 --- a/src/test/parse-fail/keyword-unsafe-as-identifier.rs +++ b/src/test/parse-fail/keyword-unsafe-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe' fn main() { - let unsafe = "foo"; //~ error: ident + let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe` } diff --git a/src/test/parse-fail/keyword-use-as-identifier.rs b/src/test/parse-fail/keyword-use-as-identifier.rs index d3815c650a36..de74907ff209 100644 --- a/src/test/parse-fail/keyword-use-as-identifier.rs +++ b/src/test/parse-fail/keyword-use-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py use' fn main() { - let use = "foo"; //~ error: ident + let use = "foo"; //~ error: expected pattern, found keyword `use` } diff --git a/src/test/parse-fail/keyword-where-as-identifier.rs b/src/test/parse-fail/keyword-where-as-identifier.rs new file mode 100644 index 000000000000..4b7c8920b13c --- /dev/null +++ b/src/test/parse-fail/keyword-where-as-identifier.rs @@ -0,0 +1,17 @@ +// Copyright 2016 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. + +// compile-flags: -Z parse-only + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py where' + +fn main() { + let where = "foo"; //~ error: expected pattern, found keyword `where` +} diff --git a/src/test/parse-fail/keyword-while-as-identifier.rs b/src/test/parse-fail/keyword-while-as-identifier.rs index 331fdc07cc15..01793caa38a8 100644 --- a/src/test/parse-fail/keyword-while-as-identifier.rs +++ b/src/test/parse-fail/keyword-while-as-identifier.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py while' fn main() { - let while = "foo"; //~ error: ident + let while = "foo"; //~ error: expected pattern, found keyword `while` }