about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-25 23:20:51 +0200
committerGitHub <noreply@github.com>2019-07-25 23:20:51 +0200
commit845e146d04bd3591de04ec4bab25f29927d4723c (patch)
treebd5200a7218740b2064bb4872d3bf814be2f7a05 /src/test/ui
parent3b19dc96fc0b67af2451d4c9bd311253818719c7 (diff)
parent218ab4cd7fdf145a0870c582a23ad5fd85cd80e5 (diff)
downloadrust-845e146d04bd3591de04ec4bab25f29927d4723c.tar.gz
rust-845e146d04bd3591de04ec4bab25f29927d4723c.zip
Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petrochenkov
rustdoc: make #[doc(include)] relative to the containing file

This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros.

Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380
Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239

cc #44732

This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/extern/external-doc-error.rs1
-rw-r--r--src/test/ui/extern/external-doc-error.stderr12
2 files changed, 5 insertions, 8 deletions
diff --git a/src/test/ui/extern/external-doc-error.rs b/src/test/ui/extern/external-doc-error.rs
index e17dda65568..4e89f7464da 100644
--- a/src/test/ui/extern/external-doc-error.rs
+++ b/src/test/ui/extern/external-doc-error.rs
@@ -4,7 +4,6 @@
 
 #[doc(include = "not-a-file.md")]
 pub struct SomeStruct; //~^ ERROR couldn't read
-                       //~| HELP external doc paths are relative to the crate root
 
 #[doc(include = "auxiliary/invalid-utf8.txt")]
 pub struct InvalidUtf8; //~^ ERROR wasn't a utf-8 file
diff --git a/src/test/ui/extern/external-doc-error.stderr b/src/test/ui/extern/external-doc-error.stderr
index a3be3277de5..b180cd66c52 100644
--- a/src/test/ui/extern/external-doc-error.stderr
+++ b/src/test/ui/extern/external-doc-error.stderr
@@ -3,35 +3,33 @@ error: couldn't read $DIR/not-a-file.md: $FILE_NOT_FOUND_MSG (os error 2)
    |
 LL | #[doc(include = "not-a-file.md")]
    |                 ^^^^^^^^^^^^^^^ couldn't read file
-   |
-   = help: external doc paths are relative to the crate root
 
 error: $DIR/auxiliary/invalid-utf8.txt wasn't a utf-8 file
-  --> $DIR/external-doc-error.rs:9:17
+  --> $DIR/external-doc-error.rs:8:17
    |
 LL | #[doc(include = "auxiliary/invalid-utf8.txt")]
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ contains invalid utf-8
 
 error: expected path to external documentation
-  --> $DIR/external-doc-error.rs:12:7
+  --> $DIR/external-doc-error.rs:11:7
    |
 LL | #[doc(include)]
    |       ^^^^^^^ help: provide a file path with `=`: `include = "<path>"`
 
 error: expected path to external documentation
-  --> $DIR/external-doc-error.rs:17:7
+  --> $DIR/external-doc-error.rs:16:7
    |
 LL | #[doc(include("../README.md"))]
    |       ^^^^^^^^^^^^^^^^^^^^^^^ help: provide a file path with `=`: `include = "../README.md"`
 
 error: expected path to external documentation
-  --> $DIR/external-doc-error.rs:22:7
+  --> $DIR/external-doc-error.rs:21:7
    |
 LL | #[doc(include = 123)]
    |       ^^^^^^^^^^^^^ help: provide a file path with `=`: `include = "<path>"`
 
 error: expected path to external documentation
-  --> $DIR/external-doc-error.rs:27:7
+  --> $DIR/external-doc-error.rs:26:7
    |
 LL | #[doc(include(123))]
    |       ^^^^^^^^^^^^ help: provide a file path with `=`: `include = "<path>"`