mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Associate multiple with a crate too.
This commit is contained in:
+2
-2
@@ -124,7 +124,7 @@ pub(crate) fn visit_crate(
|
||||
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 @@ pub(crate) fn visit_crate(
|
||||
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,
|
||||
|
||||
+2
-1
@@ -915,7 +915,8 @@ fn format_mod(
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user