Skip to content

Commit b9edec1

Browse files
committed
---
yaml --- r: 126180 b: refs/heads/auto c: 6136381 h: refs/heads/master v: v3
1 parent 574acd9 commit b9edec1

File tree

173 files changed

+4811
-2192
lines changed

Some content is hidden

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

173 files changed

+4811
-2192
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 5d4d09daf2e8e46839647d4e72b1cbefebad6ece
16+
refs/heads/auto: 6136381ed86189a027e641d233a1296ff8b60679
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ case $CFG_OSTYPE in
291291
CFG_OSTYPE=unknown-freebsd
292292
;;
293293

294+
DragonFly)
295+
CFG_OSTYPE=unknown-dragonfly
296+
;;
297+
294298
Darwin)
295299
CFG_OSTYPE=apple-darwin
296300
;;

branches/auto/mk/crates.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
url log regex graphviz core rlibc alloc debug rustrt \
54+
url log regex graphviz core rbml rlibc alloc debug rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros \
5757
rustc_llvm rustc_back
@@ -71,7 +71,7 @@ DEPS_green := std native:context_switch
7171
DEPS_rustuv := std native:uv native:uv_support
7272
DEPS_native := std
7373
DEPS_syntax := std term serialize log fmt_macros debug
74-
DEPS_rustc := syntax flate arena serialize getopts \
74+
DEPS_rustc := syntax flate arena serialize getopts rbml \
7575
time log graphviz debug rustc_llvm rustc_back
7676
DEPS_rustc_llvm := native:rustllvm libc std
7777
DEPS_rustc_back := std syntax rustc_llvm flate log libc
@@ -82,6 +82,7 @@ DEPS_arena := std
8282
DEPS_graphviz := std
8383
DEPS_glob := std
8484
DEPS_serialize := std log
85+
DEPS_rbml := std log serialize
8586
DEPS_term := std log
8687
DEPS_semver := std
8788
DEPS_uuid := std serialize
@@ -91,7 +92,7 @@ DEPS_collections := core alloc unicode
9192
DEPS_fourcc := rustc syntax std
9293
DEPS_hexfloat := rustc syntax std
9394
DEPS_num := std
94-
DEPS_test := std getopts serialize term time regex native:rust_test_helpers
95+
DEPS_test := std getopts serialize rbml term time regex native:rust_test_helpers
9596
DEPS_time := std serialize
9697
DEPS_rand := core
9798
DEPS_url := std

branches/auto/mk/platform.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,33 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
580580
CFG_RUN_x86_64-unknown-freebsd=$(2)
581581
CFG_RUN_TARG_x86_64-unknown-freebsd=$(call CFG_RUN_x86_64-unknown-freebsd,,$(2))
582582

583+
# x86_64-pc-dragonfly-elf configuration
584+
CC_x86_64-unknown-dragonfly=$(CC)
585+
CXX_x86_64-unknown-dragonfly=$(CXX)
586+
CPP_x86_64-unknown-dragonfly=$(CPP)
587+
AR_x86_64-unknown-dragonfly=$(AR)
588+
CFG_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).so
589+
CFG_STATIC_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).a
590+
CFG_LIB_GLOB_x86_64-unknown-dragonfly=lib$(1)-*.so
591+
CFG_LIB_DSYM_GLOB_x86_64-unknown-dragonfly=$(1)-*.dylib.dSYM
592+
CFG_CFLAGS_x86_64-unknown-dragonfly := -I/usr/include -I/usr/local/include $(CFLAGS)
593+
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -I/usr/include -I/usr/local/include $(CFLAGS)
594+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt
595+
CFG_GCCISH_DEF_FLAG_x86_64-unknown-dragonfly := -Wl,--export-dynamic,--dynamic-list=
596+
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-whole-archive
597+
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-no-whole-archive
598+
CFG_DEF_SUFFIX_x86_64-unknown-dragonfly := .bsd.def
599+
CFG_LLC_FLAGS_x86_64-unknown-dragonfly :=
600+
CFG_INSTALL_NAME_x86_64-unknown-dragonfly =
601+
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-dragonfly := -pthread -lkvm
602+
CFG_EXE_SUFFIX_x86_64-unknown-dragonfly :=
603+
CFG_WINDOWSY_x86_64-unknown-dragonfly :=
604+
CFG_UNIXY_x86_64-unknown-dragonfly := 1
605+
CFG_PATH_MUNGE_x86_64-unknown-dragonfly :=
606+
CFG_LDPATH_x86_64-unknown-dragonfly :=
607+
CFG_RUN_x86_64-unknown-dragonfly=$(2)
608+
CFG_RUN_TARG_x86_64-unknown-dragonfly=$(call CFG_RUN_x86_64-unknown-dragonfly,,$(2))
609+
583610

584611
# The -Qunused-arguments sidesteps spurious warnings from clang
585612
define FILTER_FLAGS

branches/auto/mk/rt.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ else ifeq ($(OSTYPE_$(1)), apple-ios)
171171
JEMALLOC_ARGS_$(1) := --disable-tls
172172
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
173173
LIBUV_OSTYPE_$(1) := freebsd
174+
else ifeq ($(OSTYPE_$(1)), unknown-dragonfly)
175+
LIBUV_OSTYPE_$(1) := freebsd
176+
# required on DragonFly, otherwise gyp fails with a Python exception
177+
LIBUV_GYP_ARGS_$(1) := --no-parallel
174178
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
175179
LIBUV_OSTYPE_$(1) := android
176180
LIBUV_ARGS_$(1) := PLATFORM=android host=android OS=linux
@@ -202,7 +206,7 @@ $$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
202206
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
203207
-D ninja \
204208
-DOS=$$(LIBUV_OSTYPE_$(1)) \
205-
-Goutput_dir=$$(@D) --generator-output $$(@D))
209+
-Goutput_dir=$$(@D) $$(LIBUV_GYP_ARGS_$(1)) --generator-output $$(@D))
206210
touch $$@
207211

208212
# Windows has a completely different build system for libuv because of mingw. In

branches/auto/src/compiletest/header.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ pub struct TestProps {
3636
pub no_prefer_dynamic: bool,
3737
// Don't run --pretty expanded when running pretty printing tests
3838
pub no_pretty_expanded: bool,
39+
// Which pretty mode are we testing with, default to 'normal'
40+
pub pretty_mode: String,
41+
// Only compare pretty output and don't try compiling
42+
pub pretty_compare_only: bool,
3943
}
4044

4145
// Load any test directives embedded in the file
@@ -51,6 +55,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
5155
let mut check_stdout = false;
5256
let mut no_prefer_dynamic = false;
5357
let mut no_pretty_expanded = false;
58+
let mut pretty_mode = None;
59+
let mut pretty_compare_only = false;
5460
iter_header(testfile, |ln| {
5561
match parse_error_pattern(ln) {
5662
Some(ep) => error_patterns.push(ep),
@@ -85,6 +91,14 @@ pub fn load_props(testfile: &Path) -> TestProps {
8591
no_pretty_expanded = parse_no_pretty_expanded(ln);
8692
}
8793

94+
if pretty_mode.is_none() {
95+
pretty_mode = parse_pretty_mode(ln);
96+
}
97+
98+
if !pretty_compare_only {
99+
pretty_compare_only = parse_pretty_compare_only(ln);
100+
}
101+
88102
match parse_aux_build(ln) {
89103
Some(ab) => { aux_builds.push(ab); }
90104
None => {}
@@ -115,6 +129,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
115129
check_stdout: check_stdout,
116130
no_prefer_dynamic: no_prefer_dynamic,
117131
no_pretty_expanded: no_pretty_expanded,
132+
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
133+
pretty_compare_only: pretty_compare_only
118134
}
119135
}
120136

@@ -205,6 +221,14 @@ fn parse_no_pretty_expanded(line: &str) -> bool {
205221
parse_name_directive(line, "no-pretty-expanded")
206222
}
207223

224+
fn parse_pretty_mode(line: &str) -> Option<String> {
225+
parse_name_value_directive(line, "pretty-mode")
226+
}
227+
228+
fn parse_pretty_compare_only(line: &str) -> bool {
229+
parse_name_directive(line, "pretty-compare-only")
230+
}
231+
208232
fn parse_exec_env(line: &str) -> Option<(String, String)> {
209233
parse_name_value_directive(line, "exec-env").map(|nv| {
210234
// nv is either FOO or FOO=BAR

branches/auto/src/compiletest/runtest.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
168168
props,
169169
testfile,
170170
srcs[round].to_string(),
171-
"normal");
171+
props.pretty_mode.as_slice());
172172

173173
if !proc_res.status.success() {
174174
fatal_proc_rec(format!("pretty-printing failed in round {}",
@@ -200,6 +200,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
200200

201201
compare_source(expected.as_slice(), actual.as_slice());
202202

203+
// If we're only making sure that the output matches then just stop here
204+
if props.pretty_compare_only { return; }
205+
203206
// Finally, let's make sure it actually appears to remain valid code
204207
let proc_res = typecheck_source(config, props, testfile, actual);
205208

@@ -834,6 +837,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
834837
#[cfg(target_os = "linux")]
835838
#[cfg(target_os = "macos")]
836839
#[cfg(target_os = "freebsd")]
840+
#[cfg(target_os = "dragonfly")]
837841
fn prefix_matches( line : &str, prefix : &str ) -> bool {
838842
line.starts_with( prefix )
839843
}
@@ -1237,6 +1241,7 @@ fn program_output(config: &Config, testfile: &Path, lib_path: &str, prog: String
12371241
#[cfg(target_os = "linux")]
12381242
#[cfg(target_os = "macos")]
12391243
#[cfg(target_os = "freebsd")]
1244+
#[cfg(target_os = "dragonfly")]
12401245
fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12411246
format!("{} {}", prog, args.connect(" "))
12421247
}

branches/auto/src/compiletest/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
2121
("android", "android"),
2222
("linux", "linux"),
2323
("freebsd", "freebsd"),
24+
("dragonfly", "dragonfly"),
2425
];
2526

2627
pub fn get_os(triple: &str) -> &'static str {

branches/auto/src/doc/complement-lang-faq.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
% Language FAQ
22

3-
43
## Are there any big programs written in it yet? I want to read big samples.
54

65
There aren't many large programs yet. The Rust [compiler][rustc], 60,000+ lines at the time of writing, is written in Rust. As the oldest body of Rust code it has gone through many iterations of the language, and some parts are nicer to look at than others. It may not be the best code to learn from, but [borrowck] and [resolve] were written recently.
@@ -29,6 +28,18 @@ You may also be interested in browsing [GitHub's Rust][github-rust] page.
2928

3029
[github-rust]: https://github.com/trending?l=rust
3130

31+
## Is anyone using Rust in production?
32+
33+
Currently, Rust is still pre-1.0, and so we don't recommend that you use Rust
34+
in production unless you know exactly what you're getting into.
35+
36+
That said, there are two production deployments of Rust that we're aware of:
37+
38+
* [OpenDNS](http://labs.opendns.com/2013/10/04/zeromq-helping-us-block-malicious-domains/)
39+
* [Skylight](http://skylight.io)
40+
41+
Let the fact that this is an easily countable number be a warning.
42+
3243
## Does it run on Windows?
3344

3445
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular 64-bit build is [not fully supported yet][win64], and all executables created by rustc [depend on libgcc DLL at runtime][libgcc].

branches/auto/src/doc/guide-lifetimes.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -431,36 +431,6 @@ In any case, whatever the lifetime of `r` is, the pointer produced by
431431
field of a struct is valid as long as the struct is valid. Therefore,
432432
the compiler accepts the function `get_x()`.
433433

434-
To emphasize this point, let’s look at a variation on the example, this
435-
time one that does not compile:
436-
437-
~~~ {.ignore}
438-
struct Point {x: f64, y: f64}
439-
fn get_x_sh(p: &Point) -> &f64 {
440-
&p.x // Error reported here
441-
}
442-
~~~
443-
444-
Here, the function `get_x_sh()` takes a reference as input and
445-
returns a reference. As before, the lifetime of the reference
446-
that will be returned is a parameter (specified by the
447-
caller). That means that `get_x_sh()` promises to return a reference
448-
that is valid for as long as the caller would like: this is
449-
subtly different from the first example, which promised to return a
450-
pointer that was valid for as long as its pointer argument was valid.
451-
452-
Within `get_x_sh()`, we see the expression `&p.x` which takes the
453-
address of a field of a Point. The presence of this expression
454-
implies that the compiler must guarantee that , so long as the
455-
resulting pointer is valid, the original Point won't be moved or changed.
456-
457-
But recall that `get_x_sh()` also promised to
458-
return a pointer that was valid for as long as the caller wanted it to
459-
be. Clearly, `get_x_sh()` is not in a position to make both of these
460-
guarantees; in fact, it cannot guarantee that the pointer will remain
461-
valid at all once it returns, as the parameter `p` may or may not be
462-
live in the caller. Therefore, the compiler will report an error here.
463-
464434
In general, if you borrow a struct or box to create a
465435
reference, it will only be valid within the function
466436
and cannot be returned. This is why the typical way to return references

branches/auto/src/doc/guide-pointers.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,12 @@ fn main() {
578578

579579
Notice we changed the signature of `add_one()` to request a mutable reference.
580580

581-
# Best practices
581+
## Best practices
582582

583583
Boxes are appropriate to use in two situations: Recursive data structures,
584584
and occasionally, when returning data.
585585

586-
## Recursive data structures
586+
### Recursive data structures
587587

588588
Sometimes, you need a recursive data structure. The simplest is known as a
589589
'cons list':
@@ -615,7 +615,7 @@ we don't know the size, and therefore, we need to heap allocate our list.
615615
Working with recursive or other unknown-sized data structures is the primary
616616
use-case for boxes.
617617

618-
## Returning data
618+
### Returning data
619619

620620
This is important enough to have its own section entirely. The TL;DR is this:
621621
you don't generally want to return pointers, even when you might in a language
@@ -733,18 +733,15 @@ This part is coming soon.
733733

734734
Here's a quick rundown of Rust's pointer types:
735735

736-
| Type | Name | Summary |
737-
|--------------|---------------------|-------------------------------------------|
738-
| `&T` | Reference | Allows one or more references to read `T` |
739-
| `&mut T` | Mutable Reference | Allows a single reference to |
740-
| | | read and write `T` |
741-
| `Box<T>` | Box | Heap allocated `T` with a single owner |
742-
| | | that may read and write `T`. |
743-
| `Rc<T>` | "arr cee" pointer | Heap allocated `T` with many readers |
744-
| `Arc<T>` | Arc pointer | Same as above, but safe sharing across |
745-
| | | threads |
746-
| `*const T` | Raw pointer | Unsafe read access to `T` |
747-
| `*mut T` | Mutable raw pointer | Unsafe read and write access to `T` |
736+
| Type | Name | Summary |
737+
|--------------|---------------------|---------------------------------------------------------------------|
738+
| `&T` | Reference | Allows one or more references to read `T` |
739+
| `&mut T` | Mutable Reference | Allows a single reference to read and write `T` |
740+
| `Box<T>` | Box | Heap allocated `T` with a single owner that may read and write `T`. |
741+
| `Rc<T>` | "arr cee" pointer | Heap allocated `T` with many readers |
742+
| `Arc<T>` | Arc pointer | Same as above, but safe sharing across threads |
743+
| `*const T` | Raw pointer | Unsafe read access to `T` |
744+
| `*mut T` | Mutable raw pointer | Unsafe read and write access to `T` |
748745

749746
# Related resources
750747

branches/auto/src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ as that for which this documentation was generated.*
8484

8585
* [Reddit](http://reddit.com/r/rust)
8686
* [Stack Overflow](http://stackoverflow.com/questions/tagged/rust)
87+
* [Developer Forum](http://discuss.rust-lang.org/)
8788
* The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/):
8889
* [`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - general discussion
8990
* [`#rust-gamedev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev) - game development

branches/auto/src/doc/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ int add_one(void)
3636
}
3737
```
3838
39-
**Note: obviously this is very simple and non-idiomatic C++.
40-
You wouldn't write it in practice; it is for illustrative purposes.**
39+
**Note: The above C++ code is deliberately simple and non-idiomatic for the purpose
40+
of demonstration. It is not representative of production-quality C++ code.**
4141
4242
This function allocates an integer on the stack,
4343
and stores it in a variable, `i`.

0 commit comments

Comments
 (0)