]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/open_options.rs
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / open_options.rs
index 08024e37d4af8b98c456db6884f958bb44fa2c91..9063fafbcd040a5c26f9cf043ffd30419f287071 100644 (file)
@@ -1,16 +1,14 @@
-#![feature(plugin)]
-#![plugin(clippy)]
 use std::fs::OpenOptions;
 
 #[allow(unused_must_use)]
-#[deny(nonsensical_open_options)]
+#[warn(clippy::nonsensical_open_options)]
 fn main() {
-    OpenOptions::new().read(true).truncate(true).open("foo.txt"); //~ERROR file opened with "truncate" and "read"
-    OpenOptions::new().append(true).truncate(true).open("foo.txt"); //~ERROR file opened with "append" and "truncate"
+    OpenOptions::new().read(true).truncate(true).open("foo.txt");
+    OpenOptions::new().append(true).truncate(true).open("foo.txt");
 
-    OpenOptions::new().read(true).read(false).open("foo.txt"); //~ERROR the method "read" is called more than once
-    OpenOptions::new().create(true).create(false).open("foo.txt"); //~ERROR the method "create" is called more than once
-    OpenOptions::new().write(true).write(false).open("foo.txt"); //~ERROR the method "write" is called more than once
-    OpenOptions::new().append(true).append(false).open("foo.txt"); //~ERROR the method "append" is called more than once
-    OpenOptions::new().truncate(true).truncate(false).open("foo.txt"); //~ERROR the method "truncate" is called more than once
+    OpenOptions::new().read(true).read(false).open("foo.txt");
+    OpenOptions::new().create(true).create(false).open("foo.txt");
+    OpenOptions::new().write(true).write(false).open("foo.txt");
+    OpenOptions::new().append(true).append(false).open("foo.txt");
+    OpenOptions::new().truncate(true).truncate(false).open("foo.txt");
 }