about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-25 10:47:01 -0700
committerbors <bors@rust-lang.org>2013-06-25 10:47:01 -0700
commit032dcc57e8876e960837c3a050be2c7570e7eafd (patch)
tree0e63580109393a724f823d21c9668eb25466d796 /src/test
parentd161e630d8378e9705987e0b746d8dbf0da48842 (diff)
parent92424f0670723e417a96a96310a6ad871994c6b7 (diff)
auto merge of #7371 : alexcrichton/rust/trying, r=cmr
This is an attempt at a smaller request than #7113, it's just the first two commits
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/lint-change-warnings.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/compile-fail/lint-change-warnings.rs b/src/test/compile-fail/lint-change-warnings.rs
new file mode 100644
index 00000000000..977abc4dc0d
--- /dev/null
+++ b/src/test/compile-fail/lint-change-warnings.rs
@@ -0,0 +1,30 @@
+// 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 <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.
+
+#[deny(warnings)];
+
+fn main() {
+    while true {} //~ ERROR: infinite
+}
+
+#[allow(warnings)]
+fn foo() {
+    while true {}
+}
+
+#[warn(warnings)]
+fn bar() {
+    while true {} //~ WARNING: infinite
+}
+
+#[forbid(warnings)]
+fn baz() {
+    while true {} //~ ERROR: warnings
+}