Skip to content

Commit abc26ea

Browse files
committed
---
yaml --- r: 218171 b: refs/heads/tmp c: 6a3b385 h: refs/heads/master i: 218169: 09c0cbf 218167: 3e3834d v: v3
1 parent 0c243ad commit abc26ea

Some content is hidden

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

54 files changed

+528
-1399
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: 18adf6230e2e229d4d73391cebff060afc5e5aaa
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 26f0cd5de7f71a0db0bb3857ce49a11cd0f7d876
28+
refs/heads/tmp: 6a3b385cbd6b9044b4447da96aad066e8b257ddf
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e6596d0052e79e6393bbee3538bb122930d89887
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/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`

branches/tmp/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),

branches/tmp/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)))))))

branches/tmp/src/compiletest/runtest.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,16 @@ impl fmt::Display for Status {
11261126

11271127
fn compile_test(config: &Config, props: &TestProps,
11281128
testfile: &Path) -> ProcRes {
1129+
compile_test_(config, props, testfile, &[])
1130+
}
1131+
1132+
fn compile_test_(config: &Config, props: &TestProps,
1133+
testfile: &Path, extra_args: &[String]) -> ProcRes {
11291134
let aux_dir = aux_output_dir_name(config, testfile);
11301135
// FIXME (#9639): This needs to handle non-utf8 paths
1131-
let link_args = vec!("-L".to_string(),
1132-
aux_dir.to_str().unwrap().to_string());
1136+
let mut link_args = vec!("-L".to_string(),
1137+
aux_dir.to_str().unwrap().to_string());
1138+
link_args.extend(extra_args.iter().cloned());
11331139
let args = make_compile_args(config,
11341140
props,
11351141
link_args,
@@ -1138,7 +1144,7 @@ fn compile_test(config: &Config, props: &TestProps,
11381144
}
11391145

11401146
fn document(config: &Config, props: &TestProps,
1141-
testfile: &Path) -> (ProcRes, PathBuf) {
1147+
testfile: &Path, extra_args: &[String]) -> (ProcRes, PathBuf) {
11421148
let aux_dir = aux_output_dir_name(config, testfile);
11431149
let out_dir = output_base_name(config, testfile);
11441150
let _ = fs::remove_dir_all(&out_dir);
@@ -1148,6 +1154,7 @@ fn document(config: &Config, props: &TestProps,
11481154
"-o".to_string(),
11491155
out_dir.to_str().unwrap().to_string(),
11501156
testfile.to_str().unwrap().to_string()];
1157+
args.extend(extra_args.iter().cloned());
11511158
args.extend(split_maybe_args(&props.compile_flags));
11521159
let args = ProcArgs {
11531160
prog: config.rustdoc_path.to_str().unwrap().to_string(),
@@ -1710,7 +1717,7 @@ fn charset() -> &'static str {
17101717
}
17111718

17121719
fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
1713-
let (proc_res, out_dir) = document(config, props, testfile);
1720+
let (proc_res, out_dir) = document(config, props, testfile, &[]);
17141721
if !proc_res.status.success() {
17151722
fatal_proc_rec("rustdoc failed!", &proc_res);
17161723
}

branches/tmp/src/doc/reference.md

Lines changed: 12 additions & 16 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

@@ -3349,23 +3351,18 @@ heap.
33493351
A slice is a 'view' into an array. It doesn't own the data it points
33503352
to, it borrows it.
33513353

3352-
Examples:
3354+
An example of each kind:
33533355

33543356
```{rust}
3355-
// A stack-allocated array
3356-
let array: [i32; 3] = [1, 2, 3];
3357-
3358-
// A heap-allocated array
3359-
let vector: Vec<i32> = vec![1, 2, 3];
3360-
3361-
// A slice into an array
3362-
let slice: &[i32] = &vector[..];
3357+
let vec: Vec<i32> = vec![1, 2, 3];
3358+
let arr: [i32; 3] = [1, 2, 3];
3359+
let s: &[i32] = &vec[..];
33633360
```
33643361

33653362
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
33663363
`vec!` macro is also part of the standard library, rather than the language.
33673364

3368-
All in-bounds elements of arrays and slices are always initialized, and access
3365+
All in-bounds elements of arrays, and slices are always initialized, and access
33693366
to an array or slice is always bounds-checked.
33703367

33713368
### Structure types
@@ -3527,14 +3524,13 @@ more of the closure traits:
35273524

35283525
* `FnMut`
35293526
: The closure can be called multiple times as mutable. A closure called as
3530-
`FnMut` can mutate values from its environment. `FnMut` inherits from
3531-
`FnOnce` (i.e. anything implementing `FnMut` also implements `FnOnce`).
3527+
`FnMut` can mutate values from its environment. `FnMut` implies
3528+
`FnOnce`.
35323529

35333530
* `Fn`
35343531
: The closure can be called multiple times through a shared reference.
35353532
A closure called as `Fn` can neither move out from nor mutate values
3536-
from its environment. `Fn` inherits from `FnMut`, which itself
3537-
inherits from `FnOnce`.
3533+
from its environment. `Fn` implies `FnMut` and `FnOnce`.
35383534

35393535

35403536
### Trait objects

branches/tmp/src/doc/trpl/comments.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ fn add_one(x: i32) -> i32 {
3838
}
3939
```
4040

41-
There is another style of doc comment, `//!`, to comment containing items (e.g.
42-
crates, modules or functions), instead of the items following it. Commonly used
43-
inside crates root (lib.rs) or modules root (mod.rs):
44-
45-
```
46-
//! # The Rust Standard Library
47-
//!
48-
//! The Rust Standard Library provides the essential runtime
49-
//! functionality for building portable Rust software.
50-
```
51-
5241
When writing doc comments, providing some examples of usage is very, very
5342
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
5443
two values, and `panic!`s if they’re not equal to each other. It’s very helpful

branches/tmp/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;

branches/tmp/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

branches/tmp/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")

branches/tmp/src/libcollections/vec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ pub struct Vec<T> {
157157
cap: usize,
158158
}
159159

160+
unsafe impl<T: Send> Send for Vec<T> { }
161+
unsafe impl<T: Sync> Sync for Vec<T> { }
162+
160163
////////////////////////////////////////////////////////////////////////////////
161164
// Inherent methods
162165
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)