From 3db9070e9c2a88cf88766d277ffc03ab65e72dec Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Tue, 7 Oct 2014 22:19:02 -0400 Subject: [PATCH] Add tests for new reserved keywords `abstract`,`final`,`override` --- src/test/compile-fail/keyword-abstract.rs | 13 +++++++++++++ src/test/compile-fail/keyword-final.rs | 13 +++++++++++++ src/test/compile-fail/keyword-override.rs | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 src/test/compile-fail/keyword-abstract.rs create mode 100644 src/test/compile-fail/keyword-final.rs create mode 100644 src/test/compile-fail/keyword-override.rs diff --git a/src/test/compile-fail/keyword-abstract.rs b/src/test/compile-fail/keyword-abstract.rs new file mode 100644 index 000000000000..1f1360eac007 --- /dev/null +++ b/src/test/compile-fail/keyword-abstract.rs @@ -0,0 +1,13 @@ +// Copyright 2014 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. + +fn main() { + let abstract = (); //~ ERROR `abstract` is a reserved keyword +} diff --git a/src/test/compile-fail/keyword-final.rs b/src/test/compile-fail/keyword-final.rs new file mode 100644 index 000000000000..305ef0ef075f --- /dev/null +++ b/src/test/compile-fail/keyword-final.rs @@ -0,0 +1,13 @@ +// Copyright 2014 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. + +fn main() { + let final = (); //~ ERROR `final` is a reserved keyword +} diff --git a/src/test/compile-fail/keyword-override.rs b/src/test/compile-fail/keyword-override.rs new file mode 100644 index 000000000000..f70e6b926105 --- /dev/null +++ b/src/test/compile-fail/keyword-override.rs @@ -0,0 +1,13 @@ +// Copyright 2014 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. + +fn main() { + let override = (); //~ ERROR `override` is a reserved keyword +}