diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-22 02:50:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-22 02:50:53 +0800 |
| commit | 696e951fe90fbe7b94dac8be8a9f3dbcacd33528 (patch) | |
| tree | 7ce38e94da8dfd1cac5f545bf98287b3d13c452a /src/libsyntax/ext | |
| parent | 256bf2be62cd1d124fbfe6c6a0fb9c43f4cb3e91 (diff) | |
| parent | cbbb73b56ff8137f38611233d36455294613d0ea (diff) | |
| download | rust-696e951fe90fbe7b94dac8be8a9f3dbcacd33528.tar.gz rust-696e951fe90fbe7b94dac8be8a9f3dbcacd33528.zip | |
Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
tweaks and fixes for doc(include) This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732): * Turns errors when loading files into full errors. This matches the original RFC text. * Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes. * Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends. * Adds or modifies tests to check for all of these.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 07ea6a09086..81baa0c3954 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1115,15 +1115,19 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> { match File::open(&filename).and_then(|mut f| f.read_to_end(&mut buf)) { Ok(..) => {} Err(e) => { - self.cx.span_warn(at.span, - &format!("couldn't read {}: {}", - filename.display(), - e)); + self.cx.span_err(at.span, + &format!("couldn't read {}: {}", + filename.display(), + e)); } } match String::from_utf8(buf) { Ok(src) => { + // Add this input file to the code map to make it available as + // dependency information + self.cx.codemap().new_filemap_and_lines(&filename, &src); + let include_info = vec