Skip to content

Commit 405a0ba

Browse files
committed
---
yaml --- r: 219893 b: refs/heads/snap-stage3 c: 539cc55 h: refs/heads/master i: 219891: f76ed1c v: v3
1 parent 67c5eba commit 405a0ba

File tree

42 files changed

+1018
-462
lines changed

Some content is hidden

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

42 files changed

+1018
-462
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: c044791d80ea0dc5c4b57b6030a67b69f8510239
3-
refs/heads/snap-stage3: 0e714c19839412474ef7b7741a19f942c4327645
3+
refs/heads/snap-stage3: 539cc55018da6505b532dbdfb9f60e04f50a9250
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ 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))
299298
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
300299
ifeq ($$(findstring freebsd,$(1)),freebsd)
301300
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/snap-stage3/mk/target.mk

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

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

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,16 +1126,10 @@ 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 {
11341129
let aux_dir = aux_output_dir_name(config, testfile);
11351130
// FIXME (#9639): This needs to handle non-utf8 paths
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());
1131+
let link_args = vec!("-L".to_string(),
1132+
aux_dir.to_str().unwrap().to_string());
11391133
let args = make_compile_args(config,
11401134
props,
11411135
link_args,
@@ -1144,7 +1138,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11441138
}
11451139

11461140
fn document(config: &Config, props: &TestProps,
1147-
testfile: &Path, extra_args: &[String]) -> (ProcRes, PathBuf) {
1141+
testfile: &Path) -> (ProcRes, PathBuf) {
11481142
let aux_dir = aux_output_dir_name(config, testfile);
11491143
let out_dir = output_base_name(config, testfile);
11501144
let _ = fs::remove_dir_all(&out_dir);
@@ -1154,7 +1148,6 @@ fn document(config: &Config, props: &TestProps,
11541148
"-o".to_string(),
11551149
out_dir.to_str().unwrap().to_string(),
11561150
testfile.to_str().unwrap().to_string()];
1157-
args.extend(extra_args.iter().cloned());
11581151
args.extend(split_maybe_args(&props.compile_flags));
11591152
let args = ProcArgs {
11601153
prog: config.rustdoc_path.to_str().unwrap().to_string(),
@@ -1717,7 +1710,7 @@ fn charset() -> &'static str {
17171710
}
17181711

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

branches/snap-stage3/src/doc/reference.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,18 +3351,23 @@ 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-
An example of each kind:
3354+
Examples:
33553355

33563356
```{rust}
3357-
let vec: Vec<i32> = vec![1, 2, 3];
3358-
let arr: [i32; 3] = [1, 2, 3];
3359-
let s: &[i32] = &vec[..];
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[..];
33603365
```
33613366

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

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

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

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

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

35353541

35363542
### Trait objects

branches/snap-stage3/src/doc/trpl/comments.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ 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+
4152
When writing doc comments, providing some examples of usage is very, very
4253
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
4354
two values, and `panic!`s if they’re not equal to each other. It’s very helpful

branches/snap-stage3/src/doc/trpl/ffi.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -533,19 +533,10 @@ 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. 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:
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:
549540

550541
```rust
551542
use std::thread;

branches/snap-stage3/src/etc/mklldeps.py

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

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

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

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

4140
if err:
42-
print("failed to run llconfig: args = `{}`".format(args))
41+
print("failed to run llvm_config: args = `{}`".format(args))
4342
print(err)
4443
sys.exit(1)
4544
return out
4645

4746
f.write("\n")
4847

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

5251
args.extend(components)
5352
out = run(args)
@@ -69,13 +68,13 @@ def run(args):
6968
f.write(")]\n")
7069

7170
# LLVM ldflags
72-
out = run([llconfig, '--ldflags'])
71+
out = run([llvm_config, '--ldflags'])
7372
for lib in out.strip().split(' '):
7473
if lib[:2] == "-l":
7574
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
7675

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

branches/snap-stage3/src/libcollections/vec.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ 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-
163160
////////////////////////////////////////////////////////////////////////////////
164161
// Inherent methods
165162
////////////////////////////////////////////////////////////////////////////////

branches/snap-stage3/src/libcollections/vec_deque.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ 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.
4145
#[stable(feature = "rust1", since = "1.0.0")]
4246
pub struct VecDeque<T> {
4347
// tail and head are pointers into the buffer. Tail always points
4448
// to the first element that could be read, Head always points
4549
// to where data should be written.
46-
// If tail == head the buffer is empty. The length of the ringbuf
50+
// If tail == head the buffer is empty. The length of the ringbuffer
4751
// is defined as the distance between the two.
4852

4953
tail: usize,
@@ -309,7 +313,7 @@ impl<T> VecDeque<T> {
309313
}
310314

311315
/// Reserves capacity for at least `additional` more elements to be inserted in the given
312-
/// `Ringbuf`. The collection may reserve more space to avoid frequent reallocations.
316+
/// `VecDeque`. The collection may reserve more space to avoid frequent reallocations.
313317
///
314318
/// # Panics
315319
///
@@ -385,10 +389,10 @@ impl<T> VecDeque<T> {
385389
}
386390
}
387391

388-
/// Shrinks the capacity of the ringbuf as much as possible.
392+
/// Shrinks the capacity of the `VecDeque` as much as possible.
389393
///
390394
/// It will drop down as close as possible to the length but the allocator may still inform the
391-
/// ringbuf that there is space for a few more elements.
395+
/// `VecDeque` that there is space for a few more elements.
392396
///
393397
/// # Examples
394398
///
@@ -404,7 +408,7 @@ impl<T> VecDeque<T> {
404408
/// ```
405409
pub fn shrink_to_fit(&mut self) {
406410
// +1 since the ringbuffer always leaves one space empty
407-
// len + 1 can't overflow for an existing, well-formed ringbuf.
411+
// len + 1 can't overflow for an existing, well-formed ringbuffer.
408412
let target_cap = cmp::max(self.len() + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
409413
if target_cap < self.cap {
410414
// There are three cases of interest:
@@ -472,9 +476,9 @@ impl<T> VecDeque<T> {
472476
}
473477
}
474478

475-
/// Shortens a ringbuf, dropping excess elements from the back.
479+
/// Shortens a `VecDeque`, dropping excess elements from the back.
476480
///
477-
/// If `len` is greater than the ringbuf's current length, this has no
481+
/// If `len` is greater than the `VecDeque`'s current length, this has no
478482
/// effect.
479483
///
480484
/// # Examples
@@ -858,8 +862,8 @@ impl<T> VecDeque<T> {
858862
self.tail <= self.head
859863
}
860864

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

895-
/// Removes an element from anywhere in the ringbuf and returns it,
899+
/// Removes an element from anywhere in the `VecDeque` and returns it,
896900
/// replacing it with the first element.
897901
///
898902
/// This does not preserve ordering, but is O(1).
@@ -926,13 +930,13 @@ impl<T> VecDeque<T> {
926930
self.pop_front()
927931
}
928932

929-
/// Inserts an element at position `i` within the ringbuf. Whichever
933+
/// Inserts an element at position `i` within the `VecDeque`. Whichever
930934
/// end is closer to the insertion point will be moved to make room,
931935
/// and all the affected elements will be moved to new positions.
932936
///
933937
/// # Panics
934938
///
935-
/// Panics if `i` is greater than ringbuf's length
939+
/// Panics if `i` is greater than `VecDeque`'s length
936940
///
937941
/// # Examples
938942
/// ```
@@ -1132,7 +1136,7 @@ impl<T> VecDeque<T> {
11321136
}
11331137
}
11341138

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

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

branches/snap-stage3/src/libcore/mem.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,17 +445,22 @@ 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)]
448449
pub const POST_DROP_U8: u8 = 0x1d;
449450
#[unstable(feature = "filling_drop")]
451+
#[allow(missing_docs)]
450452
pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8);
451453
#[unstable(feature = "filling_drop")]
454+
#[allow(missing_docs)]
452455
pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8);
453456

454457
#[cfg(target_pointer_width = "32")]
455458
#[unstable(feature = "filling_drop")]
459+
#[allow(missing_docs)]
456460
pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize;
457461
#[cfg(target_pointer_width = "64")]
458462
#[unstable(feature = "filling_drop")]
463+
#[allow(missing_docs)]
459464
pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize;
460465

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

0 commit comments

Comments
 (0)