Skip to content

Commit afe8f6e

Browse files
committed
auto merge of #11177 : cmr/rust/native_and_green_docs, r=alexcrichton
Some people have requested this, and I think it's quite useful to have documentation for the compiler libraries. libnative and libgreen are self-explanatory I think.
2 parents 38a5edb + 7b382e5 commit afe8f6e

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

mk/docs.mk

+15
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
######################################################################
1414

1515
DOCS :=
16+
CDOCS :=
1617
DOCS_L10N :=
1718

1819
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections
@@ -232,8 +233,21 @@ doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
232233
DOCS += doc/$(1)/index.html
233234
endef
234235

236+
define compiledoc
237+
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
238+
@$$(call E, rustdoc: $$@)
239+
$(Q)$(RUSTDOC) --cfg stage2 $(2)
240+
241+
CDOCS += doc/$(1)/index.html
242+
endef
243+
235244
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(CFG_BUILD)))
236245
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(CFG_BUILD)))
246+
$(eval $(call libdoc,native,$(LIBNATIVE_CRATE),$(CFG_BUILD)))
247+
$(eval $(call libdoc,green,$(LIBGREEN_CRATE),$(CFG_BUILD)))
248+
249+
$(eval $(call compiledoc,rustc,$(COMPILER_CRATE),$(CFG_BUILD)))
250+
$(eval $(call compiledoc,syntax,$(LIBSYNTAX_CRATE),$(CFG_BUILD)))
237251

238252

239253
ifdef CFG_DISABLE_DOCS
@@ -256,6 +270,7 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
256270
GENERATED += doc/version.md doc/version_info.html
257271

258272
docs: $(DOCS)
273+
compiler-docs: $(CDOCS)
259274

260275
docs-l10n: $(DOCS_L10N)
261276

src/librustdoc/clean.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,8 @@ fn lit_to_str(lit: &ast::lit) -> ~str {
11231123

11241124
fn name_from_pat(p: &ast::Pat) -> ~str {
11251125
use syntax::ast::*;
1126+
debug!("Trying to get a name from pattern: {:?}", p);
1127+
11261128
match p.node {
11271129
PatWild => ~"_",
11281130
PatWildMulti => ~"..",
@@ -1134,9 +1136,12 @@ fn name_from_pat(p: &ast::Pat) -> ~str {
11341136
PatBox(p) => name_from_pat(p),
11351137
PatUniq(p) => name_from_pat(p),
11361138
PatRegion(p) => name_from_pat(p),
1137-
PatLit(..) => fail!("tried to get argument name from pat_lit, \
1138-
which is not allowed in function arguments"),
1139-
PatRange(..) => fail!("tried to get argument name from pat_range, \
1139+
PatLit(..) => {
1140+
warn!("tried to get argument name from PatLit, \
1141+
which is silly in function arguments");
1142+
~"()"
1143+
},
1144+
PatRange(..) => fail!("tried to get argument name from PatRange, \
11401145
which is not allowed in function arguments"),
11411146
PatVec(..) => fail!("tried to get argument name from pat_vec, \
11421147
which is not allowed in function arguments")

0 commit comments

Comments
 (0)