Skip to content

Commit ed6b575

Browse files
Update Makefile
1 parent 6407b94 commit ed6b575

File tree

5 files changed

+52
-22
lines changed

5 files changed

+52
-22
lines changed

mk/docs.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ RUSTBOOK = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(RUSTBOOK_EXE)
6262
# The error-index-generator executable...
6363
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error-index-generator$(X_$(CFG_BUILD))
6464
ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
65+
ERR_IDX_GEN_MD = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE) markdown
6566

6667
D := $(S)src/doc
6768

@@ -217,6 +218,12 @@ doc/style/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/style/*.md) | doc/
217218

218219
error-index: doc/error-index.html
219220

220-
doc/error-index.html: $(ERR_IDX_GEN_EXE) | doc/
221+
# Metadata used to generate the index is created as a side effect of
222+
# the build so this depends on every crate being up to date.
223+
doc/error-index.html: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
221224
$(Q)$(call E, error-index-generator: $@)
222225
$(Q)$(ERR_IDX_GEN)
226+
227+
doc/error-index.md: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
228+
$(Q)$(call E, error-index-generator: $@)
229+
$(Q)$(ERR_IDX_GEN_MD)

mk/tests.mk

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
298298
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
299299
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
300300
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
301-
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
302-
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
303-
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
301+
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
302+
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
303+
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
304304
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
305305
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
307-
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
308-
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
307+
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
308+
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
309309
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
310310
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
311311
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) \
673673
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
674674
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
675675
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
676-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
677-
$(S)src/etc/htmldocck.py
676+
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
677+
$(S)src/etc/htmldocck.py
678678

679679
endef
680680

@@ -892,6 +892,28 @@ $(foreach host,$(CFG_HOST), \
892892
$(foreach crate,$(TEST_DOC_CRATES), \
893893
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
894894

895+
define DEF_DOC_TEST_ERROR_INDEX
896+
897+
check-stage$(1)-T-$(2)-H-$(3)-doc-error-index-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index)
898+
899+
ifeq ($(2),$$(CFG_BUILD))
900+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index): \
901+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
902+
doc/error-index.md
903+
$$(Q)touch $$@.start_time
904+
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test doc/error-index.md
905+
$$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
906+
else
907+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index):
908+
$$(Q)touch $$@
909+
endif
910+
endef
911+
912+
$(foreach host,$(CFG_HOST), \
913+
$(foreach target,$(CFG_TARGET), \
914+
$(foreach stage,$(STAGES), \
915+
$(eval $(call DEF_DOC_TEST_ERROR_INDEX,$(stage),$(target),$(host))))))
916+
895917
######################################################################
896918
# Shortcut rules
897919
######################################################################
@@ -901,7 +923,7 @@ TEST_GROUPS = \
901923
$(foreach crate,$(TEST_CRATES),$(crate)) \
902924
$(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
903925
rpass \
904-
rpass-valgrind \
926+
rpass-valgrind \
905927
rpass-full \
906928
rfail-full \
907929
cfail-full \
@@ -918,7 +940,7 @@ TEST_GROUPS = \
918940
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
919941
pretty \
920942
pretty-rpass \
921-
pretty-rpass-valgrind \
943+
pretty-rpass-valgrind \
922944
pretty-rpass-full \
923945
pretty-rfail-full \
924946
pretty-rfail \
@@ -987,7 +1009,8 @@ define DEF_CHECK_DOC_FOR_STAGE
9871009
check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
9881010
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
9891011
$$(foreach crate,$$(TEST_DOC_CRATES), \
990-
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
1012+
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate)) \
1013+
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-error-index-exec
9911014
endef
9921015

9931016
$(foreach stage,$(STAGES), \

src/librustc/diagnostics.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ String to be moved into a variable called `s`.
131131
let x = Some("s".to_string());
132132
133133
match x {
134-
op_string @ Some(s) => {}
135-
None => {}
134+
op_string @ Some(s) => {},
135+
None => {},
136136
}
137137
```
138138
@@ -145,10 +145,10 @@ name is bound by move in a pattern, it should also be moved to wherever it is
145145
referenced in the pattern guard code. Doing so however would prevent the name
146146
from being available in the body of the match arm. Consider the following:
147147
148-
```
148+
```compile_fail
149149
match Some("hi".to_string()) {
150-
Some(s) if s.len() == 0 => // use s.
151-
_ => {}
150+
Some(s) if s.len() == 0 => {}, // use s.
151+
_ => {},
152152
}
153153
```
154154
@@ -159,11 +159,11 @@ therefore become unavailable in the body of the arm. Although this example seems
159159
innocuous, the problem is most clear when considering functions that take their
160160
argument by value.
161161
162-
```
162+
```compile_fail
163163
match Some("hi".to_string()) {
164164
Some(s) if { drop(s); false } => (),
165-
Some(s) => // use s.
166-
_ => {}
165+
Some(s) => {}, // use s.
166+
_ => {},
167167
}
168168
```
169169
@@ -1645,7 +1645,7 @@ let x: i32 = "I am not a number!";
16451645
Another situation in which this occurs is when you attempt to use the `try!`
16461646
macro inside a function that does not return a `Result<T, E>`:
16471647
1648-
```
1648+
```compile_fail
16491649
use std::fs::File;
16501650
16511651
fn main() {

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ fn main() {
14061406
To solve this situation, constrain the type of the variable.
14071407
Examples:
14081408
1409-
```
1409+
```no_run
14101410
#![allow(unused_variables)]
14111411
14121412
fn some_func(x: &u32) {

src/librustdoc/html/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ mod tests {
579579
t("rust", false, false, false, true, false, false);
580580
t("sh", false, false, false, false, false, false);
581581
t("ignore", false, false, true, true, false, false);
582-
t("should_panic", true, false, false, true, false, false);
582+
t("should_panic", true, true, false, true, false, false);
583583
t("no_run", false, true, false, true, false, false);
584584
t("test_harness", false, false, false, true, true, false);
585585
t("compile_fail", false, false, false, true, false, true);

0 commit comments

Comments
 (0)