Skip to content

Commit ba4947b

Browse files
committed
---
yaml --- r: 207823 b: refs/heads/snap-stage3 c: bd4b984 h: refs/heads/master i: 207821: ad558c4 207819: db6b54b 207815: 9398504 207807: 3d120a1 v: v3
1 parent 295bbba commit ba4947b

Some content is hidden

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

91 files changed

+4259
-6284
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: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 373d6202cffedd379cbb22128fb754f42fdbfb97
4+
refs/heads/snap-stage3: bd4b984537bd33c9625212c9ccbb3a6084001407
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
551551
opt docs 1 "build standard library documentation"
552552
opt compiler-docs 0 "build compiler documentation"
553553
opt optimize-tests 1 "build tests with optimizations"
554+
opt debuginfo-tests 0 "build tests with debugger metadata"
554555
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
555556
opt llvm-assertions 0 "build LLVM with assertions"
556557
opt debug-assertions 0 "build with debugging assertions"

branches/snap-stage3/mk/tests.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,13 @@ ifndef CFG_DISABLE_OPTIMIZE_TESTS
632632
CTEST_RUSTC_FLAGS += -O
633633
endif
634634

635+
# Analogously to the above, whether to pass `-g` when compiling tests
636+
# is a separate choice from whether to pass `-g` when building the
637+
# compiler and standard library themselves.
638+
CTEST_RUSTC_FLAGS := $$(subst -g,,$$(CTEST_RUSTC_FLAGS))
639+
ifdef CFG_ENABLE_DEBUGINFO_TESTS
640+
CTEST_RUSTC_FLAGS += -g
641+
endif
635642

636643
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
637644
--compile-lib-path $$(HLIB$(1)_H_$(3)) \

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ function populate_rust_search() {
5757

5858
// #18540, use a single token
5959

60-
var a = document.createElement("a");
61-
a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
62-
a.textContent = lt;
6360
var search = document.getElementById('core-search');
64-
search.innerHTML = "";
65-
search.appendChild(a);
61+
search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
6662
}
6763
populate_site_search();
6864
populate_rust_search();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Non-doc comments are interpreted as a form of whitespace.
103103

104104
## Whitespace
105105

106-
Whitespace is any non-empty string containing only the following characters:
106+
Whitespace is any non-empty string containing any the following characters:
107107

108108
- `U+0020` (space, `' '`)
109109
- `U+0009` (tab, `'\t'`)
@@ -1897,8 +1897,8 @@ release builds.
18971897

18981898
There are two kinds of configuration options, one that is either defined or not
18991899
(`#[cfg(foo)]`), and the other that contains a string that can be checked
1900-
against (`#[cfg(bar = "baz")]`). Currently, only compiler-defined configuration
1901-
options can have the latter form.
1900+
against (`#[cfg(bar = "baz")]` (currently only compiler-defined configuration
1901+
options can have the latter form).
19021902

19031903
```
19041904
// The function is only included in the build when compiling for OSX

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ vector. When we try to compile this program, we get an error:
127127

128128
```text
129129
error: cannot borrow `x` as mutable because it is also borrowed as immutable
130-
x.push("foo");
130+
x.push(4);
131131
^
132132
note: previous borrow of `x` occurs here; the immutable borrow prevents
133133
subsequent moves or mutable borrows of `x` until the borrow ends

branches/snap-stage3/src/doc/trpl/benchmark-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn add_two(a: i32) -> i32 {
1313
}
1414
1515
#[cfg(test)]
16-
mod tests {
16+
mod test {
1717
use super::*;
1818
use test::Bencher;
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ as `unimplemented!` until you’re ready to write them.
765765
# Procedural macros
766766

767767
If Rust’s macro system can’t do what you need, you may want to write a
768-
[compiler plugin](compiler-plugins.html) instead. Compared to `macro_rules!`
768+
[compiler plugin](plugins.html) instead. Compared to `macro_rules!`
769769
macros, this is significantly more work, the interfaces are much less stable,
770770
and bugs can be much harder to track down. In exchange you get the
771771
flexibility of running arbitrary Rust code within the compiler. Syntax

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

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ extern "rust-intrinsic" {
139139
pub fn atomic_fence_rel();
140140
pub fn atomic_fence_acqrel();
141141

142-
/// A compiler-only memory barrier.
143-
///
144-
/// Memory accesses will never be reordered across this barrier by the compiler,
145-
/// but no instructions will be emitted for it. This is appropriate for operations
146-
/// on the same thread that may be preempted, such as when interacting with signal
147-
/// handlers.
148-
#[cfg(not(stage0))] // SNAP 857ef6e
149-
pub fn atomic_singlethreadfence();
150-
#[cfg(not(stage0))] // SNAP 857ef6e
151-
pub fn atomic_singlethreadfence_acq();
152-
#[cfg(not(stage0))] // SNAP 857ef6e
153-
pub fn atomic_singlethreadfence_rel();
154-
#[cfg(not(stage0))] // SNAP 857ef6e
155-
pub fn atomic_singlethreadfence_acqrel();
156-
157142
/// Aborts the execution of the process.
158143
pub fn abort() -> !;
159144

@@ -270,17 +255,12 @@ extern "rust-intrinsic" {
270255
/// Returns `true` if a type is managed (will be allocated on the local heap)
271256
pub fn owns_managed<T>() -> bool;
272257

273-
/// Calculates the offset from a pointer.
258+
/// Calculates the offset from a pointer. The offset *must* be in-bounds of
259+
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
260+
/// undefined behaviour.
274261
///
275262
/// This is implemented as an intrinsic to avoid converting to and from an
276263
/// integer, since the conversion would throw away aliasing information.
277-
///
278-
/// # Safety
279-
///
280-
/// Both the starting and resulting pointer must be either in bounds or one
281-
/// byte past the end of an allocated object. If either pointer is out of
282-
/// bounds or arithmetic overflow occurs then any further use of the
283-
/// returned value will result in undefined behavior.
284264
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
285265

286266
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
@@ -582,20 +562,3 @@ extern "rust-intrinsic" {
582562
/// cast to a `u64`; if `T` has no discriminant, returns 0.
583563
pub fn discriminant_value<T>(v: &T) -> u64;
584564
}
585-
586-
#[cfg(not(stage0))]
587-
extern "rust-intrinsic" {
588-
/// Performs an unchecked signed division, which results in undefined behavior,
589-
/// in cases where y == 0, or x == int::MIN and y == -1
590-
pub fn unchecked_sdiv<T>(x: T, y: T) -> T;
591-
/// Performs an unchecked unsigned division, which results in undefined behavior,
592-
/// in cases where y == 0
593-
pub fn unchecked_udiv<T>(x: T, y: T) -> T;
594-
595-
/// Returns the remainder of an unchecked signed division, which results in
596-
/// undefined behavior, in cases where y == 0, or x == int::MIN and y == -1
597-
pub fn unchecked_urem<T>(x: T, y: T) -> T;
598-
/// Returns the remainder of an unchecked signed division, which results in
599-
/// undefined behavior, in cases where y == 0
600-
pub fn unchecked_srem<T>(x: T, y: T) -> T;
601-
}

branches/snap-stage3/src/libcore/num/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -745,20 +745,7 @@ macro_rules! uint_impl {
745745
#[stable(feature = "rust1", since = "1.0.0")]
746746
#[inline]
747747
pub fn trailing_zeros(self) -> u32 {
748-
// As of LLVM 3.6 the codegen for the zero-safe cttz8 intrinsic
749-
// emits two conditional moves on x86_64. By promoting the value to
750-
// u16 and setting bit 8, we get better code without any conditional
751-
// operations.
752-
// FIXME: There's a LLVM patch (http://reviews.llvm.org/D9284)
753-
// pending, remove this workaround once LLVM generates better code
754-
// for cttz8.
755-
unsafe {
756-
if $BITS == 8 {
757-
intrinsics::cttz16(self as u16 | 0x100) as u32
758-
} else {
759-
$cttz(self as $ActualT) as u32
760-
}
761-
}
748+
unsafe { $cttz(self as $ActualT) as u32 }
762749
}
763750

764751
/// Shifts the bits to the left by a specified amount, `n`,

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,9 @@ impl<T: ?Sized> *const T {
284284
///
285285
/// # Safety
286286
///
287-
/// Both the starting and resulting pointer must be either in bounds or one
288-
/// byte past the end of an allocated object. If either pointer is out of
289-
/// bounds or arithmetic overflow occurs then
290-
/// any further use of the returned value will result in undefined behavior.
287+
/// The offset must be in-bounds of the object, or one-byte-past-the-end.
288+
/// Otherwise `offset` invokes Undefined Behaviour, regardless of whether
289+
/// the pointer is used.
291290
#[stable(feature = "rust1", since = "1.0.0")]
292291
#[inline]
293292
pub unsafe fn offset(self, count: isize) -> *const T where T: Sized {

branches/snap-stage3/src/libcoretest/option.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ fn test_ord() {
219219
assert!(big > None);
220220
}
221221

222+
/* FIXME(#20575)
222223
#[test]
223224
fn test_collect() {
224225
let v: Option<Vec<isize>> = (0..0).map(|_| Some(0)).collect();
@@ -240,26 +241,28 @@ fn test_collect() {
240241
241242
assert!(v == None);
242243
}
243-
244+
*/
244245

245246
#[test]
246247
fn test_cloned() {
247-
let val = 1u32;
248-
let val_ref = &val;
248+
let val1 = 1u32;
249+
let mut val2 = 2u32;
250+
let val1_ref = &val1;
249251
let opt_none: Option<&'static u32> = None;
250-
let opt_ref = Some(&val);
251-
let opt_ref_ref = Some(&val_ref);
252+
let opt_ref = Some(&val1);
253+
let opt_ref_ref = Some(&val1_ref);
254+
let opt_mut_ref = Some(&mut val2);
252255

253256
// None works
254257
assert_eq!(opt_none.clone(), None);
255258
assert_eq!(opt_none.cloned(), None);
256259

257260
// Immutable ref works
258-
assert_eq!(opt_ref.clone(), Some(&val));
261+
assert_eq!(opt_ref.clone(), Some(&val1));
259262
assert_eq!(opt_ref.cloned(), Some(1u32));
260263

261264
// Double Immutable ref works
262-
assert_eq!(opt_ref_ref.clone(), Some(&val_ref));
263-
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val));
265+
assert_eq!(opt_ref_ref.clone(), Some(&val1_ref));
266+
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val1));
264267
assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32));
265268
}

branches/snap-stage3/src/libcoretest/result.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn op1() -> Result<isize, &'static str> { Ok(666) }
12-
fn op2() -> Result<isize, &'static str> { Err("sadface") }
11+
pub fn op1() -> Result<isize, &'static str> { Ok(666) }
12+
pub fn op2() -> Result<isize, &'static str> { Err("sadface") }
1313

1414
#[test]
15-
fn test_and() {
15+
pub fn test_and() {
1616
assert_eq!(op1().and(Ok(667)).unwrap(), 667);
1717
assert_eq!(op1().and(Err::<i32, &'static str>("bad")).unwrap_err(),
1818
"bad");
@@ -23,7 +23,7 @@ fn test_and() {
2323
}
2424

2525
#[test]
26-
fn test_and_then() {
26+
pub fn test_and_then() {
2727
assert_eq!(op1().and_then(|i| Ok::<isize, &'static str>(i + 1)).unwrap(), 667);
2828
assert_eq!(op1().and_then(|_| Err::<isize, &'static str>("bad")).unwrap_err(),
2929
"bad");
@@ -35,7 +35,7 @@ fn test_and_then() {
3535
}
3636

3737
#[test]
38-
fn test_or() {
38+
pub fn test_or() {
3939
assert_eq!(op1().or(Ok::<_, &'static str>(667)).unwrap(), 666);
4040
assert_eq!(op1().or(Err("bad")).unwrap(), 666);
4141

@@ -44,7 +44,7 @@ fn test_or() {
4444
}
4545

4646
#[test]
47-
fn test_or_else() {
47+
pub fn test_or_else() {
4848
assert_eq!(op1().or_else(|_| Ok::<isize, &'static str>(667)).unwrap(), 666);
4949
assert_eq!(op1().or_else(|e| Err::<isize, &'static str>(e)).unwrap(), 666);
5050

@@ -54,17 +54,18 @@ fn test_or_else() {
5454
}
5555

5656
#[test]
57-
fn test_impl_map() {
57+
pub fn test_impl_map() {
5858
assert!(Ok::<isize, isize>(1).map(|x| x + 1) == Ok(2));
5959
assert!(Err::<isize, isize>(1).map(|x| x + 1) == Err(1));
6060
}
6161

6262
#[test]
63-
fn test_impl_map_err() {
63+
pub fn test_impl_map_err() {
6464
assert!(Ok::<isize, isize>(1).map_err(|x| x + 1) == Ok(1));
6565
assert!(Err::<isize, isize>(1).map_err(|x| x + 1) == Err(2));
6666
}
6767

68+
/* FIXME(#20575)
6869
#[test]
6970
fn test_collect() {
7071
let v: Result<Vec<isize>, ()> = (0..0).map(|_| Ok::<isize, ()>(0)).collect();
@@ -85,9 +86,10 @@ fn test_collect() {
8586
let v: Result<Vec<()>, isize> = functions.iter_mut().map(|f| (*f)()).collect();
8687
assert!(v == Err(1));
8788
}
89+
*/
8890

8991
#[test]
90-
fn test_fmt_default() {
92+
pub fn test_fmt_default() {
9193
let ok: Result<isize, &'static str> = Ok(100);
9294
let err: Result<isize, &'static str> = Err("Err");
9395

@@ -98,7 +100,7 @@ fn test_fmt_default() {
98100
}
99101

100102
#[test]
101-
fn test_unwrap_or() {
103+
pub fn test_unwrap_or() {
102104
let ok: Result<isize, &'static str> = Ok(100);
103105
let ok_err: Result<isize, &'static str> = Err("Err");
104106

@@ -107,7 +109,7 @@ fn test_unwrap_or() {
107109
}
108110

109111
#[test]
110-
fn test_unwrap_or_else() {
112+
pub fn test_unwrap_or_else() {
111113
fn handler(msg: &'static str) -> isize {
112114
if msg == "I got this." {
113115
50

branches/snap-stage3/src/librustc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The rustc crate itself consists of the following submodules
7171
- util: ubiquitous types and helper functions
7272
- lib: bindings to LLVM
7373

74-
The entry-point for the compiler is main() in the librustc_driver
74+
The entry-point for the compiler is main() in the librustc_trans
7575
crate.
7676

7777
The 3 central data structures:

branches/snap-stage3/src/librustc/diagnostics.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -355,22 +355,6 @@ enum Method { GET, POST }
355355
```
356356
"##,
357357

358-
E0265: r##"
359-
This error indicates that a static or constant references itself.
360-
All statics and constants need to resolve to a value in an acyclic manner.
361-
362-
For example, neither of the following can be sensibly compiled:
363-
364-
```
365-
const X: u32 = X;
366-
```
367-
368-
```
369-
const X: u32 = Y;
370-
const Y: u32 = X;
371-
```
372-
"##,
373-
374358
E0267: r##"
375359
This error indicates the use of loop keyword (break or continue) inside a
376360
closure but outside of any loop. Break and continue can be used as normal
@@ -516,6 +500,7 @@ register_diagnostics! {
516500
E0262, // illegal lifetime parameter name
517501
E0263, // lifetime name declared twice in same scope
518502
E0264, // unknown external lang item
503+
E0265, // recursive constant
519504
E0266, // expected item
520505
E0269, // not all control paths return a value
521506
E0270, // computation may converge in a function marked as diverging

branches/snap-stage3/src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(path_ext)]
4040
#![feature(str_char)]
4141
#![feature(into_cow)]
42-
#![feature(fs_canonicalize)]
4342
#![feature(slice_patterns)]
4443
#![cfg_attr(test, feature(test))]
4544

@@ -139,6 +138,7 @@ pub mod plugin;
139138
pub mod lint;
140139

141140
pub mod util {
141+
pub use rustc_back::fs;
142142
pub use rustc_back::sha2;
143143

144144
pub mod common;

0 commit comments

Comments
 (0)