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::OpenOptionsExt; 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[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
- --> src/main.rs:6:195
- |
- 6 | use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptionsExt; let f = OpenOptions::new().write(true).truncate(true).create(true).mode(0x755).open("foo").unwrap(); f.write(&[0]).unwrap();
- | - help: consider changing this to be mutable: `mut f` ^ cannot borrow as mutable
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0596`.
- 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