summary refs log tree commit diff
path: root/src/librustc_expand/module.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-01 15:42:51 +0000
committerbors <bors@rust-lang.org>2020-06-01 15:42:51 +0000
commit49cae55760da0a43428eba73abcb659bb70cf2e4 (patch)
tree4aaa1c51870e6e83fda6d1c86d6bac54457ab89b /src/librustc_expand/module.rs
parent02c25b359e667d2eba0da4d9e75408d675b7a4d5 (diff)
parent68a0acd6341440bd6ae6e0b612f558b10e6d522f (diff)
downloadrust-1.44.0.tar.gz
rust-1.44.0.zip
Auto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.44.0
[stable] 1.44 release

This includes a release notes update as usual and a backport of #72767.

r? @ghost
Diffstat (limited to 'src/librustc_expand/module.rs')
-rw-r--r--src/librustc_expand/module.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_expand/module.rs b/src/librustc_expand/module.rs
index aad92a09743..acf986445e5 100644
--- a/src/librustc_expand/module.rs
+++ b/src/librustc_expand/module.rs
@@ -71,7 +71,7 @@ crate fn parse_external_mod(
     // Extract the directory path for submodules of `module`.
     let path = sess.source_map().span_to_unmapped_path(module.inner);
     let mut path = match path {
-        FileName::Real(path) => path,
+        FileName::Real(name) => name.into_local_path(),
         other => PathBuf::from(other.to_string()),
     };
     path.pop();
@@ -189,7 +189,8 @@ fn error_cannot_declare_mod_here<'a, T>(
     let mut err =
         sess.span_diagnostic.struct_span_err(span, "cannot declare a new module at this location");
     if !span.is_dummy() {
-        if let FileName::Real(src_path) = sess.source_map().span_to_filename(span) {
+        if let FileName::Real(src_name) = sess.source_map().span_to_filename(span) {
+            let src_path = src_name.into_local_path();
             if let Some(stem) = src_path.file_stem() {
                 let mut dest_path = src_path.clone();
                 dest_path.set_file_name(stem);