Skip to content

Commit 58d2b2e

Browse files
committed
---
yaml --- r: 81887 b: refs/heads/master c: 41826c4 h: refs/heads/master i: 81885: 774ef04 81883: d229df3 81879: df8114c 81871: 49bfe9a 81855: a5a02cb v: v3
1 parent 0359dbe commit 58d2b2e

File tree

124 files changed

+6695
-725
lines changed

Some content is hidden

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

124 files changed

+6695
-725
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e82db13760096bd2193c55b8b4965d5519fe71fa
2+
refs/heads/master: 41826c48eddfb964b830229dff6f0480ac649827
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*.cpp rust
55
*.h rust
66
*.rs rust
7-
src/etc/pkg/rust-logo.ico binary
87
src/rt/msvc/* -whitespace
98
src/rt/vg/* -whitespace
109
src/rt/linenoise/* -whitespace

trunk/configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ do
684684
isaac linenoise sync test \
685685
arch/i386 arch/x86_64 arch/arm arch/mips \
686686
libuv libuv/src/ares libuv/src/eio libuv/src/ev \
687-
jemalloc
687+
jemalloc sundown/src sundown/html
688688
do
689689
make_dir $t/rt/stage$s/$i
690690
done
@@ -848,6 +848,8 @@ do
848848
# Disable term-info, linkage of which comes in multiple forms,
849849
# making our snapshots incompatible (#9334)
850850
LLVM_OPTS="$LLVM_OPTS --disable-terminfo"
851+
# Try to have LLVM pull in as few dependencies as possible (#9397)
852+
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
851853

852854
case "$CFG_C_COMPILER" in
853855
("ccache clang")

trunk/mk/rt.mk

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,16 @@ RUNTIME_CXXS_$(1)_$(2) := \
8282
rt/rust_android_dummy.cpp \
8383
rt/rust_test_helpers.cpp
8484

85-
RUNTIME_CS_$(1)_$(2) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
85+
RUNTIME_CS_$(1)_$(2) := rt/linenoise/linenoise.c \
86+
rt/linenoise/utf8.c \
87+
rt/sundown/src/autolink.c \
88+
rt/sundown/src/buffer.c \
89+
rt/sundown/src/stack.c \
90+
rt/sundown/src/markdown.c \
91+
rt/sundown/html/houdini_href_e.c \
92+
rt/sundown/html/houdini_html_e.c \
93+
rt/sundown/html/html_smartypants.c \
94+
rt/sundown/html/html.c
8695

8796
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
8897
rt/arch/$$(HOST_$(1))/ccall.S \
@@ -117,6 +126,8 @@ RUNTIME_DEF_$(1)_$(2) := $$(RT_OUTPUT_DIR_$(1))/rustrt$$(CFG_DEF_SUFFIX_$(1))
117126
RUNTIME_INCS_$(1)_$(2) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
118127
-I $$(S)src/rt/arch/$$(HOST_$(1)) \
119128
-I $$(S)src/rt/linenoise \
129+
-I $$(S)src/rt/sundown/src \
130+
-I $$(S)src/rt/sundown/html \
120131
-I $$(S)src/libuv/include
121132
RUNTIME_OBJS_$(1)_$(2) := $$(RUNTIME_CXXS_$(1)_$(2):rt/%.cpp=$$(RT_BUILD_DIR_$(1)_$(2))/%.o) \
122133
$$(RUNTIME_CS_$(1)_$(2):rt/%.c=$$(RT_BUILD_DIR_$(1)_$(2))/%.o) \

trunk/mk/tests.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,9 @@ ALL_CS := $(wildcard $(S)src/rt/*.cpp \
227227
$(S)src/rt/*/*/*.cpp \
228228
$(S)src/rustllvm/*.cpp)
229229
ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
230-
$(S)src/rt/linenoise/linenoise.c \
231-
$(S)src/rt/linenoise/utf8.c \
230+
$(wildcard $(S)src/rt/linenoise/*.c) \
231+
$(wildcard $(S)src/rt/sundown/src/*.c) \
232+
$(wildcard $(S)src/rt/sundown/html/*.c) \
232233
,$(ALL_CS))
233234
ALL_HS := $(wildcard $(S)src/rt/*.h \
234235
$(S)src/rt/*/*.h \
@@ -241,6 +242,8 @@ ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
241242
$(S)src/rt/msvc/inttypes.h \
242243
$(S)src/rt/linenoise/linenoise.h \
243244
$(S)src/rt/linenoise/utf8.h \
245+
$(wildcard $(S)src/rt/sundown/src/*.h) \
246+
$(wildcard $(S)src/rt/sundown/html/*.h) \
244247
,$(ALL_HS))
245248

246249
# Run the tidy script in multiple parts to avoid huge 'echo' commands

trunk/src/etc/pkg/rust-logo.ico

-2 Bytes
Binary file not shown.

trunk/src/libextra/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* In this example, a large vector of floats is shared between several tasks.
1818
* With simple pipes, without Arc, a copy would have to be made for each task.
1919
*
20-
* ~~~ {.rust}
20+
* ```rust
2121
* extern mod std;
2222
* use extra::arc;
2323
* let numbers=vec::from_fn(100, |ind| (ind as float)*rand::random());
@@ -34,7 +34,7 @@
3434
* // Work with the local numbers
3535
* }
3636
* }
37-
* ~~~
37+
* ```
3838
*/
3939

4040
#[allow(missing_doc)];
@@ -440,7 +440,7 @@ impl<T:Freeze + Send> RWArc<T> {
440440
*
441441
* # Example
442442
*
443-
* ~~~ {.rust}
443+
* ```rust
444444
* do arc.write_downgrade |mut write_token| {
445445
* do write_token.write_cond |state, condvar| {
446446
* ... exclusive access with mutable state ...
@@ -450,7 +450,7 @@ impl<T:Freeze + Send> RWArc<T> {
450450
* ... shared access with immutable state ...
451451
* }
452452
* }
453-
* ~~~
453+
* ```
454454
*/
455455
pub fn write_downgrade<U>(&self, blk: &fn(v: RWWriteMode<T>) -> U) -> U {
456456
unsafe {

trunk/src/libextra/base64.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ impl<'self> ToBase64 for &'self [u8] {
6262
*
6363
* # Example
6464
*
65-
* ~~~ {.rust}
65+
* ```rust
6666
* extern mod extra;
6767
* use extra::base64::{ToBase64, standard};
6868
*
6969
* fn main () {
7070
* let str = [52,32].to_base64(standard);
7171
* printfln!("%s", str);
7272
* }
73-
* ~~~
73+
* ```
7474
*/
7575
fn to_base64(&self, config: Config) -> ~str {
7676
let bytes = match config.char_set {
@@ -170,7 +170,7 @@ impl<'self> FromBase64 for &'self str {
170170
*
171171
* This converts a string literal to base64 and back.
172172
*
173-
* ~~~ {.rust}
173+
* ```rust
174174
* extern mod extra;
175175
* use extra::base64::{ToBase64, FromBase64, standard};
176176
* use std::str;
@@ -183,7 +183,7 @@ impl<'self> FromBase64 for &'self str {
183183
* let result_str = str::from_utf8(bytes);
184184
* printfln!("%s", result_str);
185185
* }
186-
* ~~~
186+
* ```
187187
*/
188188
fn from_base64(&self) -> Result<~[u8], ~str> {
189189
let mut r = ~[];

trunk/src/libextra/crypto/cryptoutil.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ mod test {
352352

353353
use cryptoutil::{add_bytes_to_bits, add_bytes_to_bits_tuple};
354354
use digest::Digest;
355+
use hex::FromHex;
355356

356357
/// Feed 1,000,000 'a's into the digest with varying input sizes and check that the result is
357358
/// correct.
@@ -372,8 +373,10 @@ mod test {
372373
}
373374

374375
let result_str = digest.result_str();
376+
let result_bytes = digest.result_bytes();
375377

376-
assert!(expected == result_str);
378+
assert_eq!(expected, result_str.as_slice());
379+
assert_eq!(expected.from_hex().unwrap(), result_bytes);
377380
}
378381

379382
// A normal addition - no overflow occurs

trunk/src/libextra/crypto/digest.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
use std::vec;
1212

13+
use hex::ToHex;
14+
1315

1416
/**
1517
* The Digest trait specifies an interface common to digest functions, such as SHA-1 and the SHA-2
@@ -58,23 +60,20 @@ pub trait Digest {
5860

5961
/**
6062
* Convenience function that retrieves the result of a digest as a
61-
* ~str in hexadecimal format.
63+
* newly allocated vec of bytes.
6264
*/
63-
fn result_str(&mut self) -> ~str {
65+
fn result_bytes(&mut self) -> ~[u8] {
6466
let mut buf = vec::from_elem((self.output_bits()+7)/8, 0u8);
6567
self.result(buf);
66-
return to_hex(buf);
68+
buf
6769
}
68-
}
6970

70-
fn to_hex(rr: &[u8]) -> ~str {
71-
let mut s = ~"";
72-
for b in rr.iter() {
73-
let hex = (*b as uint).to_str_radix(16u);
74-
if hex.len() == 1 {
75-
s.push_char('0');
76-
}
77-
s.push_str(hex);
71+
/**
72+
* Convenience function that retrieves the result of a digest as a
73+
* ~str in hexadecimal format.
74+
*/
75+
fn result_str(&mut self) -> ~str {
76+
self.result_bytes().to_hex()
7877
}
79-
return s;
8078
}
79+

trunk/src/libextra/extra.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Rust extras are part of the standard Rust distribution.
2626
url = "https://github.com/mozilla/rust/tree/master/src/libextra")];
2727

2828
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
29-
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
30-
passes = "strip-hidden")];
29+
html_favicon_url = "http://www.rust-lang.org/favicon.ico")];
3130

3231
#[comment = "Rust extras"];
3332
#[license = "MIT/ASL2"];

trunk/src/libextra/flatpipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ports and channels.
2525
2626
This example sends boxed integers across tasks using serialization.
2727
28-
~~~ {.rust}
28+
```rust
2929
let (port, chan) = serial::pipe_stream();
3030
3131
do task::spawn || {
@@ -37,7 +37,7 @@ do task::spawn || {
3737
for i in range(0, 10) {
3838
assert @i == port.recv()
3939
}
40-
~~~
40+
```
4141
4242
# Safety Note
4343

trunk/src/libextra/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
*
1515
* # Example
1616
*
17-
* ~~~ {.rust}
17+
* ```rust
1818
* # fn fib(n: uint) -> uint {42};
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
2222
* printfln!("fib(5000) = %?", delayed_fib.get())
23-
* ~~~
23+
* ```
2424
*/
2525

2626
#[allow(missing_doc)];

trunk/src/libextra/getopts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//! that requires an input file to be specified, accepts an optional output
3030
//! file name following -o, and accepts both -h and --help as optional flags.
3131
//!
32-
//! ```
32+
//! ~~~{.rust}
3333
//! exter mod extra;
3434
//! use extra::getopts::*;
3535
//! use std::os;
@@ -75,7 +75,7 @@
7575
//! };
7676
//! do_work(input, output);
7777
//! }
78-
//! ```
78+
//! ~~~
7979
8080
use std::cmp::Eq;
8181
use std::result::{Err, Ok};

trunk/src/libextra/glob.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ pub struct GlobIterator {
5151
* Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
5252
* `puppies.jpg` and `hamsters.gif`:
5353
*
54-
* ~~~ {.rust}
54+
* ```rust
5555
* for path in glob("/media/pictures/*.jpg") {
5656
* println(path.to_str());
5757
* }
58-
* ~~~
58+
* ```
5959
*
6060
* The above code will print:
6161
*
62-
* ~~~
62+
* ```
6363
* /media/pictures/kittens.jpg
6464
* /media/pictures/puppies.jpg
65-
* ~~~
65+
* ```
6666
*/
6767
pub fn glob(pattern: &str) -> GlobIterator {
6868
glob_with(pattern, MatchOptions::new())
@@ -270,11 +270,11 @@ impl Pattern {
270270
*
271271
* # Example
272272
*
273-
* ~~~ {.rust}
273+
* ```rust
274274
* assert!(Pattern::new("c?t").matches("cat"));
275275
* assert!(Pattern::new("k[!e]tteh").matches("kitteh"));
276276
* assert!(Pattern::new("d*g").matches("doog"));
277-
* ~~~
277+
* ```
278278
*/
279279
pub fn matches(&self, str: &str) -> bool {
280280
self.matches_with(str, MatchOptions::new())
@@ -492,13 +492,13 @@ impl MatchOptions {
492492
*
493493
* This function always returns this value:
494494
*
495-
* ~~~ {.rust}
495+
* ```rust
496496
* MatchOptions {
497497
* case_sensitive: true,
498498
* require_literal_separator: false.
499499
* require_literal_leading_dot: false
500500
* }
501-
* ~~~
501+
* ```
502502
*/
503503
pub fn new() -> MatchOptions {
504504
MatchOptions {

trunk/src/libextra/hex.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ impl<'self> ToHex for &'self [u8] {
2727
*
2828
* # Example
2929
*
30-
* ~~~ {.rust}
30+
* ```rust
3131
* extern mod extra;
3232
* use extra::hex::ToHex;
3333
*
3434
* fn main () {
3535
* let str = [52,32].to_hex();
3636
* printfln!("%s", str);
3737
* }
38-
* ~~~
38+
* ```
3939
*/
4040
fn to_hex(&self) -> ~str {
4141
let mut v = vec::with_capacity(self.len() * 2);
@@ -70,7 +70,7 @@ impl<'self> FromHex for &'self str {
7070
*
7171
* This converts a string literal to hexadecimal and back.
7272
*
73-
* ~~~ {.rust}
73+
* ```rust
7474
* extern mod extra;
7575
* use extra::hex::{FromHex, ToHex};
7676
* use std::str;
@@ -83,7 +83,7 @@ impl<'self> FromHex for &'self str {
8383
* let result_str = str::from_utf8(bytes);
8484
* printfln!("%s", result_str);
8585
* }
86-
* ~~~
86+
* ```
8787
*/
8888
fn from_hex(&self) -> Result<~[u8], ~str> {
8989
// This may be an overestimate if there is any whitespace

trunk/src/libextra/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl RWLock {
578578
*
579579
* # Example
580580
*
581-
* ~~~ {.rust}
581+
* ```rust
582582
* do lock.write_downgrade |mut write_token| {
583583
* do write_token.write_cond |condvar| {
584584
* ... exclusive access ...
@@ -588,7 +588,7 @@ impl RWLock {
588588
* ... shared access ...
589589
* }
590590
* }
591-
* ~~~
591+
* ```
592592
*/
593593
pub fn write_downgrade<U>(&self, blk: &fn(v: RWLockWriteMode) -> U) -> U {
594594
// Implementation slightly different from the slicker 'write's above.

0 commit comments

Comments
 (0)