Fix keyword parsing tests
This commit is contained in:
parent
9108fb7bae
commit
4bd44be369
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
15
src/test/parse-fail/keyword-box-as-identifier.rs
Normal file
15
src/test/parse-fail/keyword-box-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// compile-flags: -Z parse-only
|
||||
|
||||
fn main() {
|
||||
let box = "foo"; //~ error: expected pattern, found `=`
|
||||
}
|
@ -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`
|
||||
}
|
||||
|
17
src/test/parse-fail/keyword-const-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-const-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
17
src/test/parse-fail/keyword-continue-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-continue-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
17
src/test/parse-fail/keyword-crate-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-crate-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
17
src/test/parse-fail/keyword-in-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-in-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
17
src/test/parse-fail/keyword-move-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-move-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
@ -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 `=`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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 `=`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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`
|
||||
}
|
||||
|
17
src/test/parse-fail/keyword-where-as-identifier.rs
Normal file
17
src/test/parse-fail/keyword-where-as-identifier.rs
Normal file
@ -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 <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.
|
||||
|
||||
// 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`
|
||||
}
|
@ -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`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user