Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptions; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0603]: struct `OpenOptions` is private
- --> src/main.rs:6:78
- |
- 6 | use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptions; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- | ^^^^^^^^^^^
- warning: unused import: `std::os::unix::fs::OpenOptions`
- --> src/main.rs:6:59
- |
- 6 | use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptions; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: #[warn(unused_imports)] on by default
- error[E0599]: no method named `mode` found for type `&mut std::fs::OpenOptions` in the current scope
- --> src/main.rs:6:158
- |
- 6 | use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptions; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- | ^^^^
- |
- = help: items from traits can only be used if the trait is in scope
- help: the following trait is implemented but not in scope, perhaps add a `use` for it:
- |
- 4 | use std::os::unix::fs::OpenOptionsExt;
- |
- warning: unused import: `std::io::Write`
- --> src/main.rs:6:39
- |
- 6 | use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptions; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- | ^^^^^^^^^^^^^^
- error: aborting due to 2 previous errors
- Some errors occurred: E0599, E0603.
- For more information about an error, try `rustc --explain E0599`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement