Skip to content

Commit 1df4fdd

Browse files
committed
---
yaml --- r: 218233 b: refs/heads/master c: 9f4d5b4 h: refs/heads/master i: 218231: 7d974d2 v: v3
1 parent 6434cf3 commit 1df4fdd

Some content is hidden

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

81 files changed

+889
-2292
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: afe25a2d6aaa308cce861fab50014f6a9f57a269
2+
refs/heads/master: 9f4d5b4be10ce9683569a0bd55f555d30f70b5a5
33
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/CONTRIBUTING.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,6 @@ feature. We use the 'fork and pull' model described there.
8383

8484
Please make pull requests against the `master` branch.
8585

86-
Compiling all of `make check` can take a while. When testing your pull request,
87-
consider using one of the more specialized `make` targets to cut down on the
88-
amount of time you have to wait. You need to have built the compiler at least
89-
once before running these will work, but that’s only one full build rather than
90-
one each time.
91-
92-
$ make -j8 rustc-stage1 && make check-stage1
93-
94-
is one such example, which builds just `rustc`, and then runs the tests. If
95-
you’re adding something to the standard library, try
96-
97-
$ make -j8 check-stage1-std NO_REBUILD=1
98-
99-
This will not rebuild the compiler, but will run the tests.
100-
10186
All pull requests are reviewed by another person. We have a bot,
10287
@rust-highfive, that will automatically assign a random person to review your
10388
request.
@@ -123,10 +108,6 @@ will run all the tests on every platform we support. If it all works out,
123108

124109
[merge-queue]: http://buildbot.rust-lang.org/homu/queue/rust
125110

126-
Speaking of tests, Rust has a comprehensive test suite. More information about
127-
it can be found
128-
[here](https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md).
129-
130111
## Writing Documentation
131112

132113
Documentation improvements are very welcome. The source of `doc.rust-lang.org`

trunk/mk/main.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
295295
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
296296
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
297297
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
298+
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
298299
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
299300
ifeq ($$(findstring freebsd,$(1)),freebsd)
300301
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

trunk/mk/target.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,11 @@ endef
249249

250250
$(foreach host,$(CFG_HOST), \
251251
$(foreach target,$(CFG_TARGET), \
252-
$(foreach crate,$(CRATES), \
253-
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,0,$(target),$(host),$(crate))))))
252+
$(foreach stage,$(STAGES), \
253+
$(foreach crate,$(CRATES), \
254+
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,$(stage),$(target),$(host),$(crate)))))))
254255
$(foreach host,$(CFG_HOST), \
255256
$(foreach target,$(CFG_TARGET), \
256-
$(foreach tool,$(TOOLS), \
257-
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,0,$(target),$(host),$(tool))))))
257+
$(foreach stage,$(STAGES), \
258+
$(foreach tool,$(TOOLS), \
259+
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,$(stage),$(target),$(host),$(tool)))))))

trunk/src/compiletest/runtest.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,11 +1702,8 @@ fn run_codegen_test(config: &Config, props: &TestProps, testfile: &Path) {
17021702
}
17031703

17041704
fn charset() -> &'static str {
1705-
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
1706-
if cfg!(target_os = "bitrig") {
1705+
if cfg!(any(target_os = "bitrig", target_os = "freebsd")) {
17071706
"auto"
1708-
} else if cfg!(target_os = "freebsd") {
1709-
"ISO-8859-1"
17101707
} else {
17111708
"UTF-8"
17121709
}

trunk/src/doc/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Second, it makes cost explicit. In general, the only safe way to have a
9999
non-exhaustive match would be to panic the thread if nothing is matched, though
100100
it could fall through if the type of the `match` expression is `()`. This sort
101101
of hidden cost and special casing is against the language's philosophy. It's
102-
easy to ignore all unspecified cases by using the `_` wildcard:
102+
easy to ignore certain cases by using the `_` wildcard:
103103

104104
```rust,ignore
105105
match val.do_something() {

trunk/src/doc/reference.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,8 +2515,9 @@ Here are some examples:
25152515
#### Moved and copied types
25162516

25172517
When a [local variable](#variables) is used as an
2518-
[rvalue](#lvalues,-rvalues-and-temporaries), the variable will be copied
2519-
if its type implements `Copy`. All others are moved.
2518+
[rvalue](#lvalues,-rvalues-and-temporaries) the variable will either be moved
2519+
or copied, depending on its type. All values whose type implements `Copy` are
2520+
copied, all others are moved.
25202521

25212522
### Literal expressions
25222523

@@ -2881,6 +2882,7 @@ operand.
28812882
```
28822883
# let mut x = 0;
28832884
# let y = 0;
2885+
28842886
x = y;
28852887
```
28862888

trunk/src/doc/trpl/concurrency.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ system is up to the task, and gives you powerful ways to reason about
1010
concurrent code at compile time.
1111

1212
Before we talk about the concurrency features that come with Rust, it's important
13-
to understand something: Rust is low-level enough that the vast majority of
14-
this is provided by the standard library, not by the language. This means that
15-
if you don't like some aspect of the way Rust handles concurrency, you can
16-
implement an alternative way of doing things.
17-
[mio](https://github.com/carllerche/mio) is a real-world example of this
18-
principle in action.
13+
to understand something: Rust is low-level enough that all of this is provided
14+
by the standard library, not by the language. This means that if you don't like
15+
some aspect of the way Rust handles concurrency, you can implement an alternative
16+
way of doing things. [mio](https://github.com/carllerche/mio) is a real-world
17+
example of this principle in action.
1918

2019
## Background: `Send` and `Sync`
2120

trunk/src/doc/trpl/ffi.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,19 @@ attribute turns off Rust's name mangling, so that it is easier to link to.
533533

534534
# FFI and panics
535535

536-
It’s important to be mindful of `panic!`s when working with FFI. A `panic!`
537-
across an FFI boundary is undefined behavior. If you’re writing code that may
538-
panic, you should run it in another thread, so that the panic doesn’t bubble up
539-
to C:
536+
It’s important to be mindful of `panic!`s when working with FFI. This code,
537+
when called from C, will `abort`:
538+
539+
```rust
540+
#[no_mangle]
541+
pub extern fn oh_no() -> ! {
542+
panic!("Oops!");
543+
}
544+
# fn main() {}
545+
```
546+
547+
If you’re writing code that may panic, you should run it in another thread,
548+
so that the panic doesn’t bubble up to C:
540549

541550
```rust
542551
use std::thread;

trunk/src/doc/trpl/guessing-game.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,10 @@ rand="0.3.0"
360360
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
361361
everything that follows it is part of it, until the next section starts.
362362
Cargo uses the dependencies section to know what dependencies on external
363-
crates you have, and what versions you require. In this case, we’ve specified version `0.3.0`,
364-
which Cargo understands to be any release that’s compatible with this specific version.
363+
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
365364
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
366-
numbers. If we wanted to use only `0.3.0` exactly, we could use `=0.3.0`. If we
367-
wanted to use the latest version we could use `*`; We could use a range of
368-
versions. [Cargo’s documentation][cargodoc] contains more details.
365+
numbers. If we wanted to use the latest version we could use `*` or we could use a range
366+
of versions. [Cargo’s documentation][cargodoc] contains more details.
369367

370368
[semver]: http://semver.org
371369
[cargodoc]: http://doc.crates.io/crates-io.html

trunk/src/doc/trpl/lifetimes.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ the lifetime `'a` has snuck in between the `&` and the `mut i32`. We read `&mut
101101
i32` as ‘a mutable reference to an i32’ and `&'a mut i32` as ‘a mutable
102102
reference to an `i32` with the lifetime `'a`’.
103103

104-
# In `struct`s
105-
106104
You’ll also need explicit lifetimes when working with [`struct`][structs]s:
107105

108106
```rust
@@ -139,33 +137,6 @@ x: &'a i32,
139137
uses it. So why do we need a lifetime here? We need to ensure that any reference
140138
to a `Foo` cannot outlive the reference to an `i32` it contains.
141139

142-
## `impl` blocks
143-
144-
Let’s implement a method on `Foo`:
145-
146-
```rust
147-
struct Foo<'a> {
148-
x: &'a i32,
149-
}
150-
151-
impl<'a> Foo<'a> {
152-
fn x(&self) -> &'a i32 { self.x }
153-
}
154-
155-
fn main() {
156-
let y = &5; // this is the same as `let _y = 5; let y = &_y;`
157-
let f = Foo { x: y };
158-
159-
println!("x is: {}", f.x());
160-
}
161-
```
162-
163-
As you can see, we need to declare a lifetime for `Foo` in the `impl` line. We repeat
164-
`'a` twice, just like on functions: `impl<'a>` defines a lifetime `'a`, and `Foo<'a>`
165-
uses it.
166-
167-
## Multiple lifetimes
168-
169140
If you have multiple references, you can use the same lifetime multiple times:
170141

171142
```rust

trunk/src/doc/trpl/patterns.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -282,38 +282,6 @@ This ‘destructuring’ behavior works on any compound data type, like
282282
[tuples]: primitive-types.html#tuples
283283
[enums]: enums.html
284284

285-
# Ignoring bindings
286-
287-
You can use `_` in a pattern to disregard the value. For example, here’s a
288-
`match` against a `Result<T, E>`:
289-
290-
```rust
291-
# let some_value: Result<i32, &'static str> = Err("There was an error");
292-
match some_value {
293-
Ok(value) => println!("got a value: {}", value),
294-
Err(_) => println!("an error occurred"),
295-
}
296-
```
297-
298-
In the first arm, we bind the value inside the `Ok` variant to `value`. But
299-
in the `Err` arm, we use `_` to disregard the specific error, and just print
300-
a general error message.
301-
302-
`_` is valid in any pattern that creates a binding. This can be useful to
303-
ignore parts of a larger structure:
304-
305-
```rust
306-
fn coordinate() -> (i32, i32, i32) {
307-
// generate and return some sort of triple tuple
308-
# (1, 2, 3)
309-
}
310-
311-
let (x, _, z) = coordinate();
312-
```
313-
314-
Here, we bind the first and last element of the tuple to `x` and `z`, but
315-
ignore the middle element.
316-
317285
# Mix and Match
318286

319287
Whew! That’s a lot of different ways to match things, and they can all be

trunk/src/doc/trpl/unsafe.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ this, Rust has a keyword, `unsafe`. Code using `unsafe` has less restrictions
88
than normal code does.
99

1010
Let’s go over the syntax, and then we’ll talk semantics. `unsafe` is used in
11-
four contexts. The first one is to mark a function as unsafe:
11+
two contexts. The first one is to mark a function as unsafe:
1212

1313
```rust
1414
unsafe fn danger_will_robinson() {
@@ -27,40 +27,15 @@ unsafe {
2727
}
2828
```
2929

30-
The third is for unsafe traits:
31-
32-
```rust
33-
unsafe trait Scary { }
34-
```
35-
36-
And the fourth is for `impl`ementing one of those traits:
37-
38-
```rust
39-
# unsafe trait Scary { }
40-
unsafe impl Scary for i32 {}
41-
```
42-
4330
It’s important to be able to explicitly delineate code that may have bugs that
4431
cause big problems. If a Rust program segfaults, you can be sure it’s somewhere
4532
in the sections marked `unsafe`.
4633

4734
# What does ‘safe’ mean?
4835

49-
Safe, in the context of Rust, means ‘doesn’t do anything unsafe’. It’s also
50-
important to know that there are certain behaviors that are probably not
51-
desirable in your code, but are expressly _not_ unsafe:
36+
Safe, in the context of Rust, means “doesn’t do anything unsafe.” Easy!
5237

53-
* Deadlocks
54-
* Leaks of memory or other resources
55-
* Exiting without calling destructors
56-
* Integer overflow
57-
58-
Rust cannot prevent all kinds of software problems. Buggy code can and will be
59-
written in Rust. These things aren’t great, but they don’t qualify as `unsafe`
60-
specifically.
61-
62-
In addition, the following are all undefined behaviors in Rust, and must be
63-
avoided, even when writing `unsafe` code:
38+
Okay, let’s try again: what is not safe to do? Here’s a list:
6439

6540
* Data races
6641
* Dereferencing a null/dangling raw pointer
@@ -89,6 +64,18 @@ avoided, even when writing `unsafe` code:
8964
[undef]: http://llvm.org/docs/LangRef.html#undefined-values
9065
[aliasing]: http://llvm.org/docs/LangRef.html#pointer-aliasing-rules
9166

67+
Whew! That’s a bunch of stuff. It’s also important to notice all kinds of
68+
behaviors that are certainly bad, but are expressly _not_ unsafe:
69+
70+
* Deadlocks
71+
* Leaks of memory or other resources
72+
* Exiting without calling destructors
73+
* Integer overflow
74+
75+
Rust cannot prevent all kinds of software problems. Buggy code can and will be
76+
written in Rust. These things aren’t great, but they don’t qualify as `unsafe`
77+
specifically.
78+
9279
# Unsafe Superpowers
9380

9481
In both unsafe functions and unsafe blocks, Rust will let you do three things

trunk/src/etc/mklldeps.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
f = open(sys.argv[1], 'wb')
1616

17-
components = sys.argv[2].split() # splits on whitespace
17+
components = sys.argv[2].split(' ')
18+
components = [i for i in components if i] # ignore extra whitespaces
1819
enable_static = sys.argv[3]
19-
llvm_config = sys.argv[4]
20+
llconfig = sys.argv[4]
2021

2122
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2223
// file at the top-level directory of this distribution and at
@@ -38,15 +39,15 @@ def run(args):
3839
out, err = proc.communicate()
3940

4041
if err:
41-
print("failed to run llvm_config: args = `{}`".format(args))
42+
print("failed to run llconfig: args = `{}`".format(args))
4243
print(err)
4344
sys.exit(1)
4445
return out
4546

4647
f.write("\n")
4748

4849
# LLVM libs
49-
args = [llvm_config, '--libs', '--system-libs']
50+
args = [llconfig, '--libs', '--system-libs']
5051

5152
args.extend(components)
5253
out = run(args)
@@ -68,13 +69,13 @@ def run(args):
6869
f.write(")]\n")
6970

7071
# LLVM ldflags
71-
out = run([llvm_config, '--ldflags'])
72+
out = run([llconfig, '--ldflags'])
7273
for lib in out.strip().split(' '):
7374
if lib[:2] == "-l":
7475
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
7576

7677
# C++ runtime library
77-
out = run([llvm_config, '--cxxflags'])
78+
out = run([llconfig, '--cxxflags'])
7879
if enable_static == '1':
7980
assert('stdlib=libc++' not in out)
8081
f.write("#[link(name = \"stdc++\", kind = \"static\")]\n")

trunk/src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,4 @@ pub fn oom() -> ! {
148148
// optimize it out).
149149
#[doc(hidden)]
150150
#[unstable(feature = "issue_14344_fixme")]
151-
#[cfg(stage0)]
152151
pub fn fixme_14344_be_sure_to_link_to_collections() {}

trunk/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ pub mod btree_set {
138138
// FIXME(#14344) this shouldn't be necessary
139139
#[doc(hidden)]
140140
#[unstable(feature = "issue_14344_fixme")]
141-
#[cfg(stage0)]
142141
pub fn fixme_14344_be_sure_to_link_to_collections() {}
143142

144143
#[cfg(not(test))]

0 commit comments

Comments
 (0)