]>
git.proxmox.com Git - rustc.git/blob - vendor/syn/benches/file.rs
08ecd90960248a3c65a47bfde928260bccadb466
1 // $ cargo bench --features full --bench file
3 #![feature(rustc_private, test)]
7 #[path = "../tests/repo/mod.rs"]
10 use proc_macro2
::TokenStream
;
12 use std
::str::FromStr
;
15 const FILE
: &str = "tests/rust/src/libcore/str/mod.rs";
18 fn parse_file(b
: &mut Bencher
) {
20 let content
= fs
::read_to_string(FILE
).unwrap();
21 let tokens
= TokenStream
::from_str(&content
).unwrap();
22 b
.iter(|| syn
::parse2
::<syn
::File
>(tokens
.clone()));