Skip to content

Commit b8d1414

Browse files
committed
---
yaml --- r: 228134 b: refs/heads/try c: 0e714c1 h: refs/heads/master v: v3
1 parent b85f7d5 commit b8d1414

File tree

44 files changed

+469
-1010
lines changed

Some content is hidden

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

44 files changed

+469
-1010
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: aef38ef8190d492607e4ca2629e0ce5889db157e
4+
refs/heads/try: 0e714c19839412474ef7b7741a19f942c4327645
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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/try/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/try/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/try/src/doc/reference.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,23 +3351,18 @@ heap.
33513351
A slice is a 'view' into an array. It doesn't own the data it points
33523352
to, it borrows it.
33533353

3354-
Examples:
3354+
An example of each kind:
33553355

33563356
```{rust}
3357-
// A stack-allocated array
3358-
let array: [i32; 3] = [1, 2, 3];
3359-
3360-
// A heap-allocated array
3361-
let vector: Vec<i32> = vec![1, 2, 3];
3362-
3363-
// A slice into an array
3364-
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[..];
33653360
```
33663361

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

3370-
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
33713366
to an array or slice is always bounds-checked.
33723367

33733368
### Structure types
@@ -3529,14 +3524,13 @@ more of the closure traits:
35293524

35303525
* `FnMut`
35313526
: The closure can be called multiple times as mutable. A closure called as
3532-
`FnMut` can mutate values from its environment. `FnMut` inherits from
3533-
`FnOnce` (i.e. anything implementing `FnMut` also implements `FnOnce`).
3527+
`FnMut` can mutate values from its environment. `FnMut` implies
3528+
`FnOnce`.
35343529

35353530
* `Fn`
35363531
: The closure can be called multiple times through a shared reference.
35373532
A closure called as `Fn` can neither move out from nor mutate values
3538-
from its environment. `Fn` inherits from `FnMut`, which itself
3539-
inherits from `FnOnce`.
3533+
from its environment. `Fn` implies `FnMut` and `FnOnce`.
35403534

35413535

35423536
### Trait objects

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

branches/try/src/libcollections/vec_deque.rs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,12 @@ const MINIMUM_CAPACITY: usize = 1; // 2 - 1
3838

3939
/// `VecDeque` is a growable ring buffer, which can be used as a
4040
/// double-ended queue efficiently.
41-
///
42-
/// The "default" usage of this type as a queue is to use `push_back` to add to the queue, and
43-
/// `pop_front` to remove from the queue. `extend` and `append` push onto the back in this manner,
44-
/// and iterating over `VecDeque` goes front to back.
4541
#[stable(feature = "rust1", since = "1.0.0")]
4642
pub struct VecDeque<T> {
4743
// tail and head are pointers into the buffer. Tail always points
4844
// to the first element that could be read, Head always points
4945
// to where data should be written.
50-
// If tail == head the buffer is empty. The length of the ringbuffer
46+
// If tail == head the buffer is empty. The length of the ringbuf
5147
// is defined as the distance between the two.
5248

5349
tail: usize,
@@ -313,7 +309,7 @@ impl<T> VecDeque<T> {
313309
}
314310

315311
/// Reserves capacity for at least `additional` more elements to be inserted in the given
316-
/// `VecDeque`. The collection may reserve more space to avoid frequent reallocations.
312+
/// `Ringbuf`. The collection may reserve more space to avoid frequent reallocations.
317313
///
318314
/// # Panics
319315
///
@@ -389,10 +385,10 @@ impl<T> VecDeque<T> {
389385
}
390386
}
391387

392-
/// Shrinks the capacity of the `VecDeque` as much as possible.
388+
/// Shrinks the capacity of the ringbuf as much as possible.
393389
///
394390
/// It will drop down as close as possible to the length but the allocator may still inform the
395-
/// `VecDeque` that there is space for a few more elements.
391+
/// ringbuf that there is space for a few more elements.
396392
///
397393
/// # Examples
398394
///
@@ -408,7 +404,7 @@ impl<T> VecDeque<T> {
408404
/// ```
409405
pub fn shrink_to_fit(&mut self) {
410406
// +1 since the ringbuffer always leaves one space empty
411-
// len + 1 can't overflow for an existing, well-formed ringbuffer.
407+
// len + 1 can't overflow for an existing, well-formed ringbuf.
412408
let target_cap = cmp::max(self.len() + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
413409
if target_cap < self.cap {
414410
// There are three cases of interest:
@@ -476,9 +472,9 @@ impl<T> VecDeque<T> {
476472
}
477473
}
478474

479-
/// Shortens a `VecDeque`, dropping excess elements from the back.
475+
/// Shortens a ringbuf, dropping excess elements from the back.
480476
///
481-
/// If `len` is greater than the `VecDeque`'s current length, this has no
477+
/// If `len` is greater than the ringbuf's current length, this has no
482478
/// effect.
483479
///
484480
/// # Examples
@@ -862,8 +858,8 @@ impl<T> VecDeque<T> {
862858
self.tail <= self.head
863859
}
864860

865-
/// Removes an element from anywhere in the `VecDeque` and returns it, replacing it with the
866-
/// last element.
861+
/// Removes an element from anywhere in the ringbuf and returns it, replacing it with the last
862+
/// element.
867863
///
868864
/// This does not preserve ordering, but is O(1).
869865
///
@@ -896,7 +892,7 @@ impl<T> VecDeque<T> {
896892
self.pop_back()
897893
}
898894

899-
/// Removes an element from anywhere in the `VecDeque` and returns it,
895+
/// Removes an element from anywhere in the ringbuf and returns it,
900896
/// replacing it with the first element.
901897
///
902898
/// This does not preserve ordering, but is O(1).
@@ -930,13 +926,13 @@ impl<T> VecDeque<T> {
930926
self.pop_front()
931927
}
932928

933-
/// Inserts an element at position `i` within the `VecDeque`. Whichever
929+
/// Inserts an element at position `i` within the ringbuf. Whichever
934930
/// end is closer to the insertion point will be moved to make room,
935931
/// and all the affected elements will be moved to new positions.
936932
///
937933
/// # Panics
938934
///
939-
/// Panics if `i` is greater than `VecDeque`'s length
935+
/// Panics if `i` is greater than ringbuf's length
940936
///
941937
/// # Examples
942938
/// ```
@@ -1136,7 +1132,7 @@ impl<T> VecDeque<T> {
11361132
}
11371133
}
11381134

1139-
/// Removes and returns the element at position `i` from the `VecDeque`.
1135+
/// Removes and returns the element at position `i` from the ringbuf.
11401136
/// Whichever end is closer to the removal point will be moved to make
11411137
/// room, and all the affected elements will be moved to new positions.
11421138
/// Returns `None` if `i` is out of bounds.
@@ -1432,7 +1428,7 @@ impl<T> VecDeque<T> {
14321428
}
14331429

14341430
impl<T: Clone> VecDeque<T> {
1435-
/// Modifies the `VecDeque` in-place so that `len()` is equal to new_len,
1431+
/// Modifies the ringbuf in-place so that `len()` is equal to new_len,
14361432
/// either by removing excess elements or by appending copies of a value to the back.
14371433
///
14381434
/// # Examples

branches/try/src/libcore/mem.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,22 +445,17 @@ macro_rules! repeat_u8_as_u64 {
445445
//
446446
// And of course, 0x00 brings back the old world of zero'ing on drop.
447447
#[unstable(feature = "filling_drop")]
448-
#[allow(missing_docs)]
449448
pub const POST_DROP_U8: u8 = 0x1d;
450449
#[unstable(feature = "filling_drop")]
451-
#[allow(missing_docs)]
452450
pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8);
453451
#[unstable(feature = "filling_drop")]
454-
#[allow(missing_docs)]
455452
pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8);
456453

457454
#[cfg(target_pointer_width = "32")]
458455
#[unstable(feature = "filling_drop")]
459-
#[allow(missing_docs)]
460456
pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize;
461457
#[cfg(target_pointer_width = "64")]
462458
#[unstable(feature = "filling_drop")]
463-
#[allow(missing_docs)]
464459
pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize;
465460

466461
/// Interprets `src` as `&U`, and then reads `src` without moving the contained

0 commit comments

Comments
 (0)