This is just example code but I got the same result nethertheless.
use std::io::Write;
fn main() {
let mut file = std::fs::File::open("thing.txt").unwrap();
file.write_all(b"PLACEHOLDER").expect("Something went wrong opening the file");
}
Result:
thread 'main' panicked at 'Something went wrong opening the file: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }'