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.
This commit is contained in:
commit
afe8f6e106
15
mk/docs.mk
15
mk/docs.mk
|
@ -13,6 +13,7 @@
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
DOCS :=
|
DOCS :=
|
||||||
|
CDOCS :=
|
||||||
DOCS_L10N :=
|
DOCS_L10N :=
|
||||||
|
|
||||||
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections
|
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))
|
||||||
DOCS += doc/$(1)/index.html
|
DOCS += doc/$(1)/index.html
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define compiledoc
|
||||||
|
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
|
||||||
|
@$$(call E, rustdoc: $$@)
|
||||||
|
$(Q)$(RUSTDOC) --cfg stage2 $(2)
|
||||||
|
|
||||||
|
CDOCS += doc/$(1)/index.html
|
||||||
|
endef
|
||||||
|
|
||||||
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(CFG_BUILD)))
|
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(CFG_BUILD)))
|
||||||
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(CFG_BUILD)))
|
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(CFG_BUILD)))
|
||||||
|
$(eval $(call libdoc,native,$(LIBNATIVE_CRATE),$(CFG_BUILD)))
|
||||||
|
$(eval $(call libdoc,green,$(LIBGREEN_CRATE),$(CFG_BUILD)))
|
||||||
|
|
||||||
|
$(eval $(call compiledoc,rustc,$(COMPILER_CRATE),$(CFG_BUILD)))
|
||||||
|
$(eval $(call compiledoc,syntax,$(LIBSYNTAX_CRATE),$(CFG_BUILD)))
|
||||||
|
|
||||||
|
|
||||||
ifdef CFG_DISABLE_DOCS
|
ifdef CFG_DISABLE_DOCS
|
||||||
|
@ -256,6 +270,7 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
|
||||||
GENERATED += doc/version.md doc/version_info.html
|
GENERATED += doc/version.md doc/version_info.html
|
||||||
|
|
||||||
docs: $(DOCS)
|
docs: $(DOCS)
|
||||||
|
compiler-docs: $(CDOCS)
|
||||||
|
|
||||||
docs-l10n: $(DOCS_L10N)
|
docs-l10n: $(DOCS_L10N)
|
||||||
|
|
||||||
|
|
|
@ -1123,6 +1123,8 @@ fn lit_to_str(lit: &ast::lit) -> ~str {
|
||||||
|
|
||||||
fn name_from_pat(p: &ast::Pat) -> ~str {
|
fn name_from_pat(p: &ast::Pat) -> ~str {
|
||||||
use syntax::ast::*;
|
use syntax::ast::*;
|
||||||
|
debug!("Trying to get a name from pattern: {:?}", p);
|
||||||
|
|
||||||
match p.node {
|
match p.node {
|
||||||
PatWild => ~"_",
|
PatWild => ~"_",
|
||||||
PatWildMulti => ~"..",
|
PatWildMulti => ~"..",
|
||||||
|
@ -1134,9 +1136,12 @@ fn name_from_pat(p: &ast::Pat) -> ~str {
|
||||||
PatBox(p) => name_from_pat(p),
|
PatBox(p) => name_from_pat(p),
|
||||||
PatUniq(p) => name_from_pat(p),
|
PatUniq(p) => name_from_pat(p),
|
||||||
PatRegion(p) => name_from_pat(p),
|
PatRegion(p) => name_from_pat(p),
|
||||||
PatLit(..) => fail!("tried to get argument name from pat_lit, \
|
PatLit(..) => {
|
||||||
which is not allowed in function arguments"),
|
warn!("tried to get argument name from PatLit, \
|
||||||
PatRange(..) => fail!("tried to get argument name from pat_range, \
|
which is silly in function arguments");
|
||||||
|
~"()"
|
||||||
|
},
|
||||||
|
PatRange(..) => fail!("tried to get argument name from PatRange, \
|
||||||
which is not allowed in function arguments"),
|
which is not allowed in function arguments"),
|
||||||
PatVec(..) => fail!("tried to get argument name from pat_vec, \
|
PatVec(..) => fail!("tried to get argument name from pat_vec, \
|
||||||
which is not allowed in function arguments")
|
which is not allowed in function arguments")
|
||||||
|
|
Loading…
Reference in New Issue