Skip to content

Commit 04a5406

Browse files
committed
---
yaml --- r: 81281 b: refs/heads/snap-stage3 c: 398e2c4 h: refs/heads/master i: 81279: f0cc84b v: v3
1 parent 8bd73fd commit 04a5406

35 files changed

+341
-481
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 56da32c5566207627a57d9e336cbb8c1f09c91c0
4+
refs/heads/snap-stage3: 398e2c479a67ba0646b0c1ebde6ff0fac3f25522
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial-rustpkg.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ This makes sense, as we haven't gotten it from anywhere yet! Luckily for us,
3535
used like this:
3636

3737
~~~ {.notrust}
38-
$ rustpkg install pkg_id
38+
$ rustpkg install PKG_ID
3939
~~~
4040

41-
This will install a package named 'pkg_id' into your current Rust environment.
42-
I called it 'pkg_id' in this example because `rustpkg` calls this a 'package
41+
This will install a package named `PKG_ID` into your current Rust environment.
42+
I called it `PKG_ID` in this example because `rustpkg` calls this a 'package
4343
identifier.' When using it with an external package like this, it's often a
4444
URI fragment. You see, Rust has no central authority for packages. You can
4545
build your own `hello` library if you want, and that's fine. We'd both host

branches/snap-stage3/man/rustdoc.1

Lines changed: 21 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,84 +3,49 @@
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS
55
.B rustdoc
6-
[\fIOPTIONS\fR] \fIINPUT\fR
6+
[\fIOPTIONS\fR] \fICRATEFILE\fR
77

88
.SH DESCRIPTION
99
This tool generates API reference documentation by extracting comments from
10-
source code written in the Rust language, available at
11-
<\fBhttps://www.rust-lang.org\fR>. It accepts several input formats and provides
12-
several output formats for the generated documentation.
10+
source code written in the Rust language, available at <\fBhttps://www.rust-
11+
lang.org\fR>. It provides several output formats for the generated
12+
documentation.
1313

14-
.SH OPTIONS
14+
.SH COMMANDS
1515

1616
.TP
17-
-r --input-format <val>
18-
html or json (default: inferred)
17+
--output-dir <val>
18+
Put documents here (default: .)
1919
.TP
20-
-w --output-format <val>
21-
html or json (default: html)
20+
--output-format <val>
21+
markdown or html (default: html)
2222
.TP
23-
-o --output <val>
24-
where to place the output (default: doc/ for html, doc.json for json)
23+
--output-style <val>
24+
doc-per-crate or doc-per-mod (default: doc-per-mod)
2525
.TP
26-
--passes <val>
27-
space-separated list of passes to run (default: '')
28-
.TP
29-
--no-defaults
30-
don't run the default passes
31-
.TP
32-
--plugins <val>
33-
space-separated list of plugins to run (default: '')
34-
.TP
35-
--plugin-path <val>
36-
directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
37-
.TP
38-
-L --library-path <val>
39-
directory to add to crate search path
26+
--pandoc-cmd <val>
27+
Command for running pandoc
4028
.TP
4129
-h, --help
4230
Print help
4331

4432
.SH "OUTPUT FORMATS"
4533

46-
The rustdoc tool can generate output in either an HTML or JSON format.
47-
48-
If using an HTML format, then the specified output destination will be the root
49-
directory of an HTML structure for all the documentation. Pages will be placed
50-
into this directory, and source files will also possibly be rendered into it as
51-
well.
52-
53-
If using a JSON format, then the specified output destination will have the
54-
rustdoc output serialized as JSON into it. This output format exists to
55-
pre-compile documentation for crates, and for usage in non-rustdoc tools. The
56-
JSON output is the following hash:
57-
58-
{
59-
"schema": VERSION,
60-
"crate": ...,
61-
"plugins": ...,
62-
}
63-
64-
The schema version indicates what the structure of crate/plugins will look
65-
like. Within a schema version the structure will remain the same. The `crate`
66-
field will contain all relevant documentation for the source being documented,
67-
and the `plugins` field will contain the output of the plugins run over the
68-
crate.
34+
The rustdoc tool can generate documentation in either the Markdown
35+
or HTML formats. It requires the pandoc tool
36+
<\fBhttp://johnmacfarlane.net/pandoc/\fR> for conversion features.
6937

7038
.SH "EXAMPLES"
7139

7240
To generate documentation for the source in the current directory:
7341
$ rustdoc hello.rs
7442

75-
List all available passes that rustdoc has, along with default passes:
76-
$ rustdoc --passes list
77-
78-
To precompile the documentation for a crate, and then use it to render html at
79-
a later date:
80-
$ rustdoc -w json hello.rs
81-
$ rustdoc doc.json
43+
To build documentation into a subdirectory named 'doc' in the Markdown
44+
format:
45+
$ rustdoc --output-dir doc --output-format markdown hello.rs
8246

83-
The generated HTML can be viewed with any standard web browser.
47+
The generated HTML can be viewed with any standard web browser, while
48+
the Markdown version is well-suited for conversion into other formats.
8449

8550
.SH "SEE ALSO"
8651

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ RUSTDOC = $(HBIN2_H_$(CFG_BUILD_TRIPLE))/rustdoc$(X_$(CFG_BUILD_TRIPLE))
227227
define libdoc
228228
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
229229
@$$(call E, rustdoc: $$@)
230-
$(Q)$(RUSTDOC) $(2)
230+
$(Q)$(RUSTDOC) html $(2)
231231

232232
DOCS += doc/$(1)/index.html
233233
endef

branches/snap-stage3/mk/tests.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ tidy:
261261
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
262262
$(Q)echo $(ALL_HS) \
263263
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
264+
$(Q)find $(S)src -type f -perm +111 \
265+
-not -name '*.rs' -and -not -name '*.py' \
266+
-and -not -name '*.sh' \
267+
| grep '^$(S)src/llvm' -v \
268+
| grep '^$(S)src/libuv' -v \
269+
| grep '^$(S)src/gyp' -v \
270+
| grep '^$(S)src/etc' -v \
271+
| grep '^$(S)src/rt/jemalloc' -v \
272+
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
264273

265274
endif
266275

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
import sys
12+
13+
offenders = sys.argv[1:]
14+
if len(offenders) > 0:
15+
print("Binaries checked into src:")
16+
for offender in offenders:
17+
print(offender)
18+
sys.exit(1)

branches/snap-stage3/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
121121
for pat in arm.pats.iter() {
122122

123123
// Check that we do not match against a static NaN (#6804)
124-
let pat_matches_nan: &fn(@Pat) -> bool = |p| {
124+
let pat_matches_nan: &fn(&Pat) -> bool = |p| {
125125
match cx.tcx.def_map.find(&p.id) {
126126
Some(&DefStatic(did, false)) => {
127127
let const_expr = lookup_const_by_id(cx.tcx, did).unwrap();
@@ -893,7 +893,7 @@ pub fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
893893
}
894894
}
895895

896-
let check_move: &fn(@Pat, Option<@Pat>) = |p, sub| {
896+
let check_move: &fn(&Pat, Option<@Pat>) = |p, sub| {
897897
// check legality of moving out of the enum
898898

899899
// x @ Foo(*) is legal, but x @ Foo(y) isn't.

branches/snap-stage3/src/librustc/middle/dataflow.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
422422
}
423423

424424
fn walk_expr(&mut self,
425-
expr: @ast::Expr,
425+
expr: &ast::Expr,
426426
in_out: &mut [uint],
427427
loop_scopes: &mut ~[LoopScope]) {
428428
debug!("DataFlowContext::walk_expr(expr=%s, in_out=%s)",
@@ -744,7 +744,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
744744
}
745745

746746
fn pop_scopes(&mut self,
747-
from_expr: @ast::Expr,
747+
from_expr: &ast::Expr,
748748
to_scope: &mut LoopScope,
749749
in_out: &mut [uint]) {
750750
//! Whenever you have a `break` or a `loop` statement, flow
@@ -778,7 +778,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
778778
}
779779

780780
fn break_from_to(&mut self,
781-
from_expr: @ast::Expr,
781+
from_expr: &ast::Expr,
782782
to_scope: &mut LoopScope,
783783
in_out: &mut [uint]) {
784784
self.pop_scopes(from_expr, to_scope, in_out);
@@ -811,7 +811,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
811811
fn walk_call(&mut self,
812812
_callee_id: ast::NodeId,
813813
call_id: ast::NodeId,
814-
arg0: @ast::Expr,
814+
arg0: &ast::Expr,
815815
args: &[@ast::Expr],
816816
in_out: &mut [uint],
817817
loop_scopes: &mut ~[LoopScope]) {
@@ -865,7 +865,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
865865
}
866866

867867
fn find_scope<'a>(&self,
868-
expr: @ast::Expr,
868+
expr: &ast::Expr,
869869
label: Option<ast::Name>,
870870
loop_scopes: &'a mut ~[LoopScope]) -> &'a mut LoopScope {
871871
let index = match label {
@@ -899,7 +899,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
899899
&mut loop_scopes[index]
900900
}
901901

902-
fn is_method_call(&self, expr: @ast::Expr) -> bool {
902+
fn is_method_call(&self, expr: &ast::Expr) -> bool {
903903
self.dfcx.method_map.contains_key(&expr.id)
904904
}
905905

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5363,7 +5363,7 @@ impl Resolver {
53635363
}
53645364

53655365
pub fn enforce_default_binding_mode(&mut self,
5366-
pat: @Pat,
5366+
pat: &Pat,
53675367
pat_binding_mode: BindingMode,
53685368
descr: &str) {
53695369
match pat_binding_mode {

branches/snap-stage3/src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ fn insert_lllocals(bcx: @mut Block,
13981398
}
13991399

14001400
fn compile_guard(bcx: @mut Block,
1401-
guard_expr: @ast::Expr,
1401+
guard_expr: &ast::Expr,
14021402
data: &ArmData,
14031403
m: &[Match],
14041404
vals: &[ValueRef],
@@ -1826,7 +1826,7 @@ fn compile_submatch_continue(mut bcx: @mut Block,
18261826

18271827
pub fn trans_match(bcx: @mut Block,
18281828
match_expr: &ast::Expr,
1829-
discr_expr: @ast::Expr,
1829+
discr_expr: &ast::Expr,
18301830
arms: &[ast::Arm],
18311831
dest: Dest) -> @mut Block {
18321832
let _icx = push_ctxt("match::trans_match");
@@ -1876,7 +1876,7 @@ fn create_bindings_map(bcx: @mut Block, pat: @ast::Pat) -> BindingsMap {
18761876
}
18771877

18781878
fn trans_match_inner(scope_cx: @mut Block,
1879-
discr_expr: @ast::Expr,
1879+
discr_expr: &ast::Expr,
18801880
arms: &[ast::Arm],
18811881
dest: Dest) -> @mut Block {
18821882
let _icx = push_ctxt("match::trans_match_inner");

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,10 @@ pub fn cleanup_and_leave(bcx: @mut Block,
14071407
}
14081408
match leave {
14091409
Some(target) => Br(bcx, target),
1410-
None => { Resume(bcx, Load(bcx, bcx.fcx.personality.unwrap())); }
1410+
None => {
1411+
let ll_load = Load(bcx, bcx.fcx.personality.unwrap());
1412+
Resume(bcx, ll_load);
1413+
}
14111414
}
14121415
}
14131416

@@ -2485,7 +2488,7 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
24852488
ty::item_path(ccx.tcx, ast_util::local_def(*id))
24862489
}
24872490

2488-
fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
2491+
fn exported_name(ccx: &mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
24892492
match attr::first_attr_value_str_by_name(attrs, "export_name") {
24902493
// Use provided name
24912494
Some(name) => name.to_owned(),
@@ -2979,7 +2982,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
29792982
return map;
29802983
}
29812984

2982-
pub fn fill_crate_map(ccx: @mut CrateContext, map: ValueRef) {
2985+
pub fn fill_crate_map(ccx: &mut CrateContext, map: ValueRef) {
29832986
let mut subcrates: ~[ValueRef] = ~[];
29842987
let mut i = 1;
29852988
let cstore = ccx.sess.cstore;
@@ -3030,7 +3033,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
30303033
}
30313034
}
30323035

3033-
pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
3036+
pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) {
30343037
if !*cx.sess.building_library { return; }
30353038

30363039
let encode_inlined_item: encoder::encode_inlined_item =

0 commit comments

Comments
 (0)