diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py new file mode 100755 index 000000000000..5b827552e83a --- /dev/null +++ b/src/etc/generate-keyword-tests.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# xfail-license +# Copyright 2013 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. +""" +This script takes a list of keywords and generates a testcase, that checks +if using the keyword as identifier fails, for every keyword. The generate +test files are set read-only. +Test for https://github.com/mozilla/rust/issues/2275 + +sample usage: src/etc/generate-keyword-tests.py as break +""" + +import sys +import os +import datetime +import stat + + +template = """// Copyright %d 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s' + +fn main() { + let %s = "foo"; //~ error: ident +} +""" + +test_dir = os.path.abspath( + os.path.join(os.path.dirname(__file__), '../test/compile-fail') +) + +for kw in sys.argv[1:]: + test_file = os.path.join(test_dir, 'keyword-%s-as-identifier.rs' % kw) + + # set write permission if file exists, so it can be changed + if os.path.exists(test_file): + os.chmod(test_file, stat.S_IWUSR) + + with open(test_file, 'wt') as f: + f.write(template % (datetime.datetime.now().year, 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-as-as-identifier.rs b/src/test/compile-fail/keyword-as-as-identifier.rs new file mode 100644 index 000000000000..f307b12f66e7 --- /dev/null +++ b/src/test/compile-fail/keyword-as-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py as' + +fn main() { + let as = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-break-as-identifier.rs b/src/test/compile-fail/keyword-break-as-identifier.rs new file mode 100644 index 000000000000..1e2725eb2feb --- /dev/null +++ b/src/test/compile-fail/keyword-break-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py break' + +fn main() { + let break = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-do-as-identifier.rs b/src/test/compile-fail/keyword-do-as-identifier.rs new file mode 100644 index 000000000000..b2a0c8a02a90 --- /dev/null +++ b/src/test/compile-fail/keyword-do-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py do' + +fn main() { + let do = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-else-as-identifier.rs b/src/test/compile-fail/keyword-else-as-identifier.rs new file mode 100644 index 000000000000..101fd938dcb2 --- /dev/null +++ b/src/test/compile-fail/keyword-else-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py else' + +fn main() { + let else = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-enum-as-identifier.rs b/src/test/compile-fail/keyword-enum-as-identifier.rs new file mode 100644 index 000000000000..ed504cc7b7fd --- /dev/null +++ b/src/test/compile-fail/keyword-enum-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py enum' + +fn main() { + let enum = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-extern-as-identifier.rs b/src/test/compile-fail/keyword-extern-as-identifier.rs new file mode 100644 index 000000000000..3260506b3e19 --- /dev/null +++ b/src/test/compile-fail/keyword-extern-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py extern' + +fn main() { + let extern = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-false-as-identifier.rs b/src/test/compile-fail/keyword-false-as-identifier.rs new file mode 100644 index 000000000000..d875898f8bcc --- /dev/null +++ b/src/test/compile-fail/keyword-false-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py false' + +fn main() { + let false = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-fn-as-identifier.rs b/src/test/compile-fail/keyword-fn-as-identifier.rs new file mode 100644 index 000000000000..8c98da229c8b --- /dev/null +++ b/src/test/compile-fail/keyword-fn-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py fn' + +fn main() { + let fn = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-for-as-identifier.rs b/src/test/compile-fail/keyword-for-as-identifier.rs new file mode 100644 index 000000000000..196a33906767 --- /dev/null +++ b/src/test/compile-fail/keyword-for-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py for' + +fn main() { + let for = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-if-as-identifier.rs b/src/test/compile-fail/keyword-if-as-identifier.rs new file mode 100644 index 000000000000..05f82ec790cc --- /dev/null +++ b/src/test/compile-fail/keyword-if-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py if' + +fn main() { + let if = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-impl-as-identifier.rs b/src/test/compile-fail/keyword-impl-as-identifier.rs new file mode 100644 index 000000000000..1dd218003451 --- /dev/null +++ b/src/test/compile-fail/keyword-impl-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py impl' + +fn main() { + let impl = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-let-as-identifier.rs b/src/test/compile-fail/keyword-let-as-identifier.rs new file mode 100644 index 000000000000..0069a26a40b7 --- /dev/null +++ b/src/test/compile-fail/keyword-let-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py let' + +fn main() { + let let = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-loop-as-identifier.rs b/src/test/compile-fail/keyword-loop-as-identifier.rs new file mode 100644 index 000000000000..6e469e8c0b43 --- /dev/null +++ b/src/test/compile-fail/keyword-loop-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py loop' + +fn main() { + let loop = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-match-as-identifier.rs b/src/test/compile-fail/keyword-match-as-identifier.rs new file mode 100644 index 000000000000..9155ebc71fa4 --- /dev/null +++ b/src/test/compile-fail/keyword-match-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py match' + +fn main() { + let match = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-mod-as-identifier.rs b/src/test/compile-fail/keyword-mod-as-identifier.rs new file mode 100644 index 000000000000..02f57e937dd7 --- /dev/null +++ b/src/test/compile-fail/keyword-mod-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py mod' + +fn main() { + let mod = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-mut-as-identifier.rs b/src/test/compile-fail/keyword-mut-as-identifier.rs new file mode 100644 index 000000000000..b5d36e577502 --- /dev/null +++ b/src/test/compile-fail/keyword-mut-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py mut' + +fn main() { + let mut = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-priv-as-identifier.rs b/src/test/compile-fail/keyword-priv-as-identifier.rs new file mode 100644 index 000000000000..7cbaeb9d5184 --- /dev/null +++ b/src/test/compile-fail/keyword-priv-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py priv' + +fn main() { + let priv = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-pub-as-identifier.rs b/src/test/compile-fail/keyword-pub-as-identifier.rs new file mode 100644 index 000000000000..aa679741c1c0 --- /dev/null +++ b/src/test/compile-fail/keyword-pub-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py pub' + +fn main() { + let pub = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-ref-as-identifier.rs b/src/test/compile-fail/keyword-ref-as-identifier.rs new file mode 100644 index 000000000000..72af521f6f1a --- /dev/null +++ b/src/test/compile-fail/keyword-ref-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py ref' + +fn main() { + let ref = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-return-as-identifier.rs b/src/test/compile-fail/keyword-return-as-identifier.rs new file mode 100644 index 000000000000..c56764459177 --- /dev/null +++ b/src/test/compile-fail/keyword-return-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py return' + +fn main() { + let return = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-self-as-identifier.rs b/src/test/compile-fail/keyword-self-as-identifier.rs new file mode 100644 index 000000000000..8bb52142287f --- /dev/null +++ b/src/test/compile-fail/keyword-self-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py self' + +fn main() { + let self = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-static-as-identifier.rs b/src/test/compile-fail/keyword-static-as-identifier.rs new file mode 100644 index 000000000000..7268c4f387ec --- /dev/null +++ b/src/test/compile-fail/keyword-static-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py static' + +fn main() { + let static = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-struct-as-identifier.rs b/src/test/compile-fail/keyword-struct-as-identifier.rs new file mode 100644 index 000000000000..bd42eac0ecbe --- /dev/null +++ b/src/test/compile-fail/keyword-struct-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py struct' + +fn main() { + let struct = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-super-as-identifier.rs b/src/test/compile-fail/keyword-super-as-identifier.rs new file mode 100644 index 000000000000..0378c326a89a --- /dev/null +++ b/src/test/compile-fail/keyword-super-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py super' + +fn main() { + let super = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-trait-as-identifier.rs b/src/test/compile-fail/keyword-trait-as-identifier.rs new file mode 100644 index 000000000000..95c0d174c332 --- /dev/null +++ b/src/test/compile-fail/keyword-trait-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py trait' + +fn main() { + let trait = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-true-as-identifier.rs b/src/test/compile-fail/keyword-true-as-identifier.rs new file mode 100644 index 000000000000..048b640c0b31 --- /dev/null +++ b/src/test/compile-fail/keyword-true-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py true' + +fn main() { + let true = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-type-as-identifier.rs b/src/test/compile-fail/keyword-type-as-identifier.rs new file mode 100644 index 000000000000..0aaa2a63c7c4 --- /dev/null +++ b/src/test/compile-fail/keyword-type-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py type' + +fn main() { + let type = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-unsafe-as-identifier.rs b/src/test/compile-fail/keyword-unsafe-as-identifier.rs new file mode 100644 index 000000000000..1b631eb877d9 --- /dev/null +++ b/src/test/compile-fail/keyword-unsafe-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe' + +fn main() { + let unsafe = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-use-as-identifier.rs b/src/test/compile-fail/keyword-use-as-identifier.rs new file mode 100644 index 000000000000..e82afd544424 --- /dev/null +++ b/src/test/compile-fail/keyword-use-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py use' + +fn main() { + let use = "foo"; //~ error: ident +} diff --git a/src/test/compile-fail/keyword-while-as-identifier.rs b/src/test/compile-fail/keyword-while-as-identifier.rs new file mode 100644 index 000000000000..95cea65c610d --- /dev/null +++ b/src/test/compile-fail/keyword-while-as-identifier.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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. + +// This file was auto-generated using 'src/etc/generate-keyword-tests.py while' + +fn main() { + let while = "foo"; //~ error: ident +}