Skip to content

Commit 35b4a93

Browse files
committed
---
yaml --- r: 129567 b: refs/heads/snap-stage3 c: 9669c6d h: refs/heads/master i: 129565: d2462a4 129563: 2c1bc2b 129559: 306c301 129551: 40922b5 129535: ffc8fbd v: v3
1 parent 188bad4 commit 35b4a93

File tree

79 files changed

+162
-310
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

+162
-310
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: 566b470e138e929e8a93d613372db1ba177c494f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7bfcace03be0963c5c56efc56f1cb0f4992fe18e
4+
refs/heads/snap-stage3: 9669c6dc1a7299dd01ddce50c0e5eae66465474d
55
refs/heads/try: 80b45ddbd351f0a4a939c3a3c4e20b4defec4b35
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,8 +2799,7 @@ be named, by convention.
27992799
Next, we added an `extern crate modules` to the top of our `src/main.rs`. This,
28002800
as you can guess, lets Rust know that our crate relies on another, external
28012801
crate. We also had to modify our call to `print_hello`: now that it's in
2802-
another crate, we need to first specify the crate, then the module inside of it,
2803-
then the function name.
2802+
another crate, we need to specify that crate first.
28042803

28052804
This doesn't _quite_ work yet. Try it:
28062805

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

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

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

899898
An _`extern crate` declaration_ specifies a dependency on an external crate.
@@ -913,11 +912,9 @@ Four examples of `extern crate` declarations:
913912
~~~~ {.ignore}
914913
extern crate pcre;
915914
916-
extern crate std; // equivalent to: extern crate std = "std";
915+
extern crate std; // equivalent to: extern crate std as std;
917916
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
917+
extern crate "std" as ruststd; // linking to 'std' under another name
921918
~~~~
922919

923920
##### Use declarations

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

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

2626
#![crate_name = "glob"]
27-
#![experimental]
27+
#![deprecated = "This is now a cargo package located at: \
28+
https://github.com/rust-lang/glob"]
2829
#![crate_type = "rlib"]
2930
#![crate_type = "dylib"]
3031
#![license = "MIT/ASL2"]
3132
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
3233
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3334
html_root_url = "http://doc.rust-lang.org/master/",
3435
html_playground_url = "http://play.rust-lang.org/")]
36+
#![allow(deprecated)]
3537

3638
use std::cell::Cell;
3739
use std::{cmp, os, path};
@@ -64,6 +66,7 @@ pub struct Paths {
6466
/// `puppies.jpg` and `hamsters.gif`:
6567
///
6668
/// ```rust
69+
/// # #![allow(deprecated)]
6770
/// use glob::glob;
6871
///
6972
/// for path in glob("/media/pictures/*.jpg") {

branches/snap-stage3/src/librustc/lint/builtin.rs

Lines changed: 8 additions & 4 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.char_at(0).is_lowercase() && !ident.contains_char('_')
757+
ident.len() > 0 && !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
758758
}
759759

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

770770
if !is_camel_case(ident) {
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());
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());
774778
}
775779
}
776780

branches/snap-stage3/src/librustc/middle/intrinsicck.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,25 @@ 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+
};
7680
if def_id.krate == ast::LOCAL_CRATE {
7781
match self.tcx.map.get(def_id.node) {
78-
NodeForeignItem(ref item) => {
82+
NodeForeignItem(ref item) if intrinsic => {
7983
token::get_ident(item.ident) ==
8084
token::intern_and_get_ident("transmute")
8185
}
8286
_ => false,
8387
}
8488
} else {
8589
match csearch::get_item_path(self.tcx, def_id).last() {
86-
None => false,
87-
Some(ref last) => {
90+
Some(ref last) if intrinsic => {
8891
token::get_name(last.name()) ==
8992
token::intern_and_get_ident("transmute")
9093
}
94+
_ => false,
9195
}
9296
}
9397
}

branches/snap-stage3/src/libsyntax/parse/parser.rs

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

48264829
self.expect(&token::SEMI);
48274830
(path, the_ident)
4828-
}
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+
},
48294839
_ => {
48304840
let span = self.span;
48314841
let token_str = self.this_token_to_string();

branches/snap-stage3/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));
23672366
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, "="));
2369+
try!(word(&mut self.s, "as"));
23702370
try!(space(&mut self.s));
2371-
try!(self.print_string(p.get(), style));
23722371
}
2372+
try!(self.print_ident(id));
23732373
}
23742374

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

branches/snap-stage3/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 = "crateresolve4a#0.2";
16+
extern crate "crateresolve4a#0.2" as crateresolve4a;
1717

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

branches/snap-stage3/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 = "crateresolve4a#0.1";
16+
extern crate "crateresolve4a#0.1" as crateresolve4a;
1717

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

branches/snap-stage3/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 a = "issue-12133-rlib";
16-
extern crate b = "issue-12133-dylib";
15+
extern crate "issue-12133-rlib" as a;
16+
extern crate "issue-12133-dylib" as b;
1717

branches/snap-stage3/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 t1 = "issue-13560-1";
17-
#[phase(plugin, link)] extern crate t2 = "issue-13560-2";
16+
#[phase(plugin)] extern crate "issue-13560-1" as t1;
17+
#[phase(plugin, link)] extern crate "issue-13560-2" as t2;
1818

branches/snap-stage3/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 crate1 = "issue-13620-1";
11+
extern crate "issue-13620-1" as crate1;
1212

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

branches/snap-stage3/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 foo = "issue-13872-1";
11+
extern crate "issue-13872-1" as foo;
1212

1313
pub use foo::B;

branches/snap-stage3/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 bar = "issue-13872-2";
11+
extern crate "issue-13872-2" as bar;
1212

1313
use bar::B;
1414

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 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+
#![crate_type = "lib"]
12+
13+
extern {
14+
pub fn transmute();
15+
}

branches/snap-stage3/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 other = "syntax-extension-with-dll-deps-1";
17+
extern crate "syntax-extension-with-dll-deps-1" as other;
1818
extern crate syntax;
1919
extern crate rustc;
2020

branches/snap-stage3/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 aux = "trait_default_method_xc_aux";
13+
extern crate "trait_default_method_xc_aux" as aux;
1414
use aux::A;
1515

1616
pub struct a_struct { pub x: int }

branches/snap-stage3/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 foo = ""; //~ ERROR: crate name must not be empty
11+
extern crate "" as foo; //~ ERROR: crate name must not be empty
1212

1313
fn main() {}

branches/snap-stage3/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 bar = "#a"; //~ ERROR: invalid character `#` in crate name: `#a`
11+
extern crate "#a" as bar; //~ ERROR: invalid character `#` in crate name: `#a`
1212

1313
fn main() {}
1414

branches/snap-stage3/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 other = "issue-11680";
13+
extern crate "issue-11680" as other;
1414

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

branches/snap-stage3/src/test/compile-fail/issue-12612.rs

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

1111
// aux-build:issue-12612-1.rs
1212

13-
extern crate foo = "issue-12612-1";
13+
extern crate "issue-12612-1" as foo;
1414

1515
use foo::bar;
1616

branches/snap-stage3/src/test/compile-fail/lint-non-camel-case-types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ struct foo7 {
3737
bar: int,
3838
}
3939

40+
type __ = int; //~ ERROR type `__` should have a camel case name such as `CamelCase`
41+
4042
fn main() { }

branches/snap-stage3/src/test/compile-fail/privacy-struct-variant.rs

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

1313
#![feature(struct_variant)]
1414

15-
extern crate other = "privacy-struct-variant";
15+
extern crate "privacy-struct-variant" as other;
1616

1717
mod a {
1818
pub enum Foo {

branches/snap-stage3/src/test/compile-fail/privacy5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// aux-build:privacy-tuple-struct.rs
1212
// ignore-fast
1313

14-
extern crate other = "privacy-tuple-struct";
14+
extern crate "privacy-tuple-struct" as other;
1515

1616
mod a {
1717
pub struct A(());

branches/snap-stage3/src/test/compile-fail/struct-field-privacy.rs

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

1111
// aux-build:struct-field-privacy.rs
1212

13-
extern crate xc = "struct-field-privacy";
13+
extern crate "struct-field-privacy" as xc;
1414

1515
struct A {
1616
a: int,

branches/snap-stage3/src/test/compile-fail/unreachable-variant.rs

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

1111
// aux-build:unreachable-variant.rs
1212

13-
extern crate other = "unreachable-variant";
13+
extern crate "unreachable-variant" as other;
1414

1515
fn main() {
1616
let _x = other::super_sekrit::baz; //~ ERROR is private

branches/snap-stage3/src/test/compile-fail/use-meta-mismatch.rs

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

1111
// error-pattern:can't find crate for `extra`
1212

13-
extern crate extra = "fake-crate";
13+
extern crate "fake-crate" as extra;
1414

1515
fn main() { }

branches/snap-stage3/src/test/compile-fail/weak-lang-item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
#![no_std]
1717

1818
extern crate core;
19-
extern crate other = "weak-lang-items";
19+
extern crate "weak-lang-items" as other;

branches/snap-stage3/src/test/pretty/issue-4264.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#![no_std]
33
#![feature(globs)]
44
#[phase(plugin, link)]
5-
extern crate std = "std";
6-
extern crate rt = "native";
5+
extern crate "std" as std;
6+
extern crate "native" as rt;
77
#[prelude_import]
88
use std::prelude::*;
99
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT

branches/snap-stage3/src/test/pretty/raw-str-nonexpr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#![feature(asm)]
1414

1515
#[cfg = r#"just parse this"#]
16-
extern crate blah = r##"blah"##;
16+
extern crate r##"blah"## as blah;
1717

1818
fn main() { unsafe { asm!(r###"blah"###); } }

branches/snap-stage3/src/test/run-pass-fulldeps/issue-13560.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// Regression test for issue #13560, the test itself is all in the dependent
1717
// libraries. The fail which previously failed to compile is the one numbered 3.
1818

19-
extern crate t2 = "issue-13560-2";
20-
extern crate t3 = "issue-13560-3";
19+
extern crate "issue-13560-2" as t2;
20+
extern crate "issue-13560-3" as t3;
2121

2222
fn main() {}

0 commit comments

Comments
 (0)