Associate multiple with a crate too.
This commit is contained in:
parent
4edb757826
commit
74876ef4e9
@ -124,7 +124,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
|
||||
mut self,
|
||||
krate: &'ast ast::Crate,
|
||||
) -> Result<FileModMap<'ast>, ModuleResolutionError> {
|
||||
let root_filename = self.parse_sess.span_to_filename(krate.span);
|
||||
let root_filename = self.parse_sess.span_to_filename(krate.spans.inner_span);
|
||||
self.directory.path = match root_filename {
|
||||
FileName::Real(ref p) => p.parent().unwrap_or(Path::new("")).to_path_buf(),
|
||||
_ => PathBuf::new(),
|
||||
@ -135,7 +135,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
|
||||
self.visit_mod_from_ast(&krate.items)?;
|
||||
}
|
||||
|
||||
let snippet_provider = self.parse_sess.snippet_provider(krate.span);
|
||||
let snippet_provider = self.parse_sess.snippet_provider(krate.spans.inner_span);
|
||||
|
||||
self.file_map.insert(
|
||||
root_filename,
|
||||
|
@ -915,7 +915,8 @@ 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, ast::ModSpans{ inner_span }) = mod_kind {
|
||||
if let ast::ModKind::Loaded(ref items, ast::Inline::Yes, ref spans) = mod_kind {
|
||||
let ast::ModSpans { inner_span } = *spans;
|
||||
match self.config.brace_style() {
|
||||
BraceStyle::AlwaysNextLine => {
|
||||
let indent_str = self.block_indent.to_string_with_newline(self.config);
|
||||
|
Loading…
x
Reference in New Issue
Block a user