extern crate foobar as foo;
Implements remaining part of RFC #47. Addresses issue #16461. Removed link_attrs from rust.md, they don't appear to be supported by the parser. Changed all the tests to use the new extern crate syntax Change pretty printer to use 'as' syntax
This commit is contained in:
parent
6843d8ccd5
commit
c0e003d5ad
70 changed files with 96 additions and 89 deletions
|
@ -891,9 +891,8 @@ There are several kinds of view item:
|
||||||
##### Extern crate declarations
|
##### Extern crate declarations
|
||||||
|
|
||||||
~~~~ {.ebnf .gram}
|
~~~~ {.ebnf .gram}
|
||||||
extern_crate_decl : "extern" "crate" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
|
extern_crate_decl : "extern" "crate" crate_name
|
||||||
link_attrs : link_attr [ ',' link_attrs ] + ;
|
crate_name: ident | ( string_lit as ident )
|
||||||
link_attr : ident '=' literal ;
|
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
An _`extern crate` declaration_ specifies a dependency on an external crate.
|
An _`extern crate` declaration_ specifies a dependency on an external crate.
|
||||||
|
@ -913,11 +912,9 @@ Four examples of `extern crate` declarations:
|
||||||
~~~~ {.ignore}
|
~~~~ {.ignore}
|
||||||
extern crate pcre;
|
extern crate pcre;
|
||||||
|
|
||||||
extern crate std; // equivalent to: extern crate std = "std";
|
extern crate std; // equivalent to: extern crate std as std;
|
||||||
|
|
||||||
extern crate ruststd = "std"; // linking to 'std' under another name
|
extern crate "std" as ruststd; // linking to 'std' under another name
|
||||||
|
|
||||||
extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for external tools
|
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
##### Use declarations
|
##### Use declarations
|
||||||
|
|
|
@ -4825,7 +4825,8 @@ impl<'a> Parser<'a> {
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// extern crate url;
|
/// extern crate url;
|
||||||
/// extern crate foo = "bar";
|
/// extern crate foo = "bar"; //deprecated
|
||||||
|
/// extern crate "bar" as foo;
|
||||||
fn parse_item_extern_crate(&mut self,
|
fn parse_item_extern_crate(&mut self,
|
||||||
lo: BytePos,
|
lo: BytePos,
|
||||||
visibility: Visibility,
|
visibility: Visibility,
|
||||||
|
@ -4836,6 +4837,8 @@ impl<'a> Parser<'a> {
|
||||||
token::IDENT(..) => {
|
token::IDENT(..) => {
|
||||||
let the_ident = self.parse_ident();
|
let the_ident = self.parse_ident();
|
||||||
self.expect_one_of(&[], &[token::EQ, token::SEMI]);
|
self.expect_one_of(&[], &[token::EQ, token::SEMI]);
|
||||||
|
// NOTE - #16689 change this to a warning once
|
||||||
|
// the 'as' support is in stage0
|
||||||
let path = if self.token == token::EQ {
|
let path = if self.token == token::EQ {
|
||||||
self.bump();
|
self.bump();
|
||||||
Some(self.parse_str())
|
Some(self.parse_str())
|
||||||
|
@ -4843,7 +4846,14 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
self.expect(&token::SEMI);
|
self.expect(&token::SEMI);
|
||||||
(path, the_ident)
|
(path, the_ident)
|
||||||
}
|
},
|
||||||
|
token::LIT_STR(..) | token::LIT_STR_RAW(..) => {
|
||||||
|
let path = self.parse_str();
|
||||||
|
self.expect_keyword(keywords::As);
|
||||||
|
let the_ident = self.parse_ident();
|
||||||
|
self.expect(&token::SEMI);
|
||||||
|
(Some(path), the_ident)
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
let span = self.span;
|
let span = self.span;
|
||||||
let token_str = self.this_token_to_string();
|
let token_str = self.this_token_to_string();
|
||||||
|
|
|
@ -2375,13 +2375,13 @@ impl<'a> State<'a> {
|
||||||
match item.node {
|
match item.node {
|
||||||
ast::ViewItemExternCrate(id, ref optional_path, _) => {
|
ast::ViewItemExternCrate(id, ref optional_path, _) => {
|
||||||
try!(self.head("extern crate"));
|
try!(self.head("extern crate"));
|
||||||
try!(self.print_ident(id));
|
|
||||||
for &(ref p, style) in optional_path.iter() {
|
for &(ref p, style) in optional_path.iter() {
|
||||||
try!(space(&mut self.s));
|
|
||||||
try!(word(&mut self.s, "="));
|
|
||||||
try!(space(&mut self.s));
|
|
||||||
try!(self.print_string(p.get(), style));
|
try!(self.print_string(p.get(), style));
|
||||||
|
try!(space(&mut self.s));
|
||||||
|
try!(word(&mut self.s, "as"));
|
||||||
|
try!(space(&mut self.s));
|
||||||
}
|
}
|
||||||
|
try!(self.print_ident(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ViewItemUse(ref vp) => {
|
ast::ViewItemUse(ref vp) => {
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
#![crate_id="crateresolve4b#0.1"]
|
#![crate_id="crateresolve4b#0.1"]
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
extern crate crateresolve4a = "crateresolve4a#0.2";
|
extern crate "crateresolve4a#0.2" as crateresolve4a;
|
||||||
|
|
||||||
pub fn f() -> int { crateresolve4a::g() }
|
pub fn f() -> int { crateresolve4a::g() }
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
#![crate_id="crateresolve4b#0.2"]
|
#![crate_id="crateresolve4b#0.2"]
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
extern crate crateresolve4a = "crateresolve4a#0.1";
|
extern crate "crateresolve4a#0.1" as crateresolve4a;
|
||||||
|
|
||||||
pub fn g() -> int { crateresolve4a::f() }
|
pub fn g() -> int { crateresolve4a::f() }
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
|
|
||||||
#![crate_type = "dylib"]
|
#![crate_type = "dylib"]
|
||||||
|
|
||||||
extern crate a = "issue-12133-rlib";
|
extern crate "issue-12133-rlib" as a;
|
||||||
extern crate b = "issue-12133-dylib";
|
extern crate "issue-12133-dylib" as b;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
#![feature(phase)]
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(plugin)] extern crate t1 = "issue-13560-1";
|
#[phase(plugin)] extern crate "issue-13560-1" as t1;
|
||||||
#[phase(plugin, link)] extern crate t2 = "issue-13560-2";
|
#[phase(plugin, link)] extern crate "issue-13560-2" as t2;
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate crate1 = "issue-13620-1";
|
extern crate "issue-13620-1" as crate1;
|
||||||
|
|
||||||
pub static FOO2: crate1::Foo = crate1::FOO;
|
pub static FOO2: crate1::Foo = crate1::FOO;
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate foo = "issue-13872-1";
|
extern crate "issue-13872-1" as foo;
|
||||||
|
|
||||||
pub use foo::B;
|
pub use foo::B;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate bar = "issue-13872-2";
|
extern crate "issue-13872-2" as bar;
|
||||||
|
|
||||||
use bar::B;
|
use bar::B;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#![crate_type = "dylib"]
|
#![crate_type = "dylib"]
|
||||||
#![feature(plugin_registrar, quote, globs)]
|
#![feature(plugin_registrar, quote, globs)]
|
||||||
|
|
||||||
extern crate other = "syntax-extension-with-dll-deps-1";
|
extern crate "syntax-extension-with-dll-deps-1" as other;
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:trait_default_method_xc_aux.rs
|
// aux-build:trait_default_method_xc_aux.rs
|
||||||
|
|
||||||
extern crate aux = "trait_default_method_xc_aux";
|
extern crate "trait_default_method_xc_aux" as aux;
|
||||||
use aux::A;
|
use aux::A;
|
||||||
|
|
||||||
pub struct a_struct { pub x: int }
|
pub struct a_struct { pub x: int }
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate foo = ""; //~ ERROR: crate name must not be empty
|
extern crate "" as foo; //~ ERROR: crate name must not be empty
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate bar = "#a"; //~ ERROR: invalid character `#` in crate name: `#a`
|
extern crate "#a" as bar; //~ ERROR: invalid character `#` in crate name: `#a`
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-11680.rs
|
// aux-build:issue-11680.rs
|
||||||
|
|
||||||
extern crate other = "issue-11680";
|
extern crate "issue-11680" as other;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _b = other::Bar(1);
|
let _b = other::Bar(1);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-12612-1.rs
|
// aux-build:issue-12612-1.rs
|
||||||
|
|
||||||
extern crate foo = "issue-12612-1";
|
extern crate "issue-12612-1" as foo;
|
||||||
|
|
||||||
use foo::bar;
|
use foo::bar;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#![feature(struct_variant)]
|
#![feature(struct_variant)]
|
||||||
|
|
||||||
extern crate other = "privacy-struct-variant";
|
extern crate "privacy-struct-variant" as other;
|
||||||
|
|
||||||
mod a {
|
mod a {
|
||||||
pub enum Foo {
|
pub enum Foo {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// aux-build:privacy-tuple-struct.rs
|
// aux-build:privacy-tuple-struct.rs
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
extern crate other = "privacy-tuple-struct";
|
extern crate "privacy-tuple-struct" as other;
|
||||||
|
|
||||||
mod a {
|
mod a {
|
||||||
pub struct A(());
|
pub struct A(());
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:struct-field-privacy.rs
|
// aux-build:struct-field-privacy.rs
|
||||||
|
|
||||||
extern crate xc = "struct-field-privacy";
|
extern crate "struct-field-privacy" as xc;
|
||||||
|
|
||||||
struct A {
|
struct A {
|
||||||
a: int,
|
a: int,
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:unreachable-variant.rs
|
// aux-build:unreachable-variant.rs
|
||||||
|
|
||||||
extern crate other = "unreachable-variant";
|
extern crate "unreachable-variant" as other;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _x = other::super_sekrit::baz; //~ ERROR is private
|
let _x = other::super_sekrit::baz; //~ ERROR is private
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
|
|
||||||
// error-pattern:can't find crate for `extra`
|
// error-pattern:can't find crate for `extra`
|
||||||
|
|
||||||
extern crate extra = "fake-crate";
|
extern crate "fake-crate" as extra;
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate core;
|
extern crate core;
|
||||||
extern crate other = "weak-lang-items";
|
extern crate "weak-lang-items" as other;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(globs)]
|
#![feature(globs)]
|
||||||
#[phase(plugin, link)]
|
#[phase(plugin, link)]
|
||||||
extern crate std = "std";
|
extern crate "std" as std;
|
||||||
extern crate rt = "native";
|
extern crate "native" as rt;
|
||||||
#[prelude_import]
|
#[prelude_import]
|
||||||
use std::prelude::*;
|
use std::prelude::*;
|
||||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
#![feature(asm)]
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg = r#"just parse this"#]
|
#[cfg = r#"just parse this"#]
|
||||||
extern crate blah = r##"blah"##;
|
extern crate r##"blah"## as blah;
|
||||||
|
|
||||||
fn main() { unsafe { asm!(r###"blah"###); } }
|
fn main() { unsafe { asm!(r###"blah"###); } }
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// Regression test for issue #13560, the test itself is all in the dependent
|
// Regression test for issue #13560, the test itself is all in the dependent
|
||||||
// libraries. The fail which previously failed to compile is the one numbered 3.
|
// libraries. The fail which previously failed to compile is the one numbered 3.
|
||||||
|
|
||||||
extern crate t2 = "issue-13560-2";
|
extern crate "issue-13560-2" as t2;
|
||||||
extern crate t3 = "issue-13560-3";
|
extern crate "issue-13560-3" as t3;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#![feature(phase)]
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(plugin)]
|
#[phase(plugin)]
|
||||||
extern crate extension = "syntax-extension-with-dll-deps-2";
|
extern crate "syntax-extension-with-dll-deps-2" as extension;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
foo!();
|
foo!();
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
extern crate mystd = "std";
|
extern crate "std" as mystd;
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-10028.rs
|
// aux-build:issue-10028.rs
|
||||||
|
|
||||||
extern crate issue10028 = "issue-10028";
|
extern crate "issue-10028" as issue10028;
|
||||||
|
|
||||||
use issue10028::ZeroLengthThingWithDestructor;
|
use issue10028::ZeroLengthThingWithDestructor;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
|
|
||||||
// aux-build:issue-11224.rs
|
// aux-build:issue-11224.rs
|
||||||
|
|
||||||
extern crate unused = "issue-11224";
|
extern crate "issue-11224" as unused;
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-11225-1.rs
|
// aux-build:issue-11225-1.rs
|
||||||
|
|
||||||
extern crate foo = "issue-11225-1";
|
extern crate "issue-11225-1" as foo;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
foo::foo(1i);
|
foo::foo(1i);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-11225-2.rs
|
// aux-build:issue-11225-2.rs
|
||||||
|
|
||||||
extern crate foo = "issue-11225-2";
|
extern crate "issue-11225-2" as foo;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
foo::foo(1i);
|
foo::foo(1i);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-11508.rs
|
// aux-build:issue-11508.rs
|
||||||
|
|
||||||
extern crate rand = "issue-11508";
|
extern crate "issue-11508" as rand;
|
||||||
|
|
||||||
use rand::{Closed01, random};
|
use rand::{Closed01, random};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-11529.rs
|
// aux-build:issue-11529.rs
|
||||||
|
|
||||||
extern crate a = "issue-11529";
|
extern crate "issue-11529" as a;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let one = 1;
|
let one = 1;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// aux-build:issue-12133-rlib.rs
|
// aux-build:issue-12133-rlib.rs
|
||||||
// aux-build:issue-12133-dylib.rs
|
// aux-build:issue-12133-dylib.rs
|
||||||
|
|
||||||
extern crate a = "issue-12133-rlib";
|
extern crate "issue-12133-rlib" as a;
|
||||||
extern crate b = "issue-12133-dylib";
|
extern crate "issue-12133-dylib" as b;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// aux-build:issue-12133-dylib.rs
|
// aux-build:issue-12133-dylib.rs
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
extern crate a = "issue-12133-rlib";
|
extern crate "issue-12133-rlib" as a;
|
||||||
extern crate b = "issue-12133-dylib";
|
extern crate "issue-12133-dylib" as b;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
// aux-build:issue-12133-dylib.rs
|
// aux-build:issue-12133-dylib.rs
|
||||||
// aux-build:issue-12133-dylib2.rs
|
// aux-build:issue-12133-dylib2.rs
|
||||||
|
|
||||||
extern crate other = "issue-12133-dylib2";
|
extern crate "issue-12133-dylib2" as other;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
// aux-build:issue-12612-1.rs
|
// aux-build:issue-12612-1.rs
|
||||||
// aux-build:issue-12612-2.rs
|
// aux-build:issue-12612-2.rs
|
||||||
|
|
||||||
extern crate foo = "issue-12612-1";
|
extern crate "issue-12612-1" as foo;
|
||||||
extern crate bar = "issue-12612-2";
|
extern crate "issue-12612-2" as bar;
|
||||||
|
|
||||||
mod test {
|
mod test {
|
||||||
use bar::baz;
|
use bar::baz;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// aux-build:issue-13620-1.rs
|
// aux-build:issue-13620-1.rs
|
||||||
// aux-build:issue-13620-2.rs
|
// aux-build:issue-13620-2.rs
|
||||||
|
|
||||||
extern crate crate2 = "issue-13620-2";
|
extern crate "issue-13620-2" as crate2;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
(crate2::FOO2.foo)();
|
(crate2::FOO2.foo)();
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// aux-build:issue-13872-2.rs
|
// aux-build:issue-13872-2.rs
|
||||||
// aux-build:issue-13872-3.rs
|
// aux-build:issue-13872-3.rs
|
||||||
|
|
||||||
extern crate other = "issue-13872-3";
|
extern crate "issue-13872-3" as other;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
other::foo();
|
other::foo();
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
|
|
||||||
#![feature(phase)]
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(plugin, link)] extern crate std2 = "std";
|
#[phase(plugin, link)] extern crate "std" as std2;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-14421.rs
|
// aux-build:issue-14421.rs
|
||||||
|
|
||||||
extern crate bug_lib = "issue-14421";
|
extern crate "issue-14421" as bug_lib;
|
||||||
|
|
||||||
use bug_lib::B;
|
use bug_lib::B;
|
||||||
use bug_lib::make;
|
use bug_lib::make;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-14422.rs
|
// aux-build:issue-14422.rs
|
||||||
|
|
||||||
extern crate bug_lib = "issue-14422";
|
extern crate "issue-14422" as bug_lib;
|
||||||
|
|
||||||
use bug_lib::B;
|
use bug_lib::B;
|
||||||
use bug_lib::make;
|
use bug_lib::make;
|
||||||
|
|
|
@ -10,5 +10,5 @@
|
||||||
|
|
||||||
// aux-build:issue-4545.rs
|
// aux-build:issue-4545.rs
|
||||||
|
|
||||||
extern crate somelib = "issue-4545";
|
extern crate "issue-4545" as somelib;
|
||||||
pub fn main() { somelib::mk::<int>(); }
|
pub fn main() { somelib::mk::<int>(); }
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
|
|
||||||
// aux-build:issue-5518.rs
|
// aux-build:issue-5518.rs
|
||||||
|
|
||||||
extern crate other = "issue-5518";
|
extern crate "issue-5518" as other;
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// aux-build:issue-5521.rs
|
// aux-build:issue-5521.rs
|
||||||
|
|
||||||
|
|
||||||
extern crate foo = "issue-5521";
|
extern crate "issue-5521" as foo;
|
||||||
|
|
||||||
fn bar(a: foo::map) {
|
fn bar(a: foo::map) {
|
||||||
if false {
|
if false {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-7178.rs
|
// aux-build:issue-7178.rs
|
||||||
|
|
||||||
extern crate cross_crate_self = "issue-7178";
|
extern crate "issue-7178" as cross_crate_self;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let _ = cross_crate_self::Foo::new(&1i);
|
let _ = cross_crate_self::Foo::new(&1i);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-7899.rs
|
// aux-build:issue-7899.rs
|
||||||
|
|
||||||
extern crate testcrate = "issue-7899";
|
extern crate "issue-7899" as testcrate;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let f = testcrate::V2(1.0f32, 2.0f32);
|
let f = testcrate::V2(1.0f32, 2.0f32);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-8044.rs
|
// aux-build:issue-8044.rs
|
||||||
|
|
||||||
extern crate minimal = "issue-8044";
|
extern crate "issue-8044" as minimal;
|
||||||
use minimal::{BTree, leaf};
|
use minimal::{BTree, leaf};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-8259.rs
|
// aux-build:issue-8259.rs
|
||||||
|
|
||||||
extern crate other = "issue-8259";
|
extern crate "issue-8259" as other;
|
||||||
static a: other::Foo<'static> = other::A;
|
static a: other::Foo<'static> = other::A;
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-9906.rs
|
// aux-build:issue-9906.rs
|
||||||
|
|
||||||
extern crate testmod = "issue-9906";
|
extern crate "issue-9906" as testmod;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
testmod::foo();
|
testmod::foo();
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:issue-9968.rs
|
// aux-build:issue-9968.rs
|
||||||
|
|
||||||
extern crate lib = "issue-9968";
|
extern crate "issue-9968" as lib;
|
||||||
|
|
||||||
use lib::{Trait, Struct};
|
use lib::{Trait, Struct};
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate lang_lib = "lang-item-public";
|
extern crate "lang-item-public" as lang_lib;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[link(name = "c")]
|
#[link(name = "c")]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// ignore-android: FIXME(#10379)
|
// ignore-android: FIXME(#10379)
|
||||||
// ignore-windows: std::dynamic_lib does not work on Windows well
|
// ignore-windows: std::dynamic_lib does not work on Windows well
|
||||||
|
|
||||||
extern crate foo = "linkage-visibility";
|
extern crate "linkage-visibility" as foo;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
foo::test();
|
foo::test();
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#![feature(linkage)]
|
#![feature(linkage)]
|
||||||
|
|
||||||
extern crate other = "linkage1";
|
extern crate "linkage1" as other;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
#[linkage = "extern_weak"]
|
#[linkage = "extern_weak"]
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:priv-impl-prim-ty.rs
|
// aux-build:priv-impl-prim-ty.rs
|
||||||
|
|
||||||
extern crate bar = "priv-impl-prim-ty";
|
extern crate "priv-impl-prim-ty" as bar;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
bar::frob(1i);
|
bar::frob(1i);
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:reexport-should-still-link.rs
|
// aux-build:reexport-should-still-link.rs
|
||||||
|
|
||||||
extern crate foo = "reexport-should-still-link";
|
extern crate "reexport-should-still-link" as foo;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
foo::bar();
|
foo::bar();
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:static_fn_inline_xc_aux.rs
|
// aux-build:static_fn_inline_xc_aux.rs
|
||||||
|
|
||||||
extern crate mycore = "static_fn_inline_xc_aux";
|
extern crate "static_fn_inline_xc_aux" as mycore;
|
||||||
|
|
||||||
use mycore::num;
|
use mycore::num;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:static_fn_trait_xc_aux.rs
|
// aux-build:static_fn_trait_xc_aux.rs
|
||||||
|
|
||||||
extern crate mycore = "static_fn_trait_xc_aux";
|
extern crate "static_fn_trait_xc_aux" as mycore;
|
||||||
|
|
||||||
use mycore::num;
|
use mycore::num;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:static-function-pointer-aux.rs
|
// aux-build:static-function-pointer-aux.rs
|
||||||
extern crate aux = "static-function-pointer-aux";
|
extern crate "static-function-pointer-aux" as aux;
|
||||||
|
|
||||||
fn f(x: int) -> int { x }
|
fn f(x: int) -> int { x }
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
// aux-build:trait_default_method_xc_aux_2.rs
|
// aux-build:trait_default_method_xc_aux_2.rs
|
||||||
|
|
||||||
|
|
||||||
extern crate aux = "trait_default_method_xc_aux";
|
extern crate "trait_default_method_xc_aux" as aux;
|
||||||
extern crate aux2 = "trait_default_method_xc_aux_2";
|
extern crate "trait_default_method_xc_aux_2" as aux2;
|
||||||
use aux::A;
|
use aux::A;
|
||||||
use aux2::{a_struct, welp};
|
use aux2::{a_struct, welp};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:trait_default_method_xc_aux.rs
|
// aux-build:trait_default_method_xc_aux.rs
|
||||||
|
|
||||||
extern crate aux = "trait_default_method_xc_aux";
|
extern crate "trait_default_method_xc_aux" as aux;
|
||||||
use aux::{A, TestEquality, Something};
|
use aux::{A, TestEquality, Something};
|
||||||
use aux::B;
|
use aux::B;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:trait_inheritance_auto_xc_2_aux.rs
|
// aux-build:trait_inheritance_auto_xc_2_aux.rs
|
||||||
|
|
||||||
extern crate aux = "trait_inheritance_auto_xc_2_aux";
|
extern crate "trait_inheritance_auto_xc_2_aux" as aux;
|
||||||
|
|
||||||
// aux defines impls of Foo, Bar and Baz for A
|
// aux defines impls of Foo, Bar and Baz for A
|
||||||
use aux::{Foo, Bar, Baz, A};
|
use aux::{Foo, Bar, Baz, A};
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:trait_inheritance_auto_xc_aux.rs
|
// aux-build:trait_inheritance_auto_xc_aux.rs
|
||||||
|
|
||||||
extern crate aux = "trait_inheritance_auto_xc_aux";
|
extern crate "trait_inheritance_auto_xc_aux" as aux;
|
||||||
|
|
||||||
use aux::{Foo, Bar, Baz, Quux};
|
use aux::{Foo, Bar, Baz, Quux};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:trait_inheritance_cross_trait_call_xc_aux.rs
|
// aux-build:trait_inheritance_cross_trait_call_xc_aux.rs
|
||||||
|
|
||||||
extern crate aux = "trait_inheritance_cross_trait_call_xc_aux";
|
extern crate "trait_inheritance_cross_trait_call_xc_aux" as aux;
|
||||||
|
|
||||||
use aux::Foo;
|
use aux::Foo;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
// aux-build:typeid-intrinsic.rs
|
// aux-build:typeid-intrinsic.rs
|
||||||
// aux-build:typeid-intrinsic2.rs
|
// aux-build:typeid-intrinsic2.rs
|
||||||
|
|
||||||
extern crate other1 = "typeid-intrinsic";
|
extern crate "typeid-intrinsic" as other1;
|
||||||
extern crate other2 = "typeid-intrinsic2";
|
extern crate "typeid-intrinsic2" as other2;
|
||||||
|
|
||||||
use std::hash;
|
use std::hash;
|
||||||
use std::intrinsics;
|
use std::intrinsics;
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// Issue #1706
|
// Issue #1706
|
||||||
extern crate stdlib = "std";
|
extern crate "std" as stdlib;
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
extern crate std;
|
extern crate std;
|
||||||
extern crate zed = "std";
|
extern crate "std" as zed;
|
||||||
|
|
||||||
|
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:weak-lang-items.rs
|
// aux-build:weak-lang-items.rs
|
||||||
|
|
||||||
extern crate other = "weak-lang-items";
|
extern crate "weak-lang-items" as other;
|
||||||
|
|
||||||
use std::task;
|
use std::task;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:xcrate_address_insignificant.rs
|
// aux-build:xcrate_address_insignificant.rs
|
||||||
|
|
||||||
extern crate foo = "xcrate_address_insignificant";
|
extern crate "xcrate_address_insignificant" as foo;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
assert_eq!(foo::foo::<f64>(), foo::bar());
|
assert_eq!(foo::foo::<f64>(), foo::bar());
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// aux-build:xcrate-trait-lifetime-param.rs
|
// aux-build:xcrate-trait-lifetime-param.rs
|
||||||
|
|
||||||
extern crate other = "xcrate-trait-lifetime-param";
|
extern crate "xcrate-trait-lifetime-param" as other;
|
||||||
|
|
||||||
struct Reader<'a> {
|
struct Reader<'a> {
|
||||||
b : &'a [u8]
|
b : &'a [u8]
|
||||||
|
|
Loading…
Reference in a new issue