Skip to content

Commit e3e6875

Browse files
committed
---
yaml --- r: 271815 b: refs/heads/auto c: 21a4d80 h: refs/heads/master i: 271813: fb726a8 271811: 217c8e7 271807: b0f6341
1 parent f3ffab3 commit e3e6875

Some content is hidden

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

45 files changed

+689
-288
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 93569acdbe09a63a670a5a5ad6bd0a2e2d8a90b9
11+
refs/heads/auto: 21a4d8098fe3e16ba59f7d3cd435551242e5ec6e
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ Some common make targets are:
132132
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
133133
rebuilding the entire compiler
134134
- `make check TESTNAME=<substring-of-test-name>` - Run a matching set of tests.
135-
- `TESTNAME` should be a substring of the tests to match against e.g. it could
136-
be the fully qualified test name, or just a part of it.
135+
- `TESTNAME` should be a substring of the tests to match against e.g. it could
136+
be the fully qualified test name, or just a part of it.
137137
`TESTNAME=collections::hash::map::test_map::test_capacity_not_less_than_len`
138138
or `TESTNAME=test_capacity_not_less_than_len`.
139139
- `make check-stage1-rpass TESTNAME=<substring-of-test-name>` - Run a single

branches/auto/mk/target.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8989
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
9090
--out-dir $$(@D) \
9191
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
92+
-C metadata=$$(CFG_FILENAME_EXTRA) \
9293
$$<
9394
@touch -r $$@.start_time $$@ && rm $$@.start_time
9495
$$(call LIST_ALL_OLD_GLOB_MATCHES, \

branches/auto/src/compiletest/runtest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,11 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testpaths: &TestP
727727
script_str.push_str("type category enable Rust\n");
728728

729729
// Set breakpoints on every line that contains the string "#break"
730+
let source_file_name = testpaths.file.file_name().unwrap().to_string_lossy();
730731
for line in &breakpoint_lines {
731-
script_str.push_str(&format!("breakpoint set --line {}\n", line));
732+
script_str.push_str(&format!("breakpoint set --file '{}' --line {}\n",
733+
source_file_name,
734+
line));
732735
}
733736

734737
// Append the other commands

branches/auto/src/doc/book/casting-between-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ function result.
1717
The most common case of coercion is removing mutability from a reference:
1818

1919
* `&mut T` to `&T`
20-
20+
2121
An analogous conversion is to remove mutability from a
2222
[raw pointer](raw-pointers.md):
2323

2424
* `*mut T` to `*const T`
25-
25+
2626
References can also be coerced to raw pointers:
2727

2828
* `&T` to `*const T`
@@ -32,7 +32,7 @@ References can also be coerced to raw pointers:
3232
Custom coercions may be defined using [`Deref`](deref-coercions.md).
3333

3434
Coercion is transitive.
35-
35+
3636
# `as`
3737

3838
The `as` keyword does safe casting:
@@ -64,7 +64,7 @@ A cast `e as U` is also valid in any of the following cases:
6464
and `U` is an integer type; *enum-cast*
6565
* `e` has type `bool` or `char` and `U` is an integer type; *prim-int-cast*
6666
* `e` has type `u8` and `U` is `char`; *u8-char-cast*
67-
67+
6868
For example
6969

7070
```rust
@@ -98,9 +98,9 @@ The semantics of numeric casts are:
9898

9999
[float-int]: https://github.com/rust-lang/rust/issues/10184
100100
[float-float]: https://github.com/rust-lang/rust/issues/15536
101-
101+
102102
## Pointer casts
103-
103+
104104
Perhaps surprisingly, it is safe to cast [raw pointers](raw-pointers.md) to and
105105
from integers, and to cast between pointers to different types subject to
106106
some constraints. It is only unsafe to dereference the pointer:
@@ -114,7 +114,7 @@ let b = a as u32;
114114

115115
* `e` has type `*T`, `U` has type `*U_0`, and either `U_0: Sized` or
116116
`unsize_kind(T) == unsize_kind(U_0)`; a *ptr-ptr-cast*
117-
117+
118118
* `e` has type `*T` and `U` is a numeric type, while `T: Sized`; *ptr-addr-cast*
119119

120120
* `e` is an integer and `U` is `*U_0`, while `U_0: Sized`; *addr-ptr-cast*

branches/auto/src/doc/book/closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,5 +502,5 @@ assert_eq!(6, answer);
502502
```
503503

504504
By making the inner closure a `move Fn`, we create a new stack frame for our
505-
closure. By `Box`ing it up, we’ve given it a known size, and allowing it to
505+
closure. By `Box`ing it up, we’ve given it a known size, allowing it to
506506
escape our stack frame.

branches/auto/src/doc/book/const-and-static.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ a [`Drop`][drop] implementation.
7272
# Initializing
7373

7474
Both `const` and `static` have requirements for giving them a value. They must
75-
be given a value that’s a constant expression. In other words, you cannot use
75+
be given a value that’s a constant expression. In other words, you cannot use
7676
the result of a function call or anything similarly complex or at runtime.
7777

7878
# Which construct should I use?

branches/auto/src/doc/book/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ first. This leaves the top-level project directory (in this case,
417417
to your code. In this way, using Cargo helps you keep your projects nice and
418418
tidy. There's a place for everything, and everything is in its place.
419419

420-
Now, copy *main.rs* to the *src* directory, and delete the compiled file you
420+
Now, move *main.rs* into the *src* directory, and delete the compiled file you
421421
created with `rustc`. As usual, replace `main` with `main.exe` if you're on
422422
Windows.
423423

branches/auto/src/doc/book/macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ fn main() {
337337
}
338338
```
339339

340-
Instead you need to pass the variable name into the invocation, so it’s tagged
341-
with the right syntax context.
340+
Instead you need to pass the variable name into the invocation, so that it’s
341+
tagged with the right syntax context.
342342

343343
```rust
344344
macro_rules! foo {
@@ -470,7 +470,7 @@ which syntactic form it matches.
470470
* `ty`: a type. Examples: `i32`; `Vec<(char, String)>`; `&T`.
471471
* `pat`: a pattern. Examples: `Some(t)`; `(17, 'a')`; `_`.
472472
* `stmt`: a single statement. Example: `let x = 3`.
473-
* `block`: a brace-delimited sequence of statements. Example:
473+
* `block`: a brace-delimited sequence of statements and optionally an expression. Example:
474474
`{ log(error, "hi"); return 12; }`.
475475
* `item`: an [item][item]. Examples: `fn foo() { }`; `struct Bar;`.
476476
* `meta`: a "meta item", as found in attributes. Example: `cfg(target_os = "windows")`.

branches/auto/src/doc/book/match.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ patterns][patterns] that covers all the patterns that are possible here.
2828

2929
[patterns]: patterns.html
3030

31-
One of the many advantages of `match` is it enforces ‘exhaustiveness checking’.
32-
For example if we remove the last arm with the underscore `_`, the compiler will
31+
One of the many advantages of `match` is it enforces ‘exhaustiveness checking’.
32+
For example if we remove the last arm with the underscore `_`, the compiler will
3333
give us an error:
3434

3535
```text
@@ -58,7 +58,7 @@ let number = match x {
5858
};
5959
```
6060

61-
Sometimes it’s a nice way of converting something from one type to another; in
61+
Sometimes it’s a nice way of converting something from one type to another; in
6262
this example the integers are converted to `String`.
6363

6464
# Matching on enums
@@ -90,7 +90,7 @@ fn process_message(msg: Message) {
9090

9191
Again, the Rust compiler checks exhaustiveness, so it demands that you
9292
have a match arm for every variant of the enum. If you leave one off, it
93-
will give you a compile-time error unless you use `_` or provide all possible
93+
will give you a compile-time error unless you use `_` or provide all possible
9494
arms.
9595

9696
Unlike the previous uses of `match`, you can’t use the normal `if`

branches/auto/src/doc/book/ownership.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ special annotation here, it’s the default thing that Rust does.
124124
## The details
125125

126126
The reason that we cannot use a binding after we’ve moved it is subtle, but
127-
important.
127+
important.
128128

129129
When we write code like this:
130130

@@ -148,7 +148,7 @@ The first line allocates memory for the vector object `v` on the stack like
148148
it does for `x` above. But in addition to that it also allocates some memory
149149
on the [heap][sh] for the actual data (`[1, 2, 3]`). Rust copies the address
150150
of this heap allocation to an internal pointer, which is part of the vector
151-
object placed on the stack (let's call it the data pointer).
151+
object placed on the stack (let's call it the data pointer).
152152

153153
It is worth pointing out (even at the risk of stating the obvious) that the
154154
vector object and its data live in separate memory regions instead of being a
@@ -163,7 +163,7 @@ does not create a copy of the heap allocation containing the actual data.
163163
Which means that there would be two pointers to the contents of the vector
164164
both pointing to the same memory allocation on the heap. It would violate
165165
Rust’s safety guarantees by introducing a data race if one could access both
166-
`v` and `v2` at the same time.
166+
`v` and `v2` at the same time.
167167

168168
For example if we truncated the vector to just two elements through `v2`:
169169

branches/auto/src/doc/book/primitive-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ copying. For example, you might want to reference only one line of a file read
164164
into memory. By nature, a slice is not created directly, but from an existing
165165
variable binding. Slices have a defined length, can be mutable or immutable.
166166

167-
Internally, slices are represented as a pointer to the beginning of the data
167+
Internally, slices are represented as a pointer to the beginning of the data
168168
and a length.
169169

170170
## Slicing syntax

branches/auto/src/doc/book/vectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ for i in v {
116116
```
117117

118118
Note: You cannot use the vector again once you have iterated by taking ownership of the vector.
119-
You can iterate the vector multiple times by taking a reference to the vector whilst iterating.
119+
You can iterate the vector multiple times by taking a reference to the vector whilst iterating.
120120
For example, the following code does not compile.
121121

122122
```rust,ignore

branches/auto/src/doc/style/features/traits/generics.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ explicitly implement to be used by this generic function.
2727
* _Inference_. Since the type parameters to generic functions can usually be
2828
inferred, generic functions can help cut down on verbosity in code where
2929
explicit conversions or other method calls would usually be necessary. See the
30-
[overloading/implicits use case](#use-case-limited-overloading-andor-implicit-conversions)
31-
below.
30+
overloading/implicits use case below.
3231
* _Precise types_. Because generics give a _name_ to the specific type
3332
implementing a trait, it is possible to be precise about places where that
3433
exact type is required or produced. For example, a function
@@ -51,7 +50,7 @@ explicitly implement to be used by this generic function.
5150
a `Vec<T>` contains elements of a single concrete type (and, indeed, the
5251
vector representation is specialized to lay these out in line). Sometimes
5352
heterogeneous collections are useful; see
54-
[trait objects](#use-case-trait-objects) below.
53+
trait objects below.
5554
* _Signature verbosity_. Heavy use of generics can bloat function signatures.
5655
**[Ed. note]** This problem may be mitigated by some language improvements; stay tuned.
5756

branches/auto/src/liballoc/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
107107
/// use std::thread;
108108
///
109109
/// fn main() {
110-
/// let numbers: Vec<_> = (0..100u32).collect();
110+
/// let numbers: Vec<_> = (0..100).collect();
111111
/// let shared_numbers = Arc::new(numbers);
112112
///
113113
/// for _ in 0..10 {
@@ -1118,7 +1118,7 @@ mod tests {
11181118

11191119
#[test]
11201120
fn test_strong_count() {
1121-
let a = Arc::new(0u32);
1121+
let a = Arc::new(0);
11221122
assert!(Arc::strong_count(&a) == 1);
11231123
let w = Arc::downgrade(&a);
11241124
assert!(Arc::strong_count(&a) == 1);
@@ -1135,7 +1135,7 @@ mod tests {
11351135

11361136
#[test]
11371137
fn test_weak_count() {
1138-
let a = Arc::new(0u32);
1138+
let a = Arc::new(0);
11391139
assert!(Arc::strong_count(&a) == 1);
11401140
assert!(Arc::weak_count(&a) == 0);
11411141
let w = Arc::downgrade(&a);
@@ -1161,7 +1161,7 @@ mod tests {
11611161

11621162
#[test]
11631163
fn show_arc() {
1164-
let a = Arc::new(5u32);
1164+
let a = Arc::new(5);
11651165
assert_eq!(format!("{:?}", a), "5");
11661166
}
11671167

branches/auto/src/liballoc/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ mod tests {
10141014

10151015
#[test]
10161016
fn test_strong_count() {
1017-
let a = Rc::new(0u32);
1017+
let a = Rc::new(0);
10181018
assert!(Rc::strong_count(&a) == 1);
10191019
let w = Rc::downgrade(&a);
10201020
assert!(Rc::strong_count(&a) == 1);
@@ -1031,7 +1031,7 @@ mod tests {
10311031

10321032
#[test]
10331033
fn test_weak_count() {
1034-
let a = Rc::new(0u32);
1034+
let a = Rc::new(0);
10351035
assert!(Rc::strong_count(&a) == 1);
10361036
assert!(Rc::weak_count(&a) == 0);
10371037
let w = Rc::downgrade(&a);

branches/auto/src/libcollections/linked_list.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,10 +1305,10 @@ mod tests {
13051305
//
13061306
// https://github.com/rust-lang/rust/issues/26021
13071307
let mut v1 = LinkedList::new();
1308-
v1.push_front(1u8);
1309-
v1.push_front(1u8);
1310-
v1.push_front(1u8);
1311-
v1.push_front(1u8);
1308+
v1.push_front(1);
1309+
v1.push_front(1);
1310+
v1.push_front(1);
1311+
v1.push_front(1);
13121312
let _ = v1.split_off(3); // Dropping this now should not cause laundry consumption
13131313
assert_eq!(v1.len(), 3);
13141314

@@ -1319,10 +1319,10 @@ mod tests {
13191319
#[test]
13201320
fn test_split_off() {
13211321
let mut v1 = LinkedList::new();
1322-
v1.push_front(1u8);
1323-
v1.push_front(1u8);
1324-
v1.push_front(1u8);
1325-
v1.push_front(1u8);
1322+
v1.push_front(1);
1323+
v1.push_front(1);
1324+
v1.push_front(1);
1325+
v1.push_front(1);
13261326

13271327
// test all splits
13281328
for ix in 0..1 + v1.len() {

branches/auto/src/libcollectionstest/slice.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ fn test_swap_remove_fail() {
267267
fn test_swap_remove_noncopyable() {
268268
// Tests that we don't accidentally run destructors twice.
269269
let mut v: Vec<Box<_>> = Vec::new();
270-
v.push(box 0u8);
271-
v.push(box 0u8);
272-
v.push(box 0u8);
270+
v.push(box 0);
271+
v.push(box 0);
272+
v.push(box 0);
273273
let mut _e = v.swap_remove(0);
274274
assert_eq!(v.len(), 2);
275275
_e = v.swap_remove(1);
@@ -884,7 +884,7 @@ fn test_overflow_does_not_cause_segfault_managed() {
884884

885885
#[test]
886886
fn test_mut_split_at() {
887-
let mut values = [1u8,2,3,4,5];
887+
let mut values = [1,2,3,4,5];
888888
{
889889
let (left, right) = values.split_at_mut(2);
890890
{

branches/auto/src/libcore/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ pub trait Iterator {
434434
/// `None`. Once `None` is encountered, `count()` returns the number of
435435
/// times it called [`next()`].
436436
///
437-
/// [`next()`]: #method.next
437+
/// [`next()`]: #tymethod.next
438438
///
439439
/// # Overflow Behavior
440440
///
@@ -497,7 +497,7 @@ pub trait Iterator {
497497
/// This method will evaluate the iterator `n` times, discarding those elements.
498498
/// After it does so, it will call [`next()`] and return its value.
499499
///
500-
/// [`next()`]: #method.next
500+
/// [`next()`]: #tymethod.next
501501
///
502502
/// Like most indexing operations, the count starts from zero, so `nth(0)`
503503
/// returns the first value, `nth(1)` the second, and so on.

branches/auto/src/librustc/session/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ impl NodeIdAssigner for Session {
348348
fn peek_node_id(&self) -> NodeId {
349349
self.next_node_id.get().checked_add(1).unwrap()
350350
}
351+
352+
fn diagnostic(&self) -> &errors::Handler {
353+
self.diagnostic()
354+
}
351355
}
352356

353357
fn split_msg_into_multilines(msg: &str) -> Option<String> {

branches/auto/src/librustc_front/lowering.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ use std::collections::HashMap;
6868
use std::iter;
6969
use syntax::ast::*;
7070
use syntax::attr::{ThinAttributes, ThinAttributesExt};
71+
use syntax::errors::Handler;
7172
use syntax::ext::mtwt;
7273
use syntax::ptr::P;
7374
use syntax::codemap::{respan, Spanned, Span};
@@ -140,6 +141,11 @@ impl<'a, 'hir> LoweringContext<'a> {
140141
result
141142
}
142143
}
144+
145+
// Panics if this LoweringContext's NodeIdAssigner is not able to emit diagnostics.
146+
fn diagnostic(&self) -> &Handler {
147+
self.id_assigner.diagnostic()
148+
}
143149
}
144150

145151
// Utility fn for setting and unsetting the cached id.
@@ -1289,7 +1295,8 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
12891295
make_struct(lctx, e, &["RangeInclusive", "NonEmpty"],
12901296
&[("start", e1), ("end", e2)]),
12911297

1292-
_ => panic!("impossible range in AST"),
1298+
_ => panic!(lctx.diagnostic().span_fatal(e.span,
1299+
"inclusive range with no end"))
12931300
}
12941301
});
12951302
}

0 commit comments

Comments
 (0)