about summary refs log tree commit diff
path: root/src/libsyntax/ext/source_util.rs
diff options
context:
space:
mode:
authorMatthew Russo <matthew@edapp.com>2018-12-04 15:18:03 -0500
committerMatthew Russo <matthew@edapp.com>2018-12-04 19:52:42 -0500
commitf0f8aa9e05726bfbc065fa2504daf3232f29bc03 (patch)
tree5027e1682248fb6e535546046f43dff45d6e2b50 /src/libsyntax/ext/source_util.rs
parent88130f1796e98837dc6f58aea9b9a0f49b85f426 (diff)
downloadrust-f0f8aa9e05726bfbc065fa2504daf3232f29bc03.tar.gz
rust-f0f8aa9e05726bfbc065fa2504daf3232f29bc03.zip
adds DocTest filename variant, refactors doctest_offset out of source_map, fixes remaining test failures
Diffstat (limited to 'src/libsyntax/ext/source_util.rs')
-rw-r--r--src/libsyntax/ext/source_util.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 654be85862f..75e25083d03 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -204,6 +204,7 @@ fn res_rel_file(cx: &mut ExtCtxt, sp: syntax_pos::Span, arg: String) -> PathBuf
         let callsite = sp.source_callsite();
         let mut path = match cx.source_map().span_to_unmapped_path(callsite) {
             FileName::Real(path) => path,
+            FileName::DocTest(path, _) => path,
             other => panic!("cannot resolve relative path in non-file source `{}`", other),
         };
         path.pop();