]> git.proxmox.com Git - rustc.git/blob - src/test/ui-fulldeps/mod_dir_path_canonicalized.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui-fulldeps / mod_dir_path_canonicalized.rs
1 // run-pass
2 // Testing that a librustc_ast can parse modules with canonicalized base path
3 // ignore-cross-compile
4 // ignore-remote
5
6 #![feature(rustc_private)]
7
8 extern crate rustc_ast;
9 extern crate rustc_parse;
10 extern crate rustc_session;
11 extern crate rustc_span;
12
13 use rustc_parse::new_parser_from_file;
14 use rustc_session::parse::ParseSess;
15 use rustc_span::source_map::FilePathMapping;
16 use std::path::Path;
17
18 #[path = "mod_dir_simple/test.rs"]
19 mod gravy;
20
21 pub fn main() {
22 rustc_span::create_default_session_globals_then(|| parse());
23
24 assert_eq!(gravy::foo(), 10);
25 }
26
27 fn parse() {
28 let parse_session = ParseSess::new(FilePathMapping::empty());
29
30 let path = Path::new(file!());
31 let path = path.canonicalize().unwrap();
32 let mut parser = new_parser_from_file(&parse_session, &path, None);
33 let _ = parser.parse_crate_mod();
34 }