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