Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unquote crate names #23777

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ extern crate pcre;

extern crate std; // equivalent to: extern crate std as std;

extern crate "std" as ruststd; // linking to 'std' under another name
extern crate std as ruststd; // linking to 'std' under another name
```

##### Use declarations
Expand Down
4 changes: 2 additions & 2 deletions src/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#![cfg_attr(rustdoc, feature(rustdoc))]

#[cfg(rustdoc)]
extern crate "rustdoc" as this;
extern crate rustdoc as this;

#[cfg(rustc)]
extern crate "rustc_driver" as this;
extern crate rustc_driver as this;

fn main() { this::main() }
2 changes: 1 addition & 1 deletion src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

#![allow(bad_style, raw_pointer_derive)]
#![cfg_attr(target_os = "nacl", allow(unused_imports))]
#[cfg(feature = "cargo-build")] extern crate "std" as core;
#[cfg(feature = "cargo-build")] extern crate std as core;
#[cfg(not(feature = "cargo-build"))] extern crate core;

#[cfg(test)] extern crate std;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extern crate collections;
#[macro_use] extern crate syntax;
#[macro_use] #[no_link] extern crate rustc_bitflags;

extern crate "serialize" as rustc_serialize; // used by deriving
extern crate serialize as rustc_serialize; // used by deriving

#[cfg(test)]
extern crate test;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
// refers to the borrowck-specific graphviz adapter traits.
extern crate "graphviz" as dot;
extern crate graphviz as dot;
extern crate rustc;

pub use borrowck::check_crate;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern crate rustc_resolve;
extern crate rustc_trans;
extern crate rustc_typeck;
extern crate serialize;
extern crate "rustc_llvm" as llvm;
extern crate rustc_llvm as llvm;
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extern crate libc;
extern crate rustc;
extern crate rustc_back;
extern crate serialize;
extern crate "rustc_llvm" as llvm;
extern crate rustc_llvm as llvm;

#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ extern crate rustc_lint;
extern crate rustc_back;
extern crate serialize;
extern crate syntax;
extern crate "test" as testing;
extern crate test as testing;
extern crate unicode;
#[macro_use] extern crate log;

extern crate "serialize" as rustc_serialize; // used by deriving
extern crate serialize as rustc_serialize; // used by deriving

use std::cell::RefCell;
use std::collections::HashMap;
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ extern crate core;

#[macro_use]
#[macro_reexport(vec, format)]
extern crate "collections" as core_collections;
extern crate collections as core_collections;

#[allow(deprecated)] extern crate "rand" as core_rand;
#[allow(deprecated)] extern crate rand as core_rand;
extern crate alloc;
extern crate unicode;
extern crate libc;

#[macro_use] #[no_link] extern crate rustc_bitflags;

// Make std testable by not duplicating lang items. See #2912
#[cfg(test)] extern crate "std" as realstd;
#[cfg(test)] extern crate std as realstd;
#[cfg(test)] pub use realstd::marker;
#[cfg(test)] pub use realstd::ops;
#[cfg(test)] pub use realstd::cmp;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/old_io/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl<'a> Buffer for BufReader<'a> {

#[cfg(test)]
mod test {
extern crate "test" as test_crate;
extern crate test as test_crate;
use old_io::{SeekSet, SeekCur, SeekEnd, Reader, Writer, Seek, Buffer};
use prelude::v1::{Ok, Err, Vec, AsSlice};
use prelude::v1::IteratorExt;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern crate libc;
#[macro_use] extern crate log;
#[macro_use] #[no_link] extern crate rustc_bitflags;

extern crate "serialize" as rustc_serialize; // used by deriving
extern crate serialize as rustc_serialize; // used by deriving

pub mod util {
pub mod interner;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4979,7 +4979,7 @@ impl<'a> Parser<'a> {
///
/// extern crate url;
/// extern crate foo = "bar"; //deprecated
/// extern crate "bar" as foo;
/// extern crate bar as foo;
fn parse_item_extern_crate(&mut self,
lo: BytePos,
visibility: Visibility,
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/std_inject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct StandardLibraryInjector {
impl fold::Folder for StandardLibraryInjector {
fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {

// The name to use in `extern crate "name" as std;`
// The name to use in `extern crate name as std;`
let actual_crate_name = match self.alt_std_name {
Some(ref s) => token::intern(&s),
None => token::intern("std"),
Expand Down
2 changes: 1 addition & 1 deletion src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

extern crate getopts;
extern crate serialize;
extern crate "serialize" as rustc_serialize;
extern crate serialize as rustc_serialize;
extern crate term;
extern crate libc;

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/syntax_extension_with_dll_deps_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![crate_type = "dylib"]
#![feature(plugin_registrar, quote, rustc_private)]

extern crate "syntax_extension_with_dll_deps_1" as other;
extern crate syntax_extension_with_dll_deps_1 as other;
extern crate syntax;
extern crate rustc;

Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/trait_default_method_xc_aux_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// aux-build:trait_default_method_xc_aux.rs

extern crate "trait_default_method_xc_aux" as aux;
extern crate trait_default_method_xc_aux as aux;
use aux::A;

pub struct a_struct { pub x: int }
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make/save-analysis/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
extern crate graphviz;
// A simple rust project

extern crate "flate" as myflate;
extern crate flate as myflate;

use std::collections::{HashMap,HashSet};
use std::cell::RefCell;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/derive-no-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

extern crate core;
extern crate rand;
extern crate "serialize" as rustc_serialize;
extern crate serialize as rustc_serialize;
extern crate collections;

// Issue #16803
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-foreign-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

// pretty-expanded FIXME #23616

extern crate "std" as mystd;
extern crate std as mystd;

pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/for-loop-no-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![feature(lang_items, start, no_std, core, collections)]
#![no_std]

extern crate "std" as other;
extern crate std as other;

#[macro_use] extern crate core;
#[macro_use] extern crate collections;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/format-no-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![feature(lang_items, start, no_std, core, collections)]
#![no_std]

extern crate "std" as other;
extern crate std as other;

#[macro_use] extern crate core;
#[macro_use] extern crate collections;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-14330.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

// pretty-expanded FIXME #23616

#[macro_use] extern crate "std" as std2;
#[macro_use] extern crate std as std2;

fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/linkage1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#![feature(linkage)]

extern crate "linkage1" as other;
extern crate linkage1 as other;

extern {
#[linkage = "extern_weak"]
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/macro-crate-nonterminal-renamed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ignore-stage1

#[macro_use]
extern crate "macro_crate_nonterminal" as new_name;
extern crate macro_crate_nonterminal as new_name;

pub fn main() {
new_name::check_local();
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/static-fn-inline-xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "static_fn_inline_xc_aux" as mycore;
extern crate static_fn_inline_xc_aux as mycore;

use mycore::num;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/static-fn-trait-xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "static_fn_trait_xc_aux" as mycore;
extern crate static_fn_trait_xc_aux as mycore;

use mycore::num;

Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/trait-default-method-xc-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

// pretty-expanded FIXME #23616

extern crate "trait_default_method_xc_aux" as aux;
extern crate "trait_default_method_xc_aux_2" as aux2;
extern crate trait_default_method_xc_aux as aux;
extern crate trait_default_method_xc_aux_2 as aux2;
use aux::A;
use aux2::{a_struct, welp};

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-default-method-xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "trait_default_method_xc_aux" as aux;
extern crate trait_default_method_xc_aux as aux;
use aux::{A, TestEquality, Something};
use aux::B;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-inheritance-auto-xc-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "trait_inheritance_auto_xc_2_aux" as aux;
extern crate trait_inheritance_auto_xc_2_aux as aux;

// aux defines impls of Foo, Bar and Baz for A
use aux::{Foo, Bar, Baz, A};
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-inheritance-auto-xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "trait_inheritance_auto_xc_aux" as aux;
extern crate trait_inheritance_auto_xc_aux as aux;

use aux::{Foo, Bar, Baz, Quux};

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "trait_inheritance_cross_trait_call_xc_aux" as aux;
extern crate trait_inheritance_cross_trait_call_xc_aux as aux;

use aux::Foo;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/use-crate-name-alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
// Issue #1706
// pretty-expanded FIXME #23616

extern crate "std" as stdlib;
extern crate std as stdlib;

pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#![no_std]

extern crate std;
extern crate "std" as zed;
extern crate std as zed;

use std::str;
use zed::str as x;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/vec-macro-no-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#![feature(lang_items, start, no_std, core, libc, collections)]
#![no_std]

extern crate "std" as other;
extern crate std as other;

#[macro_use]
extern crate core;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/xcrate-address-insignificant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// pretty-expanded FIXME #23616

extern crate "xcrate_address_insignificant" as foo;
extern crate xcrate_address_insignificant as foo;

pub fn main() {
assert_eq!(foo::foo::<f64>(), foo::bar());
Expand Down