1 // ignore-cloudabi no std::fs support
3 // Test that we do some basic error correction in the tokeniser (and don't spew
4 // too many bogus errors).
10 pub fn ensure_dir_exists<P: AsRef<Path>, F: FnOnce(&Path)>(path: P,
13 if !is_directory(path.as_ref()) { //~ ERROR: cannot find function `is_directory`
14 callback(path.as_ref(); //~ ERROR expected one of
15 fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
16 //~^ expected (), found enum `std::result::Result`
17 //~| expected type `()`
18 //~| found type `std::result::Result<bool, std::io::Error>`
20 } else { //~ ERROR: incorrect close delimiter: `}`
21 //~^ ERROR: expected one of