Skip to content

Commit 5328e70

Browse files
committed
---
yaml --- r: 233528 b: refs/heads/beta c: cc65f79 h: refs/heads/master v: v3
1 parent 5fe6202 commit 5328e70

File tree

261 files changed

+3418
-5709
lines changed

Some content is hidden

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

261 files changed

+3418
-5709
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 2fb3fb24a395dfb21142f4572440214fbf551e4a
26+
refs/heads/beta: cc65f79e55e152b6e1bba704d1e2c7ed789da244
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,6 @@ Read ["Installing Rust"] from [The Book].
8282
$ make && make install
8383
```
8484

85-
## Building Documentation
86-
87-
If you’d like to build the documentation, it’s almost the same:
88-
89-
```sh
90-
./configure
91-
$ make docs
92-
```
93-
94-
Building the documentation requires building the compiler, so the above
95-
details will apply. Once you have the compiler built, you can
96-
97-
```sh
98-
$ make docs NO_REBUILD=1
99-
```
100-
101-
To make sure you don’t re-build the compiler because you made a change
102-
to some documentation.
103-
104-
The generated documentation will appear in a top-level `doc` directory,
105-
created by the `make` rule.
106-
10785
## Notes
10886

10987
Since the Rust compiler is written in Rust, it must be built by a

branches/beta/man/rustc.1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ look for anything here (the default)
4141
.RE
4242
.TP
4343
\fB\-l\fR [\fIKIND\fR=]\fINAME\fR
44-
Link the generated crate(s) to the specified library \fINAME\fR.
44+
Link the generated crate(s) to the specified native library \fINAME\fR.
4545
The optional \fIKIND\fR can be one of \fIstatic\fR, \fIdylib\fR, or
4646
\fIframework\fR.
4747
If omitted, \fIdylib\fR is assumed.
@@ -113,8 +113,7 @@ Print version info and exit.
113113
Use verbose output.
114114
.TP
115115
\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR
116-
Specify where an external rust library is located. These should match
117-
\fIextern\fR declarations in the crate's source code.
116+
Specify where an external rust library is located.
118117
.TP
119118
\fB\-\-sysroot\fR \fIPATH\fR
120119
Override the system root.

branches/beta/mk/crates.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std flate arena term \
5656
alloc_system
5757
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_platform_intrinsics
59+
rustc_data_structures
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6161
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

@@ -74,16 +74,15 @@ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_bo
7474
rustc_trans rustc_privacy rustc_lint
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
77-
log syntax serialize rustc_llvm rustc_platform_intrinsics
78-
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics
77+
log syntax serialize rustc_llvm
78+
DEPS_rustc_typeck := rustc syntax
7979
DEPS_rustc_borrowck := rustc log graphviz syntax
8080
DEPS_rustc_resolve := rustc log syntax
8181
DEPS_rustc_privacy := rustc log syntax
8282
DEPS_rustc_lint := rustc log syntax
8383
DEPS_rustc := syntax flate arena serialize getopts rbml \
8484
log graphviz rustc_llvm rustc_back rustc_data_structures
8585
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
86-
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
8786
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8887
DEPS_rustc_data_structures := std log serialize
8988
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \

branches/beta/src/doc/reference.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,11 +2059,6 @@ The following configurations must be defined by the implementation:
20592059
`"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
20602060
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
20612061
`"big"`.
2062-
* `target_env = ".."` - an option provided by the compiler by default
2063-
describing the runtime environment of the target platform. Some examples of
2064-
this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
2065-
Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
2066-
option may also be blank on some platforms.
20672062
* `target_family = "..."`. Operating system family of the target, e. g.
20682063
`"unix"` or `"windows"`. The value of this configuration option is defined
20692064
as a configuration itself, like `unix` or `windows`.

branches/beta/src/doc/trpl/functions.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -214,61 +214,11 @@ fn diverges() -> ! {
214214

215215
`panic!` is a macro, similar to `println!()` that we’ve already seen. Unlike
216216
`println!()`, `panic!()` causes the current thread of execution to crash with
217-
the given message. Because this function will cause a crash, it will never
218-
return, and so it has the type ‘`!`’, which is read ‘diverges’.
217+
the given message.
219218

220-
If you add a main function that calls `diverges()` and run it, you’ll get
221-
some output that looks like this:
222-
223-
```text
224-
thread ‘<main>’ panicked at ‘This function never returns!’, hello.rs:2
225-
```
226-
227-
If you want more information, you can get a backtrace by setting the
228-
`RUST_BACKTRACE` environment variable:
229-
230-
```text
231-
$ RUST_BACKTRACE=1 ./diverges
232-
thread '<main>' panicked at 'This function never returns!', hello.rs:2
233-
stack backtrace:
234-
1: 0x7f402773a829 - sys::backtrace::write::h0942de78b6c02817K8r
235-
2: 0x7f402773d7fc - panicking::on_panic::h3f23f9d0b5f4c91bu9w
236-
3: 0x7f402773960e - rt::unwind::begin_unwind_inner::h2844b8c5e81e79558Bw
237-
4: 0x7f4027738893 - rt::unwind::begin_unwind::h4375279447423903650
238-
5: 0x7f4027738809 - diverges::h2266b4c4b850236beaa
239-
6: 0x7f40277389e5 - main::h19bb1149c2f00ecfBaa
240-
7: 0x7f402773f514 - rt::unwind::try::try_fn::h13186883479104382231
241-
8: 0x7f402773d1d8 - __rust_try
242-
9: 0x7f402773f201 - rt::lang_start::ha172a3ce74bb453aK5w
243-
10: 0x7f4027738a19 - main
244-
11: 0x7f402694ab44 - __libc_start_main
245-
12: 0x7f40277386c8 - <unknown>
246-
13: 0x0 - <unknown>
247-
```
248-
249-
`RUST_BACKTRACE` also works with Cargo’s `run` command:
250-
251-
```text
252-
$ RUST_BACKTRACE=1 cargo run
253-
Running `target/debug/diverges`
254-
thread '<main>' panicked at 'This function never returns!', hello.rs:2
255-
stack backtrace:
256-
1: 0x7f402773a829 - sys::backtrace::write::h0942de78b6c02817K8r
257-
2: 0x7f402773d7fc - panicking::on_panic::h3f23f9d0b5f4c91bu9w
258-
3: 0x7f402773960e - rt::unwind::begin_unwind_inner::h2844b8c5e81e79558Bw
259-
4: 0x7f4027738893 - rt::unwind::begin_unwind::h4375279447423903650
260-
5: 0x7f4027738809 - diverges::h2266b4c4b850236beaa
261-
6: 0x7f40277389e5 - main::h19bb1149c2f00ecfBaa
262-
7: 0x7f402773f514 - rt::unwind::try::try_fn::h13186883479104382231
263-
8: 0x7f402773d1d8 - __rust_try
264-
9: 0x7f402773f201 - rt::lang_start::ha172a3ce74bb453aK5w
265-
10: 0x7f4027738a19 - main
266-
11: 0x7f402694ab44 - __libc_start_main
267-
12: 0x7f40277386c8 - <unknown>
268-
13: 0x0 - <unknown>
269-
```
270-
271-
A diverging function can be used as any type:
219+
Because this function will cause a crash, it will never return, and so it has
220+
the type ‘`!`’, which is read ‘diverges’. A diverging function can be used
221+
as any type:
272222

273223
```should_panic
274224
# fn diverges() -> ! {

branches/beta/src/doc/trpl/trait-objects.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -300,41 +300,3 @@ let y = TraitObject {
300300
// y.method();
301301
(y.vtable.method)(y.data);
302302
```
303-
304-
## Object Safety
305-
306-
Not every trait can be used to make a trait object. For example, vectors implement
307-
`Clone`, but if we try to make a trait object:
308-
309-
```ignore
310-
let v = vec![1, 2, 3];
311-
let o = &v as &Clone;
312-
```
313-
314-
We get an error:
315-
316-
```text
317-
error: cannot convert to a trait object because trait `core::clone::Clone` is not object-safe [E0038]
318-
let o = &v as &Clone;
319-
^~
320-
note: the trait cannot require that `Self : Sized`
321-
let o = &v as &Clone;
322-
^~
323-
```
324-
325-
The error says that `Clone` is not ‘object-safe’. Only traits that are
326-
object-safe can be made into trait objects. A trait is object-safe if both of
327-
these are true:
328-
329-
* the trait does not require that `Self: Sized`
330-
* all of its methods are object-safe
331-
332-
So what makes a method object-safe? Each method must require that `Self: Sized`
333-
or all of the following:
334-
335-
* must not have any type parameters
336-
* must not use `Self`
337-
338-
Whew! As we can see, almost all of these rules talk about `Self`. A good intuition
339-
is “except in special circumstances, if your trait’s method uses `Self`, it is not
340-
object-safe.”

branches/beta/src/liballoc/arc.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
137137
/// used to break cycles between `Arc` pointers.
138138
#[unsafe_no_drop_flag]
139139
#[unstable(feature = "arc_weak",
140-
reason = "Weak pointers may not belong in this module.",
141-
issue = "27718")]
140+
reason = "Weak pointers may not belong in this module.")]
142141
pub struct Weak<T: ?Sized> {
143142
// FIXME #12808: strange name to try to avoid interfering with
144143
// field accesses of the contained type via Deref
@@ -210,8 +209,7 @@ impl<T: ?Sized> Arc<T> {
210209
/// let weak_five = five.downgrade();
211210
/// ```
212211
#[unstable(feature = "arc_weak",
213-
reason = "Weak pointers may not belong in this module.",
214-
issue = "27718")]
212+
reason = "Weak pointers may not belong in this module.")]
215213
pub fn downgrade(&self) -> Weak<T> {
216214
loop {
217215
// This Relaxed is OK because we're checking the value in the CAS
@@ -236,14 +234,14 @@ impl<T: ?Sized> Arc<T> {
236234

237235
/// Get the number of weak references to this value.
238236
#[inline]
239-
#[unstable(feature = "arc_counts", issue = "27718")]
237+
#[unstable(feature = "arc_counts")]
240238
pub fn weak_count(this: &Arc<T>) -> usize {
241239
this.inner().weak.load(SeqCst) - 1
242240
}
243241

244242
/// Get the number of strong references to this value.
245243
#[inline]
246-
#[unstable(feature = "arc_counts", issue = "27718")]
244+
#[unstable(feature = "arc_counts")]
247245
pub fn strong_count(this: &Arc<T>) -> usize {
248246
this.inner().strong.load(SeqCst)
249247
}
@@ -351,7 +349,7 @@ impl<T: Clone> Arc<T> {
351349
/// let mut_five = Arc::make_unique(&mut five);
352350
/// ```
353351
#[inline]
354-
#[unstable(feature = "arc_unique", issue = "27718")]
352+
#[unstable(feature = "arc_unique")]
355353
pub fn make_unique(this: &mut Arc<T>) -> &mut T {
356354
// Note that we hold both a strong reference and a weak reference.
357355
// Thus, releasing our strong reference only will not, by itself, cause
@@ -429,7 +427,7 @@ impl<T: ?Sized> Arc<T> {
429427
/// # }
430428
/// ```
431429
#[inline]
432-
#[unstable(feature = "arc_unique", issue = "27718")]
430+
#[unstable(feature = "arc_unique")]
433431
pub fn get_mut(this: &mut Arc<T>) -> Option<&mut T> {
434432
if this.is_unique() {
435433
// This unsafety is ok because we're guaranteed that the pointer
@@ -543,8 +541,7 @@ impl<T: ?Sized> Drop for Arc<T> {
543541
}
544542

545543
#[unstable(feature = "arc_weak",
546-
reason = "Weak pointers may not belong in this module.",
547-
issue = "27718")]
544+
reason = "Weak pointers may not belong in this module.")]
548545
impl<T: ?Sized> Weak<T> {
549546
/// Upgrades a weak reference to a strong reference.
550547
///
@@ -592,8 +589,7 @@ impl<T: ?Sized> Weak<T> {
592589
}
593590

594591
#[unstable(feature = "arc_weak",
595-
reason = "Weak pointers may not belong in this module.",
596-
issue = "27718")]
592+
reason = "Weak pointers may not belong in this module.")]
597593
impl<T: ?Sized> Clone for Weak<T> {
598594
/// Makes a clone of the `Weak<T>`.
599595
///

branches/beta/src/liballoc/boxed.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,13 @@ use core::raw::{TraitObject};
8585
/// ```
8686
#[lang = "exchange_heap"]
8787
#[unstable(feature = "box_heap",
88-
reason = "may be renamed; uncertain about custom allocator design",
89-
issue = "27779")]
88+
reason = "may be renamed; uncertain about custom allocator design")]
9089
pub const HEAP: ExchangeHeapSingleton =
9190
ExchangeHeapSingleton { _force_singleton: () };
9291

9392
/// This the singleton type used solely for `boxed::HEAP`.
9493
#[unstable(feature = "box_heap",
95-
reason = "may be renamed; uncertain about custom allocator design",
96-
issue = "27779")]
94+
reason = "may be renamed; uncertain about custom allocator design")]
9795
#[derive(Copy, Clone)]
9896
pub struct ExchangeHeapSingleton { _force_singleton: () }
9997

@@ -123,9 +121,7 @@ pub struct Box<T: ?Sized>(Unique<T>);
123121
/// the fact that the `align_of` intrinsic currently requires the
124122
/// input type to be Sized (which I do not think is strictly
125123
/// necessary).
126-
#[unstable(feature = "placement_in",
127-
reason = "placement box design is still being worked out.",
128-
issue = "27779")]
124+
#[unstable(feature = "placement_in", reason = "placement box design is still being worked out.")]
129125
pub struct IntermediateBox<T: ?Sized>{
130126
ptr: *mut u8,
131127
size: usize,
@@ -226,8 +222,7 @@ impl<T : ?Sized> Box<T> {
226222
/// lead to memory problems like double-free, for example if the
227223
/// function is called twice on the same raw pointer.
228224
#[unstable(feature = "box_raw",
229-
reason = "may be renamed or moved out of Box scope",
230-
issue = "27768")]
225+
reason = "may be renamed or moved out of Box scope")]
231226
#[inline]
232227
// NB: may want to be called from_ptr, see comments on CStr::from_ptr
233228
pub unsafe fn from_raw(raw: *mut T) -> Self {
@@ -250,8 +245,7 @@ impl<T : ?Sized> Box<T> {
250245
/// let raw = Box::into_raw(seventeen);
251246
/// let boxed_again = unsafe { Box::from_raw(raw) };
252247
/// ```
253-
#[unstable(feature = "box_raw", reason = "may be renamed",
254-
issue = "27768")]
248+
#[unstable(feature = "box_raw", reason = "may be renamed")]
255249
#[inline]
256250
// NB: may want to be called into_ptr, see comments on CStr::from_ptr
257251
pub fn into_raw(b: Box<T>) -> *mut T {
@@ -476,7 +470,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
476470
/// }
477471
/// ```
478472
#[rustc_paren_sugar]
479-
#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")]
473+
#[unstable(feature = "fnbox", reason = "Newly introduced")]
480474
pub trait FnBox<A> {
481475
type Output;
482476

branches/beta/src/liballoc/heap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
reason = "the precise API and guarantees it provides may be tweaked \
1313
slightly, especially to possibly take into account the \
1414
types being stored to make room for a future \
15-
tracing garbage collector",
16-
issue = "27700")]
15+
tracing garbage collector")]
1716

1817
use core::{isize, usize};
1918

branches/beta/src/liballoc/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
#![allow(unused_attributes)]
6565
#![unstable(feature = "alloc",
6666
reason = "this library is unlikely to be stabilized in its current \
67-
form or name",
68-
issue = "27783")]
67+
form or name")]
6968
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
7069
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
7170
html_root_url = "https://doc.rust-lang.org/nightly/",
@@ -84,7 +83,6 @@
8483
#![feature(lang_items)]
8584
#![feature(no_std)]
8685
#![feature(nonzero)]
87-
#![feature(num_bits_bytes)]
8886
#![feature(optin_builtin_traits)]
8987
#![feature(placement_in_syntax)]
9088
#![feature(placement_new_protocol)]
@@ -132,8 +130,7 @@ pub mod raw_vec;
132130
/// Common out-of-memory routine
133131
#[cold]
134132
#[inline(never)]
135-
#[unstable(feature = "oom", reason = "not a scrutinized interface",
136-
issue = "27700")]
133+
#[unstable(feature = "oom", reason = "not a scrutinized interface")]
137134
pub fn oom() -> ! {
138135
// FIXME(#14674): This really needs to do something other than just abort
139136
// here, but any printing done must be *guaranteed* to not

branches/beta/src/liballoc/raw_vec.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use heap;
1515
use super::oom;
1616
use super::boxed::Box;
1717
use core::ops::Drop;
18-
use core;
1918

2019
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating a
2120
/// a buffer of memory on the heap without having to worry about all the corner cases
@@ -444,8 +443,11 @@ impl<T> Drop for RawVec<T> {
444443
// user-space. e.g. PAE or x32
445444

446445
#[inline]
446+
#[cfg(target_pointer_width = "64")]
447+
fn alloc_guard(_alloc_size: usize) { }
448+
449+
#[inline]
450+
#[cfg(target_pointer_width = "32")]
447451
fn alloc_guard(alloc_size: usize) {
448-
if core::usize::BITS < 64 {
449-
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
450-
}
452+
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
451453
}

0 commit comments

Comments
 (0)