Skip to content

Commit fc5506c

Browse files
committed
---
yaml --- r: 233417 b: refs/heads/beta c: f05b22e h: refs/heads/master i: 233415: b9304d1 v: v3
1 parent 9b25211 commit fc5506c

File tree

7 files changed

+62
-13
lines changed

7 files changed

+62
-13
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: ea7768c2dd8089cc3c3dc1e27158cf1bed277308
26+
refs/heads/beta: f05b22efb5e739b92b47527d29c5fa903f7e64b6
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libcore/iter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ pub trait Iterator {
616616

617617
/// Tests whether the predicate holds true for all elements in the iterator.
618618
///
619+
/// Does not consume the iterator past the first non-matching element.
620+
///
619621
/// # Examples
620622
///
621623
/// ```

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,25 @@ struct Bar<S, T> { x: Foo<S, T> }
23652365
```
23662366
"##,
23672367

2368+
E0248: r##"
2369+
This error indicates an attempt to use a value where a type is expected. For
2370+
example:
2371+
2372+
```
2373+
enum Foo {
2374+
Bar(u32)
2375+
}
2376+
2377+
fn do_something(x: Foo::Bar) { }
2378+
```
2379+
2380+
In this example, we're attempting to take a type of `Foo::Bar` in the
2381+
do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
2382+
not a distinct static type. Likewise, it's not legal to attempt to
2383+
`impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
2384+
behaviour for specific enum variants.
2385+
"##,
2386+
23682387
E0249: r##"
23692388
This error indicates a constant expression for the array length was found, but
23702389
it was not an integer (signed or unsigned) expression.
@@ -2756,7 +2775,6 @@ register_diagnostics! {
27562775
E0245, // not a trait
27572776
E0246, // invalid recursive type
27582777
E0247, // found module name used as a type
2759-
E0248, // found value name used as a type
27602778
E0319, // trait impls for defaulted traits allowed just for structs/enums
27612779
E0320, // recursive overflow during dropck
27622780
E0321, // extended coherence rules for defaulted traits violated

branches/beta/src/libsyntax/ext/expand.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,7 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
385385
// expand <head>
386386
let head = fld.fold_expr(head);
387387

388-
// create an hygienic ident
389-
let iter = {
390-
let ident = fld.cx.ident_of("iter");
391-
let new_ident = fresh_name(&ident);
392-
let rename = (ident, new_ident);
393-
let mut rename_list = vec![rename];
394-
let mut rename_fld = IdentRenamer{ renames: &mut rename_list };
395-
396-
rename_fld.fold_ident(ident)
397-
};
388+
let iter = token::gensym_ident("iter");
398389

399390
let pat_span = fld.new_span(pat.span);
400391
// `::std::option::Option::Some(<pat>) => <body>`

branches/beta/src/libsyntax/ext/tt/transcribe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
305305
}
306306
MatchedSeq(..) => {
307307
panic!(r.sp_diag.span_fatal(
308-
r.cur_span, /* blame the macro writer */
308+
sp, /* blame the macro writer */
309309
&format!("variable '{}' is still repeating at this depth",
310310
ident)));
311311
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
macro_rules! mac {
12+
( $($v:tt)* ) => (
13+
$v //~ ERROR still repeating at this depth
14+
)
15+
}
16+
17+
fn main() {
18+
mac!(0);
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-pretty
12+
13+
fn main() {
14+
const iter: i32 = 0;
15+
16+
for i in 1..10 {
17+
println!("{}", i);
18+
}
19+
}

0 commit comments

Comments
 (0)