refactor: prepare to associate multiple spans with a module.

This commit is contained in:
Felix S. Klock II 2022-01-20 11:06:45 -05:00
parent 4566094913
commit e9035f7bef
9 changed files with 30 additions and 14 deletions

View file

@ -1,6 +1,6 @@
use crate::base::ModuleData;
use rustc_ast::ptr::P;
use rustc_ast::{token, Attribute, Inline, Item};
use rustc_ast::{token, Attribute, Inline, Item, ModSpans};
use rustc_errors::{struct_span_err, DiagnosticBuilder, ErrorGuaranteed};
use rustc_parse::new_parser_from_file;
use rustc_parse::validate_attr;
@ -69,7 +69,7 @@ crate fn parse_external_mod(
(items, inner_span, mp.file_path)
};
// (1) ...instead, we return a dummy module.
let (items, inner_span, file_path) =
let (items, ModSpans { inner_span }, file_path) =
result.map_err(|err| err.report(sess, span)).unwrap_or_default();
// Extract the directory path for submodules of the module.