Skip to content

Commit 1e01b84

Browse files
committed
---
yaml --- r: 129583 b: refs/heads/master c: 7bfcace h: refs/heads/master i: 129581: 8f4ce91 129579: a56a623 129575: b265d7d 129567: 35b4a93 v: v3
1 parent 73dfeca commit 1e01b84

File tree

79 files changed

+331
-188
lines changed

Some content is hidden

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

79 files changed

+331
-188
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c73ab0c10b194d235a8a1aa18808125537c371d5
2+
refs/heads/master: 7bfcace03be0963c5c56efc56f1cb0f4992fe18e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 0d3bd7720c50e3ada4bac77331d43926493be4fe
55
refs/heads/try: 80b45ddbd351f0a4a939c3a3c4e20b4defec4b35

trunk/src/doc/guide.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ Try it out:
18131813

18141814
```{notrust,ignore}
18151815
$ cargo run
1816-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1816+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
18171817
Running `target/guessing_game`
18181818
Hello, world!
18191819
```
@@ -1955,17 +1955,12 @@ fn main() {
19551955
}
19561956
```
19571957

1958-
... and then recompile:
1958+
Try running our new program a few times:
19591959

19601960
```{notrust,ignore}
1961-
$ cargo build
1962-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1963-
```
1964-
1965-
Excellent! Try running our new program a few times:
1966-
1967-
```{notrust,ignore}
1968-
$ ./target/guessing_game
1961+
$ cargo run
1962+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
1963+
Running `target/guessing_game`
19691964
Guess the number!
19701965
The secret number is: 7
19711966
Please input your guess.
@@ -2016,9 +2011,9 @@ fn main() {
20162011
And trying it out:
20172012

20182013
```{notrust,ignore}
2019-
$ cargo build
2020-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2021-
$ ./target/guessing_game
2014+
$ cargo run
2015+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2016+
Running `target/guessing_game`
20222017
Guess the number!
20232018
The secret number is: 57
20242019
Please input your guess.
@@ -2287,9 +2282,9 @@ We use a `match` to either give us the `uint` inside of the `Option`, or we
22872282
print an error message and return. Let's give this a shot:
22882283

22892284
```{notrust,ignore}
2290-
$ cargo build
2291-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2292-
$ ./target/guessing_game
2285+
$ cargo run
2286+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2287+
Running `target/guessing_game`
22932288
Guess the number!
22942289
The secret number is: 17
22952290
Please input your guess.
@@ -2352,9 +2347,9 @@ fn cmp(a: uint, b: uint) -> Ordering {
23522347
Let's try it!
23532348

23542349
```{notrust,ignore}
2355-
$ cargo build
2356-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2357-
$ ./target/guessing_game
2350+
$ cargo run
2351+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2352+
Running `target/guessing_game`
23582353
Guess the number!
23592354
The secret number is: 58
23602355
Please input your guess.
@@ -2429,9 +2424,9 @@ And try it out. But wait, didn't we just add an infinite loop? Yup. Remember
24292424
that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24302425

24312426
```{notrust,ignore}
2432-
$ cargo build
2433-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2434-
$ ./target/guessing_game
2427+
$ cargo run
2428+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2429+
Running `target/guessing_game`
24352430
Guess the number!
24362431
The secret number is: 59
24372432
Please input your guess.
@@ -2560,10 +2555,10 @@ fn cmp(a: uint, b: uint) -> Ordering {
25602555

25612556
Now we should be good! Let's try:
25622557

2563-
```{rust,ignore}
2564-
$ cargo build
2565-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2566-
$ ./target/guessing_game
2558+
```{notrust,ignore}
2559+
$ cargo run
2560+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2561+
Running `target/guessing_game`
25672562
Guess the number!
25682563
The secret number is: 61
25692564
Please input your guess.
@@ -2804,7 +2799,8 @@ be named, by convention.
28042799
Next, we added an `extern crate modules` to the top of our `src/main.rs`. This,
28052800
as you can guess, lets Rust know that our crate relies on another, external
28062801
crate. We also had to modify our call to `print_hello`: now that it's in
2807-
another crate, we need to specify that crate first.
2802+
another crate, we need to first specify the crate, then the module inside of it,
2803+
then the function name.
28082804

28092805
This doesn't _quite_ work yet. Try it:
28102806

trunk/src/doc/rust.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,9 @@ There are several kinds of view item:
891891
##### Extern crate declarations
892892

893893
~~~~ {.ebnf .gram}
894-
extern_crate_decl : "extern" "crate" crate_name
895-
crate_name: ident | ( string_lit as ident )
894+
extern_crate_decl : "extern" "crate" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
895+
link_attrs : link_attr [ ',' link_attrs ] + ;
896+
link_attr : ident '=' literal ;
896897
~~~~
897898

898899
An _`extern crate` declaration_ specifies a dependency on an external crate.
@@ -912,9 +913,11 @@ Four examples of `extern crate` declarations:
912913
~~~~ {.ignore}
913914
extern crate pcre;
914915
915-
extern crate std; // equivalent to: extern crate std as std;
916+
extern crate std; // equivalent to: extern crate std = "std";
916917
917-
extern crate "std" as ruststd; // linking to 'std' under another name
918+
extern crate ruststd = "std"; // linking to 'std' under another name
919+
920+
extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for external tools
918921
~~~~
919922

920923
##### Use declarations

trunk/src/libglob/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
*/
2525

2626
#![crate_name = "glob"]
27-
#![deprecated = "This is now a cargo package located at: \
28-
https://github.com/rust-lang/glob"]
27+
#![experimental]
2928
#![crate_type = "rlib"]
3029
#![crate_type = "dylib"]
3130
#![license = "MIT/ASL2"]
3231
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
3332
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3433
html_root_url = "http://doc.rust-lang.org/master/",
3534
html_playground_url = "http://play.rust-lang.org/")]
36-
#![allow(deprecated)]
3735

3836
use std::cell::Cell;
3937
use std::{cmp, os, path};
@@ -66,7 +64,6 @@ pub struct Paths {
6664
/// `puppies.jpg` and `hamsters.gif`:
6765
///
6866
/// ```rust
69-
/// # #![allow(deprecated)]
7067
/// use glob::glob;
7168
///
7269
/// for path in glob("/media/pictures/*.jpg") {

trunk/src/librustc/lint/builtin.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ impl LintPass for NonCamelCaseTypes {
754754

755755
// start with a non-lowercase letter rather than non-uppercase
756756
// ones (some scripts don't have a concept of upper/lowercase)
757-
ident.len() > 0 && !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
757+
!ident.char_at(0).is_lowercase() && !ident.contains_char('_')
758758
}
759759

760760
fn to_camel_case(s: &str) -> String {
@@ -768,13 +768,9 @@ impl LintPass for NonCamelCaseTypes {
768768
let s = token::get_ident(ident);
769769

770770
if !is_camel_case(ident) {
771-
let c = to_camel_case(s.get());
772-
let m = if c.is_empty() {
773-
format!("{} `{}` should have a camel case name such as `CamelCase`", sort, s)
774-
} else {
775-
format!("{} `{}` should have a camel case name such as `{}`", sort, s, c)
776-
};
777-
cx.span_lint(NON_CAMEL_CASE_TYPES, span, m.as_slice());
771+
cx.span_lint(NON_CAMEL_CASE_TYPES, span,
772+
format!("{} `{}` should have a camel case name such as `{}`",
773+
sort, s, to_camel_case(s.get())).as_slice());
778774
}
779775
}
780776

trunk/src/librustc/middle/intrinsicck.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,21 @@ struct IntrinsicCheckingVisitor<'a> {
7373

7474
impl<'a> IntrinsicCheckingVisitor<'a> {
7575
fn def_id_is_transmute(&self, def_id: DefId) -> bool {
76-
let intrinsic = match ty::get(ty::lookup_item_type(self.tcx, def_id).ty).sty {
77-
ty::ty_bare_fn(ref bfty) => bfty.abi == RustIntrinsic,
78-
_ => return false
79-
};
8076
if def_id.krate == ast::LOCAL_CRATE {
8177
match self.tcx.map.get(def_id.node) {
82-
NodeForeignItem(ref item) if intrinsic => {
78+
NodeForeignItem(ref item) => {
8379
token::get_ident(item.ident) ==
8480
token::intern_and_get_ident("transmute")
8581
}
8682
_ => false,
8783
}
8884
} else {
8985
match csearch::get_item_path(self.tcx, def_id).last() {
90-
Some(ref last) if intrinsic => {
86+
None => false,
87+
Some(ref last) => {
9188
token::get_name(last.name()) ==
9289
token::intern_and_get_ident("transmute")
9390
}
94-
_ => false,
9591
}
9692
}
9793
}

trunk/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,8 +4807,7 @@ impl<'a> Parser<'a> {
48074807
/// # Example
48084808
///
48094809
/// extern crate url;
4810-
/// extern crate foo = "bar"; //deprecated
4811-
/// extern crate "bar" as foo;
4810+
/// extern crate foo = "bar";
48124811
fn parse_item_extern_crate(&mut self,
48134812
lo: BytePos,
48144813
visibility: Visibility,
@@ -4819,23 +4818,14 @@ impl<'a> Parser<'a> {
48194818
token::IDENT(..) => {
48204819
let the_ident = self.parse_ident();
48214820
self.expect_one_of(&[], &[token::EQ, token::SEMI]);
4822-
// NOTE - #16689 change this to a warning once
4823-
// the 'as' support is in stage0
48244821
let path = if self.token == token::EQ {
48254822
self.bump();
48264823
Some(self.parse_str())
48274824
} else {None};
48284825

48294826
self.expect(&token::SEMI);
48304827
(path, the_ident)
4831-
},
4832-
token::LIT_STR(..) | token::LIT_STR_RAW(..) => {
4833-
let path = self.parse_str();
4834-
self.expect_keyword(keywords::As);
4835-
let the_ident = self.parse_ident();
4836-
self.expect(&token::SEMI);
4837-
(Some(path), the_ident)
4838-
},
4828+
}
48394829
_ => {
48404830
let span = self.span;
48414831
let token_str = self.this_token_to_string();

trunk/src/libsyntax/print/pprust.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,13 +2363,13 @@ impl<'a> State<'a> {
23632363
match item.node {
23642364
ast::ViewItemExternCrate(id, ref optional_path, _) => {
23652365
try!(self.head("extern crate"));
2366+
try!(self.print_ident(id));
23662367
for &(ref p, style) in optional_path.iter() {
2367-
try!(self.print_string(p.get(), style));
23682368
try!(space(&mut self.s));
2369-
try!(word(&mut self.s, "as"));
2369+
try!(word(&mut self.s, "="));
23702370
try!(space(&mut self.s));
2371+
try!(self.print_string(p.get(), style));
23712372
}
2372-
try!(self.print_ident(id));
23732373
}
23742374

23752375
ast::ViewItemUse(ref vp) => {

trunk/src/test/auxiliary/crateresolve4b-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#![crate_id="crateresolve4b#0.1"]
1414
#![crate_type = "lib"]
1515

16-
extern crate "crateresolve4a#0.2" as crateresolve4a;
16+
extern crate crateresolve4a = "crateresolve4a#0.2";
1717

1818
pub fn f() -> int { crateresolve4a::g() }

trunk/src/test/auxiliary/crateresolve4b-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#![crate_id="crateresolve4b#0.2"]
1414
#![crate_type = "lib"]
1515

16-
extern crate "crateresolve4a#0.1" as crateresolve4a;
16+
extern crate crateresolve4a = "crateresolve4a#0.1";
1717

1818
pub fn g() -> int { crateresolve4a::f() }

trunk/src/test/auxiliary/issue-12133-dylib2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
#![crate_type = "dylib"]
1414

15-
extern crate "issue-12133-rlib" as a;
16-
extern crate "issue-12133-dylib" as b;
15+
extern crate a = "issue-12133-rlib";
16+
extern crate b = "issue-12133-dylib";
1717

trunk/src/test/auxiliary/issue-13560-3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#![crate_type = "rlib"]
1414
#![feature(phase)]
1515

16-
#[phase(plugin)] extern crate "issue-13560-1" as t1;
17-
#[phase(plugin, link)] extern crate "issue-13560-2" as t2;
16+
#[phase(plugin)] extern crate t1 = "issue-13560-1";
17+
#[phase(plugin, link)] extern crate t2 = "issue-13560-2";
1818

trunk/src/test/auxiliary/issue-13620-2.rs

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

11-
extern crate "issue-13620-1" as crate1;
11+
extern crate crate1 = "issue-13620-1";
1212

1313
pub static FOO2: crate1::Foo = crate1::FOO;

trunk/src/test/auxiliary/issue-13872-2.rs

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

11-
extern crate "issue-13872-1" as foo;
11+
extern crate foo = "issue-13872-1";
1212

1313
pub use foo::B;

trunk/src/test/auxiliary/issue-13872-3.rs

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

11-
extern crate "issue-13872-2" as bar;
11+
extern crate bar = "issue-13872-2";
1212

1313
use bar::B;
1414

trunk/src/test/auxiliary/issue-15562.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

trunk/src/test/auxiliary/syntax-extension-with-dll-deps-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![crate_type = "dylib"]
1515
#![feature(plugin_registrar, quote, globs)]
1616

17-
extern crate "syntax-extension-with-dll-deps-1" as other;
17+
extern crate other = "syntax-extension-with-dll-deps-1";
1818
extern crate syntax;
1919
extern crate rustc;
2020

trunk/src/test/auxiliary/trait_default_method_xc_aux_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:trait_default_method_xc_aux.rs
1212

13-
extern crate "trait_default_method_xc_aux" as aux;
13+
extern crate aux = "trait_default_method_xc_aux";
1414
use aux::A;
1515

1616
pub struct a_struct { pub x: int }

trunk/src/test/compile-fail/bad-crate-id.rs

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

11-
extern crate "" as foo; //~ ERROR: crate name must not be empty
11+
extern crate foo = ""; //~ ERROR: crate name must not be empty
1212

1313
fn main() {}

trunk/src/test/compile-fail/bad-crate-id2.rs

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

11-
extern crate "#a" as bar; //~ ERROR: invalid character `#` in crate name: `#a`
11+
extern crate bar = "#a"; //~ ERROR: invalid character `#` in crate name: `#a`
1212

1313
fn main() {}
1414

trunk/src/test/compile-fail/issue-11680.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:issue-11680.rs
1212

13-
extern crate "issue-11680" as other;
13+
extern crate other = "issue-11680";
1414

1515
fn main() {
1616
let _b = other::Bar(1);

0 commit comments

Comments
 (0)