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 de1ac375f0
commit 4edb757826
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ impl<'a> Parser<'a> {
let result = catch_unwind(AssertUnwindSafe(|| {
let mut parser = new_parser_from_file(sess.inner(), path, Some(span));
match parser.parse_mod(&TokenKind::Eof) {
Ok(result) => Some(result),
Ok((a, i, ast::ModSpans { inner_span })) => Some((a, i, inner_span)),
Err(mut e) => {
e.emit();
if sess.can_reset_errors() {

View File

@ -915,7 +915,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
let ident_str = rewrite_ident(&self.get_context(), ident).to_owned();
self.push_str(&ident_str);
if let ast::ModKind::Loaded(ref items, ast::Inline::Yes, inner_span) = mod_kind {
if let ast::ModKind::Loaded(ref items, ast::Inline::Yes, ast::ModSpans{ inner_span }) = mod_kind {
match self.config.brace_style() {
BraceStyle::AlwaysNextLine => {
let indent_str = self.block_indent.to_string_with_newline(self.config);