auto merge of #17781 : P1start/rust/bitflags-lints, r=alexcrichton
Closes #17773.
This commit is contained in:
commit
0e2f0acf22
13 changed files with 172 additions and 119 deletions
|
|
@ -51,7 +51,7 @@ fn main() {
|
|||
let child_path = cwd.join(child_filename.clone());
|
||||
|
||||
// make a separate directory for the child
|
||||
drop(fs::mkdir(&cwd, io::UserRWX).is_ok());
|
||||
drop(fs::mkdir(&cwd, io::USER_RWX).is_ok());
|
||||
assert!(fs::copy(&my_path, &child_path).is_ok());
|
||||
|
||||
// run child
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fn rename_directory() {
|
|||
let tmpdir = TempDir::new("rename_directory").ok().expect("rename_directory failed");
|
||||
let tmpdir = tmpdir.path();
|
||||
let old_path = tmpdir.join_many(["foo", "bar", "baz"]);
|
||||
fs::mkdir_recursive(&old_path, io::UserRWX);
|
||||
fs::mkdir_recursive(&old_path, io::USER_RWX);
|
||||
let test_file = &old_path.join("temp.txt");
|
||||
|
||||
/* Write the temp input file */
|
||||
|
|
@ -47,7 +47,7 @@ fn rename_directory() {
|
|||
assert_eq!(libc::fclose(ostream), (0u as libc::c_int));
|
||||
|
||||
let new_path = tmpdir.join_many(["quux", "blat"]);
|
||||
fs::mkdir_recursive(&new_path, io::UserRWX);
|
||||
fs::mkdir_recursive(&new_path, io::USER_RWX);
|
||||
fs::rename(&old_path, &new_path.join("newdir"));
|
||||
assert!(new_path.join("newdir").is_dir());
|
||||
assert!(new_path.join_many(["newdir", "temp.txt"]).exists());
|
||||
|
|
|
|||
|
|
@ -128,17 +128,17 @@ fn recursive_mkdir_rel() {
|
|||
let cwd = os::getcwd();
|
||||
println!("recursive_mkdir_rel: Making: {} in cwd {} [{:?}]", path.display(),
|
||||
cwd.display(), path.exists());
|
||||
fs::mkdir_recursive(&path, io::UserRWX);
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
fs::mkdir_recursive(&path, io::UserRWX);
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
}
|
||||
|
||||
fn recursive_mkdir_dot() {
|
||||
let dot = Path::new(".");
|
||||
fs::mkdir_recursive(&dot, io::UserRWX);
|
||||
fs::mkdir_recursive(&dot, io::USER_RWX);
|
||||
let dotdot = Path::new("..");
|
||||
fs::mkdir_recursive(&dotdot, io::UserRWX);
|
||||
fs::mkdir_recursive(&dotdot, io::USER_RWX);
|
||||
}
|
||||
|
||||
fn recursive_mkdir_rel_2() {
|
||||
|
|
@ -146,20 +146,20 @@ fn recursive_mkdir_rel_2() {
|
|||
let cwd = os::getcwd();
|
||||
println!("recursive_mkdir_rel_2: Making: {} in cwd {} [{:?}]", path.display(),
|
||||
cwd.display(), path.exists());
|
||||
fs::mkdir_recursive(&path, io::UserRWX);
|
||||
fs::mkdir_recursive(&path, io::USER_RWX);
|
||||
assert!(path.is_dir());
|
||||
assert!(path.dir_path().is_dir());
|
||||
let path2 = Path::new("quux/blat");
|
||||
println!("recursive_mkdir_rel_2: Making: {} in cwd {}", path2.display(),
|
||||
cwd.display());
|
||||
fs::mkdir_recursive(&path2, io::UserRWX);
|
||||
fs::mkdir_recursive(&path2, io::USER_RWX);
|
||||
assert!(path2.is_dir());
|
||||
assert!(path2.dir_path().is_dir());
|
||||
}
|
||||
|
||||
// Ideally this would be in core, but needs TempFile
|
||||
pub fn test_rmdir_recursive_ok() {
|
||||
let rwx = io::UserRWX;
|
||||
let rwx = io::USER_RWX;
|
||||
|
||||
let tmpdir = TempDir::new("test").ok().expect("test_rmdir_recursive_ok: \
|
||||
couldn't create temp dir");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue