From 95b87d18c0ba2ce019cab6fb75ab52460e6899e7 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Tue, 19 Dec 2017 16:43:32 -0600 Subject: add files loaded through doc(include) into dep-info --- src/test/run-make/include_bytes_deps/Makefile | 2 +- src/test/run-make/include_bytes_deps/input.md | 1 + src/test/run-make/include_bytes_deps/main.rs | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/test/run-make/include_bytes_deps/input.md (limited to 'src/test') diff --git a/src/test/run-make/include_bytes_deps/Makefile b/src/test/run-make/include_bytes_deps/Makefile index f7b1d21ace2..1293695b799 100644 --- a/src/test/run-make/include_bytes_deps/Makefile +++ b/src/test/run-make/include_bytes_deps/Makefile @@ -8,7 +8,7 @@ ifneq ($(shell uname),FreeBSD) ifndef IS_WINDOWS all: $(RUSTC) --emit dep-info main.rs - $(CGREP) "input.txt" "input.bin" < $(TMPDIR)/main.d + $(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d else all: diff --git a/src/test/run-make/include_bytes_deps/input.md b/src/test/run-make/include_bytes_deps/input.md new file mode 100644 index 00000000000..2a19b7405f7 --- /dev/null +++ b/src/test/run-make/include_bytes_deps/input.md @@ -0,0 +1 @@ +# Hello, world! diff --git a/src/test/run-make/include_bytes_deps/main.rs b/src/test/run-make/include_bytes_deps/main.rs index 579b2a452a1..27ca1a46a50 100644 --- a/src/test/run-make/include_bytes_deps/main.rs +++ b/src/test/run-make/include_bytes_deps/main.rs @@ -8,6 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(external_doc)] + +#[doc(include="input.md")] +pub struct SomeStruct; + pub fn main() { const INPUT_TXT: &'static str = include_str!("input.txt"); const INPUT_BIN: &'static [u8] = include_bytes!("input.bin"); -- cgit 1.4.1-3-g733a5 From f873c55709f9ad20523e347456feccd0f18f5aa0 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Tue, 19 Dec 2017 16:43:46 -0600 Subject: test for missing_doc in the external_doc test --- src/test/rustdoc/auxiliary/external-cross.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test') diff --git a/src/test/rustdoc/auxiliary/external-cross.rs b/src/test/rustdoc/auxiliary/external-cross.rs index cb14fec7abe..767fb05313a 100644 --- a/src/test/rustdoc/auxiliary/external-cross.rs +++ b/src/test/rustdoc/auxiliary/external-cross.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(external_doc)] +#![deny(missing_doc)] #[doc(include="external-cross-doc.md")] pub struct NeedMoreDocs; -- cgit 1.4.1-3-g733a5 From cbbb73b56ff8137f38611233d36455294613d0ea Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Tue, 19 Dec 2017 16:50:53 -0600 Subject: add compile-fail error for external_doc errors --- src/test/compile-fail/external-doc-error.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/compile-fail/external-doc-error.rs (limited to 'src/test') diff --git a/src/test/compile-fail/external-doc-error.rs b/src/test/compile-fail/external-doc-error.rs new file mode 100644 index 00000000000..1ae0d0bd276 --- /dev/null +++ b/src/test/compile-fail/external-doc-error.rs @@ -0,0 +1,16 @@ +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(external_doc)] + +#[doc(include = "not-a-file.md")] //~ ERROR: couldn't read +pub struct SomeStruct; + +fn main() {} -- cgit 1.4.1-3-g733a5