Skip to content

Commit 3fa6bc5

Browse files
Conflicts: src/librustc_back/archive.rs src/libsyntax/parse/parser.rs
2 parents 904ae6b + ade92c6 commit 3fa6bc5

File tree

140 files changed

+4879
-1982
lines changed

Some content is hidden

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

140 files changed

+4879
-1982
lines changed

.gitignore

Lines changed: 68 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,94 @@
1-
*~
2-
\#*\#
3-
\#*
4-
.#*
5-
*.x86
6-
*.llvm
7-
*.out
1+
*.a
2+
*.aux
3+
*.bc
84
*.boot
9-
*.rustc
5+
*.bz2
6+
*.cmi
7+
*.cmo
108
*.cmx
11-
*.dll
9+
*.cp
10+
*.cps
11+
*.d
12+
*.dSYM
1213
*.def
13-
*.exe
14-
*.a
15-
*.rlib
16-
*.so
14+
*.diff
15+
*.dll
1716
*.dylib
18-
*.orig
19-
*.cmo
20-
*.cmi
21-
*.dSYM
22-
*.d
23-
*.o
24-
*.ll
25-
*.bc
26-
*.aux
27-
*.cp
17+
*.elc
18+
*.epub
19+
*.exe
2820
*.fn
21+
*.html
2922
*.ky
30-
*.cps
23+
*.ll
24+
*.llvm
3125
*.log
26+
*.o
27+
*.orig
28+
*.out
29+
*.patch
3230
*.pdf
33-
*.epub
34-
*.html
3531
*.pg
36-
*.toc
37-
*.tp
38-
*.vr
39-
*.patch
40-
*.diff
32+
*.pot
33+
*.pyc
4134
*.rej
42-
*.swp
35+
*.rlib
36+
*.rustc
37+
*.so
4338
*.swo
39+
*.swp
4440
*.tmp
45-
*.pyc
46-
*.elc
41+
*.toc
42+
*.tp
43+
*.vr
44+
*.x86
45+
*~
46+
.#*
47+
.DS_Store
48+
.cproject
4749
.hg/
4850
.hgignore
49-
.cproject
5051
.project
52+
.settings/
5153
.valgrindrc
52-
lexer.ml
53-
TAGS
54-
TAGS.emacs
55-
TAGS.vi
56-
version.ml
57-
version.texi
54+
/*-*-*-*/
55+
/*-*-*/
5856
/Makefile
59-
config.mk
60-
/rt/
61-
/rustllvm/
62-
/test/
57+
/build
58+
/dist/
59+
/dl/
60+
/doc
6361
/inst/
62+
/llvm/
6463
/mingw-build/
65-
src/.DS_Store
66-
/tmp/
67-
/dist/
64+
/nd/
65+
/rt/
66+
/rustllvm/
67+
/src/libunicode/DerivedCoreProperties.txt
68+
/src/libunicode/EastAsianWidth.txt
69+
/src/libunicode/HangulSyllableType.txt
70+
/src/libunicode/PropList.txt
71+
/src/libunicode/Scripts.txt
72+
/src/libunicode/UnicodeData.txt
6873
/stage0/
69-
/dl/
7074
/stage1/
7175
/stage2/
7276
/stage3/
73-
*.bz2
74-
/doc
75-
/nd/
76-
/llvm/
77-
version.md
78-
keywords.md
79-
x86_64-apple-darwin/
80-
x86_64-unknown-linux-gnu/
81-
i686-unknown-linux-gnu/
82-
tmp.*.rs
77+
/test/
78+
/tmp/
79+
TAGS
80+
TAGS.emacs
81+
TAGS.vi
82+
\#*
83+
\#*\#
84+
config.mk
8385
config.stamp
84-
.DS_Store
86+
keywords.md
87+
lexer.ml
88+
src/.DS_Store
8589
src/etc/dl
86-
.settings/
87-
/build
88-
i686-pc-mingw32/
8990
src/librustc_llvm/llvmdeps.rs
90-
*.pot
91+
tmp.*.rs
92+
version.md
93+
version.ml
94+
version.texi

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 rust-pnacl-trans
@@ -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 log
7777
DEPS_rustc_back := std syntax rustc_llvm flate log libc
@@ -83,6 +83,7 @@ DEPS_arena := std
8383
DEPS_graphviz := std
8484
DEPS_glob := std
8585
DEPS_serialize := std log
86+
DEPS_rbml := std log serialize
8687
DEPS_term := std log
8788
DEPS_semver := std
8889
DEPS_uuid := std serialize
@@ -92,7 +93,7 @@ DEPS_collections := core alloc unicode
9293
DEPS_fourcc := rustc syntax std
9394
DEPS_hexfloat := rustc syntax std
9495
DEPS_num := std
95-
DEPS_test := std getopts serialize term time regex native:rust_test_helpers
96+
DEPS_test := std getopts serialize rbml term time regex native:rust_test_helpers
9697
DEPS_time := std serialize
9798
DEPS_rand := core
9899
DEPS_url := std

mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ doc/$(1)/:
285285
$(2) += doc/$(1)/index.html
286286
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
287287
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
288-
@$$(call E, rustdoc $$@)
288+
@$$(call E, rustdoc: $$@)
289289
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
290290
endef
291291

src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub struct Config {
136136
// Extra parameter to run adb on arm-linux-androideabi
137137
pub adb_path: String,
138138

139-
// Extra parameter to run test sute on arm-linux-androideabi
139+
// Extra parameter to run test suite on arm-linux-androideabi
140140
pub adb_test_dir: String,
141141

142142
// status whether android device available or not

src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
325325
let DebuggerCommands { commands, check_lines, .. } = parse_debugger_commands(testfile, "gdb");
326326
let mut cmds = commands.connect("\n");
327327

328-
// compile test file (it shoud have 'compile-flags:-g' in the header)
328+
// compile test file (it should have 'compile-flags:-g' in the header)
329329
let compiler_run_result = compile_test(config, props, testfile);
330330
if !compiler_run_result.status.success() {
331331
fatal_proc_rec("compilation failed!", &compiler_run_result);
@@ -625,7 +625,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
625625

626626
let config = &mut config;
627627

628-
// compile test file (it shoud have 'compile-flags:-g' in the header)
628+
// compile test file (it should have 'compile-flags:-g' in the header)
629629
let compile_result = compile_test(config, props, testfile);
630630
if !compile_result.status.success() {
631631
fatal_proc_rec("compilation failed!", &compile_result);

src/doc/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Design FAQ
1+
% The Rust Design FAQ
22

33
This document describes decisions were arrived at after lengthy discussion and
44
experimenting with alternatives. Please do not propose reversing them unless

src/doc/complement-lang-faq.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
% Language FAQ
2-
1+
% The Rust Language FAQ
32

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

@@ -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].
@@ -151,4 +162,15 @@ debugging linking in the compiler you might set
151162
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
152163
For a full description see [the logging crate][1].
153164

165+
## How fast is Rust?
166+
167+
As always, this question is difficult to answer. There's still a lot of work to
168+
do on speed, and depending on what you're benchmarking, Rust has variable
169+
performance.
170+
171+
That said, it is an explicit goal of Rust to be as fast as C++ for most things.
172+
Language decisions are made with performance in mind, and we want Rust to be as
173+
fast as possible. Given that Rust is built on top of LLVM, any performance
174+
improvements in it also help us be faster.
175+
154176
[1]:log/index.html

src/doc/complement-project-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Project FAQ
1+
% The Rust Project FAQ
22

33
# What is this project's goal, in one sentence?
44

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

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

src/doc/guide-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% The Strings Guide
1+
% The Guide to Rust Strings
22

33
Strings are an important concept to master in any programming language. If you
44
come from a managed language background, you may be surprised at the complexity

src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Writing Safe Unsafe and Low-Level Code
1+
% Writing Unsafe and Low-Level Code in Rust
22

33
# Introduction
44

0 commit comments

Comments
 (0)