]> git.lizzy.rs Git - rust.git/commitdiff
Update Makefile
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 7 Feb 2016 12:03:11 +0000 (13:03 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 9 Feb 2016 04:22:24 +0000 (05:22 +0100)
mk/docs.mk
mk/tests.mk
src/librustc/diagnostics.rs
src/librustc_typeck/diagnostics.rs
src/librustdoc/html/markdown.rs

index f76368e3d0b86ae0b5e3fe76fc9f05d420ebc274..7f73b99863f093fe349962a1b67a72fc159d6f94 100644 (file)
@@ -62,6 +62,7 @@ RUSTBOOK = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(RUSTBOOK_EXE)
 # The error-index-generator executable...
 ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error-index-generator$(X_$(CFG_BUILD))
 ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
+ERR_IDX_GEN_MD = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE) markdown
 
 D := $(S)src/doc
 
@@ -217,6 +218,12 @@ doc/style/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/style/*.md) | doc/
 
 error-index: doc/error-index.html
 
-doc/error-index.html: $(ERR_IDX_GEN_EXE) | doc/
+# Metadata used to generate the index is created as a side effect of
+# the build so this depends on every crate being up to date.
+doc/error-index.html: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
        $(Q)$(call E, error-index-generator: $@)
        $(Q)$(ERR_IDX_GEN)
+
+doc/error-index.md: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
+       $(Q)$(call E, error-index-generator: $@)
+       $(Q)$(ERR_IDX_GEN_MD)
index 19587a28d5594b6f13e04362e38706016e5387ef..2e530095cbe1c92d5b38df47b229f686b02965ea 100644 (file)
@@ -298,14 +298,14 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
        check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
        check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
        check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
-    check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
-    check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
-    check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
        check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
        check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
        check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
-        check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
-        check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
        check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
        check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
        check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
@@ -673,8 +673,8 @@ CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
 CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
 CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
 CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
-        $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
-       $(S)src/etc/htmldocck.py
+               $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
+               $(S)src/etc/htmldocck.py
 
 endef
 
@@ -892,6 +892,28 @@ $(foreach host,$(CFG_HOST), \
    $(foreach crate,$(TEST_DOC_CRATES), \
     $(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
 
+define DEF_DOC_TEST_ERROR_INDEX
+
+check-stage$(1)-T-$(2)-H-$(3)-doc-error-index-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index)
+
+ifeq ($(2),$$(CFG_BUILD))
+$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index): \
+               $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
+               doc/error-index.md
+       $$(Q)touch $$@.start_time
+       $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test doc/error-index.md
+       $$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
+else
+$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index):
+       $$(Q)touch $$@
+endif
+endef
+
+$(foreach host,$(CFG_HOST), \
+ $(foreach target,$(CFG_TARGET), \
+  $(foreach stage,$(STAGES), \
+   $(eval $(call DEF_DOC_TEST_ERROR_INDEX,$(stage),$(target),$(host))))))
+
 ######################################################################
 # Shortcut rules
 ######################################################################
@@ -901,7 +923,7 @@ TEST_GROUPS = \
        $(foreach crate,$(TEST_CRATES),$(crate)) \
        $(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
        rpass \
-    rpass-valgrind \
+       rpass-valgrind \
        rpass-full \
        rfail-full \
        cfail-full \
@@ -918,7 +940,7 @@ TEST_GROUPS = \
        $(foreach docname,$(DOC_NAMES),doc-$(docname)) \
        pretty \
        pretty-rpass \
-    pretty-rpass-valgrind \
+       pretty-rpass-valgrind \
        pretty-rpass-full \
        pretty-rfail-full \
        pretty-rfail \
@@ -987,7 +1009,8 @@ define DEF_CHECK_DOC_FOR_STAGE
 check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
                        check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
                      $$(foreach crate,$$(TEST_DOC_CRATES), \
-                       check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
+                       check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate)) \
+                     check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-error-index-exec
 endef
 
 $(foreach stage,$(STAGES), \
index a2b85ef831bf1b92468d6cbd8738ed629542f11b..8a9ef666b838468405119dc9a397d0b5a7710d85 100644 (file)
@@ -131,8 +131,8 @@ fn foo(x: Option<String>) {
 let x = Some("s".to_string());
 
 match x {
-    op_string @ Some(s) => {}
-    None => {}
+    op_string @ Some(s) => {},
+    None => {},
 }
 ```
 
@@ -145,10 +145,10 @@ fn foo(x: Option<String>) {
 referenced in the pattern guard code. Doing so however would prevent the name
 from being available in the body of the match arm. Consider the following:
 
-```
+```compile_fail
 match Some("hi".to_string()) {
-    Some(s) if s.len() == 0 => // use s.
-    _ => {}
+    Some(s) if s.len() == 0 => {}, // use s.
+    _ => {},
 }
 ```
 
@@ -159,11 +159,11 @@ fn foo(x: Option<String>) {
 innocuous, the problem is most clear when considering functions that take their
 argument by value.
 
-```
+```compile_fail
 match Some("hi".to_string()) {
     Some(s) if { drop(s); false } => (),
-    Some(s) => // use s.
-    _ => {}
+    Some(s) => {}, // use s.
+    _ => {},
 }
 ```
 
@@ -1645,7 +1645,7 @@ fn main() {
 Another situation in which this occurs is when you attempt to use the `try!`
 macro inside a function that does not return a `Result<T, E>`:
 
-```
+```compile_fail
 use std::fs::File;
 
 fn main() {
index 5c79e9a4ec5c6ecf33fc671d55aa60f424e340af..0ff6dcccde698c1a21b4a46b7e7759d90fb13ff8 100644 (file)
@@ -1406,7 +1406,7 @@ fn main() {
 To solve this situation, constrain the type of the variable.
 Examples:
 
-```
+```no_run
 #![allow(unused_variables)]
 
 fn some_func(x: &u32) {
index e919911e6fd84ef3247c2b80bcacde5008824eb7..f7a56dd582f3195bd99d9c0856594e9528f202cb 100644 (file)
@@ -579,7 +579,7 @@ fn t(s: &str,
         t("rust",                  false,        false,  false,  true,  false,        false);
         t("sh",                    false,        false,  false,  false, false,        false);
         t("ignore",                false,        false,  true,   true,  false,        false);
-        t("should_panic",          true,         false,  false,  true,  false,        false);
+        t("should_panic",          true,         true,   false,  true,  false,        false);
         t("no_run",                false,        true,   false,  true,  false,        false);
         t("test_harness",          false,        false,  false,  true,  true,         false);
         t("compile_fail",          false,        false,  false,  true,  false,        true);