diff options
| author | bors <bors@rust-lang.org> | 2015-10-23 16:53:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-23 16:53:40 +0000 |
| commit | 7ee4e9e7ec59c7db2d76fcb53719e5b31b43e499 (patch) | |
| tree | 4072b664d200bd0652a9257d0e72a31e1f48f7a4 /src/test | |
| parent | 9a855668fcc918071ecd1573abdeaccc6a99cbbb (diff) | |
| parent | 044a8fe6f6834afb3b159da7439c2740295157d3 (diff) | |
| download | rust-7ee4e9e7ec59c7db2d76fcb53719e5b31b43e499.tar.gz rust-7ee4e9e7ec59c7db2d76fcb53719e5b31b43e499.zip | |
Auto merge of #29243 - skeleten:issue-29184, r=alexcrichton
Fixes #29184 This adds an error message for the use of the reserved `typeof` keyword, instead of reporting an ICE. Also adds a `compile-fail` test. I chose to add a `span_err` instead of removing to parser code, as to preserve the reservation of `typeof`.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/issue-29184.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-29184.rs b/src/test/compile-fail/issue-29184.rs new file mode 100644 index 00000000000..98fe12c1b9d --- /dev/null +++ b/src/test/compile-fail/issue-29184.rs @@ -0,0 +1,13 @@ +// 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. + +fn main() { + let x: typeof(92) = 92; //~ ERROR `typeof` is a reserved keyword +} |
