]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/token-error-correct-3.rs
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[rust.git] / src / test / ui / resolve / token-error-correct-3.rs
1 // ignore-cloudabi no std::fs support
2
3 // Test that we do some basic error correction in the tokeniser (and don't spew
4 // too many bogus errors).
5
6 pub mod raw {
7     use std::{io, fs};
8     use std::path::Path;
9
10     pub fn ensure_dir_exists<P: AsRef<Path>, F: FnOnce(&Path)>(path: P,
11                                                                callback: F)
12                                                                -> io::Result<bool> {
13         if !is_directory(path.as_ref()) {
14             //~^ ERROR cannot find function `is_directory`
15             callback(path.as_ref();
16             //~^ ERROR expected one of
17             fs::create_dir_all(path.as_ref()).map(|()| true)
18         } else {
19             //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
20             Ok(false);
21         }
22
23         panic!();
24     }
25 }
26
27 fn main() {}