Skip to content

Commit 4a5d390

Browse files
committed
auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brson
Lots of assorted things here and there, all the details are in the commits. Closes #11712
2 parents 897b96a + d7891c7 commit 4a5d390

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+351
-5799
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
[submodule "src/compiler-rt"]
1313
path = src/compiler-rt
1414
url = https://github.com/rust-lang/compiler-rt.git
15+
[submodule "src/rt/hoedown"]
16+
path = src/rt/hoedown
17+
url = https://github.com/rust-lang/hoedown.git

mk/crates.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# DEPS_<crate>
3939
# These lists are the dependencies of the <crate> that is to be built.
4040
# Rust dependencies are listed bare (i.e. std, green) and native
41-
# dependencies have a "native:" prefix (i.e. native:sundown). All deps
41+
# dependencies have a "native:" prefix (i.e. native:hoedown). All deps
4242
# will be built before the crate itself is built.
4343
#
4444
# TOOL_DEPS_<tool>/TOOL_SOURCE_<tool>
@@ -63,7 +63,7 @@ DEPS_native := std
6363
DEPS_syntax := std term serialize collections log
6464
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
6565
collections time log
66-
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
66+
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
6767
test time
6868
DEPS_flate := std native:miniz
6969
DEPS_arena := std collections

mk/dist.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
3535

3636
PKG_TAR = dist/$(PKG_NAME).tar.gz
3737

38-
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
38+
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt \
39+
$(S)src/rt/hoedown
3940
PKG_FILES := \
4041
$(S)COPYRIGHT \
4142
$(S)LICENSE-APACHE \

mk/docs.mk

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,6 @@ doc/footer.inc: $(D)/footer.inc | doc/
141141
@$(call E, cp: $@)
142142
$(Q)cp -a $< $@ 2> /dev/null
143143

144-
doc/FiraSans-Regular.woff: $(D)/FiraSans-Regular.woff | doc/
145-
@$(call E, cp: $@)
146-
$(Q)cp -a $< $@ 2> /dev/null
147-
148-
doc/FiraSans-Medium.woff: $(D)/FiraSans-Medium.woff | doc/
149-
@$(call E, cp: $@)
150-
$(Q)cp -a $< $@ 2> /dev/null
151-
152-
doc/Heuristica-Regular.woff: $(D)/Heuristica-Regular.woff | doc/
153-
@$(call E, cp: $@)
154-
$(Q)cp -a $< $@ 2> /dev/null
155-
156-
doc/Heuristica-Italic.woff: $(D)/Heuristica-Italic.woff | doc/
157-
@$(call E, cp: $@)
158-
$(Q)cp -a $< $@ 2> /dev/null
159-
160-
doc/Heuristica-Bold.woff: $(D)/Heuristica-Bold.woff | doc/
161-
@$(call E, cp: $@)
162-
$(Q)cp -a $< $@ 2> /dev/null
163-
164144
# The (english) documentation for each doc item.
165145

166146
define DEF_SHOULD_BUILD_PDF_DOC

mk/rt.mk

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rustrt sundown uv_support morestack miniz context_switch
38+
NATIVE_LIBS := rustrt hoedown uv_support morestack miniz context_switch
3939

4040
# $(1) is the target triple
4141
define NATIVE_LIBRARIES
4242

43-
NATIVE_DEPS_sundown_$(1) := sundown/src/autolink.c \
44-
sundown/src/buffer.c \
45-
sundown/src/stack.c \
46-
sundown/src/markdown.c \
47-
sundown/html/houdini_href_e.c \
48-
sundown/html/houdini_html_e.c \
49-
sundown/html/html_smartypants.c \
50-
sundown/html/html.c
43+
NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
44+
hoedown/src/buffer.c \
45+
hoedown/src/document.c \
46+
hoedown/src/escape.c \
47+
hoedown/src/html.c \
48+
hoedown/src/html_blocks.c \
49+
hoedown/src/html_smartypants.c \
50+
hoedown/src/stack.c \
51+
hoedown/src/version.c
5152
NATIVE_DEPS_uv_support_$(1) := rust_uv.c
5253
NATIVE_DEPS_miniz_$(1) = miniz.c
5354
NATIVE_DEPS_rustrt_$(1) := rust_builtin.c \
@@ -79,7 +80,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
7980
@mkdir -p $$(@D)
8081
@$$(call E, compile: $$@)
8182
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
82-
-I $$(S)src/rt/sundown/src -I $$(S)src/rt/sundown/html \
83+
-I $$(S)src/rt/hoedown/src \
8384
-I $$(S)src/libuv/include -I $$(S)src/rt \
8485
$$(RUNTIME_CFLAGS_$(1))) $$<
8586

mk/tests.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ ALL_CS := $(wildcard $(S)src/rt/*.cpp \
220220
$(S)src/rt/*/*/*.cpp \
221221
$(S)src/rustllvm/*.cpp)
222222
ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
223-
$(wildcard $(S)src/rt/sundown/src/*.c) \
224-
$(wildcard $(S)src/rt/sundown/html/*.c) \
223+
$(wildcard $(S)src/rt/hoedown/src/*.c) \
224+
$(wildcard $(S)src/rt/hoedown/bin/*.c) \
225225
,$(ALL_CS))
226226
ALL_HS := $(wildcard $(S)src/rt/*.h \
227227
$(S)src/rt/*/*.h \
@@ -232,8 +232,8 @@ ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
232232
$(S)src/rt/msvc/typeof.h \
233233
$(S)src/rt/msvc/stdint.h \
234234
$(S)src/rt/msvc/inttypes.h \
235-
$(wildcard $(S)src/rt/sundown/src/*.h) \
236-
$(wildcard $(S)src/rt/sundown/html/*.h) \
235+
$(wildcard $(S)src/rt/hoedown/src/*.h) \
236+
$(wildcard $(S)src/rt/hoedown/bin/*.h) \
237237
,$(ALL_HS))
238238

239239
# Run the tidy script in multiple parts to avoid huge 'echo' commands
@@ -266,6 +266,7 @@ tidy:
266266
-and -not -name '*.sh' \
267267
| grep '^$(S)src/llvm' -v \
268268
| grep '^$(S)src/libuv' -v \
269+
| grep '^$(S)src/rt/hoedown' -v \
269270
| grep '^$(S)src/gyp' -v \
270271
| grep '^$(S)src/etc' -v \
271272
| grep '^$(S)src/doc' -v \

src/doc/complement-cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use std::str;
6262
6363
let x: Option<~str> = str::from_utf8_owned(~[104u8,105u8]);
6464
let y: ~str = x.unwrap();
65-
~~~~
65+
~~~
6666

6767
To return a [`MaybeOwned`](http://static.rust-lang.org/doc/master/std/str/enum.MaybeOwned.html) use the str helper function [`from_utf8_lossy`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html). This function also replaces non-valid utf-8 sequences with U+FFFD replacement character.
6868

@@ -71,7 +71,7 @@ use std::str;
7171
7272
let x = bytes!(72u8,"ello ",0xF0,0x90,0x80,"World!");
7373
let y = str::from_utf8_lossy(x);
74-
~~~~
74+
~~~
7575

7676
# File operations
7777

src/doc/complement-lang-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ For simplicity, we do not plan to do so. Implementing automatic semicolon insert
135135

136136
**Short answer** set the RUST_LOG environment variable to the name of your source file, sans extension.
137137

138-
``` {.sh .notrust}
138+
```notrust,sh
139139
rustc hello.rs
140140
export RUST_LOG=hello
141141
./hello

src/doc/guide-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Iterator<int> for ZeroStream {
8181
Some(0)
8282
}
8383
}
84-
~~~~
84+
~~~
8585

8686
Reaching the end of the iterator is signalled by returning `None` instead of
8787
`Some(item)`:

src/doc/guide-ffi.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ snappy includes a C interface (documented in
1111
The following is a minimal example of calling a foreign function which will
1212
compile if snappy is installed:
1313

14-
~~~~
14+
~~~~no_run
1515
extern crate libc;
1616
use libc::size_t;
1717
1818
#[link(name = "snappy")]
19-
# #[cfg(ignore_this)]
2019
extern {
2120
fn snappy_max_compressed_length(source_length: size_t) -> size_t;
2221
}
23-
# unsafe fn snappy_max_compressed_length(a: size_t) -> size_t { a }
2422
2523
fn main() {
2624
let x = unsafe { snappy_max_compressed_length(100) };
@@ -46,7 +44,7 @@ keeping the binding correct at runtime.
4644

4745
The `extern` block can be extended to cover the entire snappy API:
4846

49-
~~~~ {.ignore}
47+
~~~~no_run
5048
extern crate libc;
5149
use libc::{c_int, size_t};
5250
@@ -67,6 +65,7 @@ extern {
6765
fn snappy_validate_compressed_buffer(compressed: *u8,
6866
compressed_length: size_t) -> c_int;
6967
}
68+
# fn main() {}
7069
~~~~
7170

7271
# Creating a safe interface
@@ -209,19 +208,16 @@ A basic example is:
209208

210209
Rust code:
211210

212-
~~~~
211+
~~~~no_run
213212
extern fn callback(a:i32) {
214213
println!("I'm called from C with value {0}", a);
215214
}
216215
217216
#[link(name = "extlib")]
218-
# #[cfg(ignore)]
219217
extern {
220218
fn register_callback(cb: extern fn(i32)) -> i32;
221219
fn trigger_callback();
222220
}
223-
# unsafe fn register_callback(cb: extern fn(i32)) -> i32 { 0 }
224-
# unsafe fn trigger_callback() { }
225221
226222
fn main() {
227223
unsafe {
@@ -265,7 +261,7 @@ referenced Rust object.
265261

266262
Rust code:
267263

268-
~~~~
264+
~~~~no_run
269265
270266
struct RustObject {
271267
a: i32,
@@ -281,15 +277,11 @@ extern fn callback(target: *mut RustObject, a:i32) {
281277
}
282278
283279
#[link(name = "extlib")]
284-
# #[cfg(ignore)]
285280
extern {
286281
fn register_callback(target: *mut RustObject,
287282
cb: extern fn(*mut RustObject, i32)) -> i32;
288283
fn trigger_callback();
289284
}
290-
# unsafe fn register_callback(a: *mut RustObject,
291-
# b: extern fn(*mut RustObject, i32)) -> i32 { 0 }
292-
# unsafe fn trigger_callback() {}
293285
294286
fn main() {
295287
// Create the object that will be referenced in the callback
@@ -398,9 +390,12 @@ the `link_args` attribute. This attribute is applied to `extern` blocks and
398390
specifies raw flags which need to get passed to the linker when producing an
399391
artifact. An example usage would be:
400392

401-
~~~ {.ignore}
393+
~~~ no_run
394+
#![feature(link_args)]
395+
402396
#[link_args = "-foo -bar -baz"]
403397
extern {}
398+
# fn main() {}
404399
~~~
405400

406401
Note that this feature is currently hidden behind the `feature(link_args)` gate
@@ -434,15 +429,13 @@ Foreign APIs often export a global variable which could do something like track
434429
global state. In order to access these variables, you declare them in `extern`
435430
blocks with the `static` keyword:
436431

437-
~~~
432+
~~~no_run
438433
extern crate libc;
439434
440435
#[link(name = "readline")]
441-
# #[cfg(ignore)]
442436
extern {
443437
static rl_readline_version: libc::c_int;
444438
}
445-
# static rl_readline_version: libc::c_int = 0;
446439
447440
fn main() {
448441
println!("You have readline version {} installed.",
@@ -454,16 +447,14 @@ Alternatively, you may need to alter global state provided by a foreign
454447
interface. To do this, statics can be declared with `mut` so rust can mutate
455448
them.
456449

457-
~~~
450+
~~~no_run
458451
extern crate libc;
459452
use std::ptr;
460453
461454
#[link(name = "readline")]
462-
# #[cfg(ignore)]
463455
extern {
464456
static mut rl_prompt: *libc::c_char;
465457
}
466-
# static mut rl_prompt: *libc::c_char = 0 as *libc::c_char;
467458
468459
fn main() {
469460
"[my-awesome-shell] $".with_c_str(|buf| {
@@ -488,7 +479,6 @@ extern crate libc;
488479
extern "stdcall" {
489480
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> libc::c_int;
490481
}
491-
492482
# fn main() { }
493483
~~~~
494484

src/doc/guide-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ fn stringifier(channel: &sync::DuplexStream<~str, uint>) {
488488
}
489489
}
490490
# }
491-
~~~~
491+
~~~
492492

493493
The implementation of `DuplexStream` supports both sending and
494494
receiving. The `stringifier` function takes a `DuplexStream` that can
@@ -530,7 +530,7 @@ assert!(from_child.recv() == "23".to_owned());
530530
assert!(from_child.recv() == "0".to_owned());
531531
532532
# }
533-
~~~~
533+
~~~
534534

535535
The parent task first calls `DuplexStream` to create a pair of bidirectional
536536
endpoints. It then uses `task::spawn` to create the child task, which captures

0 commit comments

Comments
 (0)