From f2fb45723ac7a1bfa897802256452d603a7adb2a Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 20 Aug 2017 08:22:46 -0700 Subject: [PATCH 1/3] syntax: remove unused field --- src/libsyntax/test.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index eeb8bf7214467..438eb2b8174f0 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -56,7 +56,6 @@ struct Test { } struct TestCtxt<'a> { - sess: &'a ParseSess, span_diagnostic: &'a errors::Handler, path: Vec, ext_cx: ExtCtxt<'a>, @@ -273,7 +272,6 @@ fn generate_test_harness(sess: &ParseSess, let mark = Mark::fresh(Mark::root()); let mut cx: TestCtxt = TestCtxt { - sess, span_diagnostic: sd, ext_cx: ExtCtxt::new(sess, ExpansionConfig::default("test".to_string()), resolver), path: Vec::new(), From 0463566f27dfc5979b5b12eb7cea670a4e3f991c Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 20 Aug 2017 08:40:07 -0700 Subject: [PATCH 2/3] syntax: clarify field name The value of this field is meant to indicate whether or not the crate is rustc's libtest itself - not whether or not it is a test crate generally. --- src/libsyntax/test.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 438eb2b8174f0..35dc981952908 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -61,7 +61,7 @@ struct TestCtxt<'a> { ext_cx: ExtCtxt<'a>, testfns: Vec, reexport_test_harness_main: Option, - is_test_crate: bool, + is_libtest: bool, ctxt: SyntaxContext, // top-level re-export submodule, filled out after folding is finished @@ -271,13 +271,15 @@ fn generate_test_harness(sess: &ParseSess, let krate = cleaner.fold_crate(krate); let mark = Mark::fresh(Mark::root()); + let mut cx: TestCtxt = TestCtxt { span_diagnostic: sd, ext_cx: ExtCtxt::new(sess, ExpansionConfig::default("test".to_string()), resolver), path: Vec::new(), testfns: Vec::new(), reexport_test_harness_main, - is_test_crate: is_test_crate(&krate), + // NB: doesn't consider the value of `--crate-name` passed on the command line. + is_libtest: attr::find_crate_name(&krate.attrs).map(|s| s == "test").unwrap_or(false), toplevel_reexport: None, ctxt: SyntaxContext::empty().apply_mark(mark), }; @@ -452,7 +454,7 @@ mod __test { fn mk_std(cx: &TestCtxt) -> P { let id_test = Ident::from_str("test"); let sp = ignored_span(cx, DUMMY_SP); - let (vi, vis, ident) = if cx.is_test_crate { + let (vi, vis, ident) = if cx.is_libtest { (ast::ItemKind::Use( P(nospan(ast::ViewPathSimple(id_test, path_node(vec![id_test]))))), @@ -606,13 +608,6 @@ fn mk_tests(cx: &TestCtxt) -> P { test_descs) } -fn is_test_crate(krate: &ast::Crate) -> bool { - match attr::find_crate_name(&krate.attrs) { - Some(s) if "test" == s.as_str() => true, - _ => false - } -} - fn mk_test_descs(cx: &TestCtxt) -> P { debug!("building test vector from {} tests", cx.testfns.len()); From b3f50caee0e2f2f4d44e1c83bf73a112c2a398b1 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 19 Aug 2017 16:54:17 -0700 Subject: [PATCH 3/3] *: remove crate_{name,type} attributes Fixes #41701. --- src/liballoc/lib.rs | 2 -- src/liballoc_jemalloc/lib.rs | 2 -- src/liballoc_system/lib.rs | 2 -- src/libarena/lib.rs | 3 --- src/libcollections/lib.rs | 2 -- src/libcore/lib.rs | 2 -- src/libfmt_macros/lib.rs | 3 --- src/libgetopts/lib.rs | 3 --- src/libgraphviz/lib.rs | 3 --- src/libpanic_abort/lib.rs | 2 -- src/libpanic_unwind/lib.rs | 2 -- src/libproc_macro/lib.rs | 3 --- src/libprofiler_builtins/lib.rs | 2 -- src/librand/lib.rs | 2 -- src/librustc/lib.rs | 3 --- src/librustc_apfloat/lib.rs | 1 - src/librustc_back/lib.rs | 3 --- src/librustc_bitflags/lib.rs | 2 -- src/librustc_borrowck/lib.rs | 3 --- src/librustc_const_eval/lib.rs | 3 --- src/librustc_const_math/lib.rs | 3 --- src/librustc_data_structures/lib.rs | 3 --- src/librustc_driver/lib.rs | 3 --- src/librustc_errors/lib.rs | 3 --- src/librustc_incremental/lib.rs | 3 --- src/librustc_lint/lib.rs | 3 --- src/librustc_llvm/lib.rs | 3 --- src/librustc_metadata/lib.rs | 3 --- src/librustc_mir/lib.rs | 3 --- src/librustc_passes/lib.rs | 3 --- src/librustc_platform_intrinsics/lib.rs | 3 --- src/librustc_plugin/lib.rs | 3 --- src/librustc_privacy/lib.rs | 3 --- src/librustc_resolve/lib.rs | 3 --- src/librustc_save_analysis/lib.rs | 3 --- src/librustc_trans/lib.rs | 3 --- src/librustc_trans_utils/lib.rs | 3 --- src/librustc_typeck/lib.rs | 3 --- src/librustdoc/lib.rs | 3 --- src/libserialize/lib.rs | 3 --- src/libstd/lib.rs | 3 --- src/libstd_unicode/lib.rs | 2 -- src/libsyntax/lib.rs | 3 --- src/libsyntax_ext/lib.rs | 3 --- src/libsyntax_pos/lib.rs | 3 --- src/libterm/lib.rs | 3 --- src/libtest/lib.rs | 5 +++-- src/libunwind/lib.rs | 2 -- src/test/run-make/alloc-extern-crates/Makefile | 2 +- 49 files changed, 4 insertions(+), 130 deletions(-) diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 4e91be365e2b9..2d41ed648102b 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -60,8 +60,6 @@ //! The [`heap`](heap/index.html) module defines the low-level interface to the //! default global allocator. It is not compatible with the libc allocator API. -#![crate_name = "alloc"] -#![crate_type = "rlib"] #![allow(unused_attributes)] #![unstable(feature = "alloc", reason = "this library is unlikely to be stabilized in its current \ diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs index 3a9cc1dd5a6b8..513b299fcf37a 100644 --- a/src/liballoc_jemalloc/lib.rs +++ b/src/liballoc_jemalloc/lib.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "alloc_jemalloc"] -#![crate_type = "rlib"] #![no_std] #![unstable(feature = "alloc_jemalloc", reason = "this library is unlikely to be stabilized in its current \ diff --git a/src/liballoc_system/lib.rs b/src/liballoc_system/lib.rs index 9a7cba21e3c78..1defe308713a7 100644 --- a/src/liballoc_system/lib.rs +++ b/src/liballoc_system/lib.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "alloc_system"] -#![crate_type = "rlib"] #![no_std] #![deny(warnings)] #![unstable(feature = "alloc_system", diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 8e3b3f2074da9..96fcc81e8e6ed 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -18,9 +18,6 @@ //! This crate implements `TypedArena`, a simple arena that can only hold //! objects of a single type. -#![crate_name = "arena"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 38143593eb12b..55316db3d5a43 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "collections"] -#![crate_type = "rlib"] #![allow(unused_attributes)] #![unstable(feature = "collections", reason = "this library is unlikely to be stabilized in its current \ diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 546d2a21939ff..c270c6ae0dbad 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -51,9 +51,7 @@ // Since libcore defines many fundamental lang items, all tests live in a // separate crate, libcoretest, to avoid bizarre issues. -#![crate_name = "core"] #![stable(feature = "core", since = "1.6.0")] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 43345c6d0977b..24430b2e377f5 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -14,9 +14,6 @@ //! Parsing does not happen at runtime: structures of `std::fmt::rt` are //! generated instead. -#![crate_name = "fmt_macros"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 83f2de5402315..a0eacc817ca81 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -77,9 +77,6 @@ //! } //! ``` -#![crate_name = "getopts"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 4ee0c3d92bd2c..5b1cf2dee9a83 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -283,9 +283,6 @@ //! //! * [DOT language](http://www.graphviz.org/doc/info/lang.html) -#![crate_name = "graphviz"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index 348180a48dc38..8be6f6470231d 100644 --- a/src/libpanic_abort/lib.rs +++ b/src/libpanic_abort/lib.rs @@ -14,8 +14,6 @@ //! simpler! That being said, it's not quite as versatile, but here goes! #![no_std] -#![crate_name = "panic_abort"] -#![crate_type = "rlib"] #![unstable(feature = "panic_abort", issue = "32837")] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", diff --git a/src/libpanic_unwind/lib.rs b/src/libpanic_unwind/lib.rs index 90f4b364482e6..5a340f1323df5 100644 --- a/src/libpanic_unwind/lib.rs +++ b/src/libpanic_unwind/lib.rs @@ -23,8 +23,6 @@ //! module. #![no_std] -#![crate_name = "panic_unwind"] -#![crate_type = "rlib"] #![unstable(feature = "panic_unwind", issue = "32837")] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 38665b403d6ab..3f425c24a9143 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -23,10 +23,7 @@ //! //! See [the book](../book/first-edition/procedural-macros.html) for more. -#![crate_name = "proc_macro"] #![stable(feature = "proc_macro_lib", since = "1.15.0")] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![deny(warnings)] #![deny(missing_docs)] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/libprofiler_builtins/lib.rs b/src/libprofiler_builtins/lib.rs index 1fb2c6b7dbb5d..6d0d6d115b716 100644 --- a/src/libprofiler_builtins/lib.rs +++ b/src/libprofiler_builtins/lib.rs @@ -14,7 +14,5 @@ #![unstable(feature = "profiler_runtime_lib", reason = "internal implementation detail of rustc right now", issue = "0")] -#![crate_name = "profiler_builtins"] -#![crate_type = "rlib"] #![allow(unused_features)] #![feature(staged_api)] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index a3c4f6a4b1db1..90b3020fff9d1 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -16,8 +16,6 @@ //! is not recommended to use this library directly, but rather the official //! interface through `std::rand`. -#![crate_name = "rand"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 5b0760e561e3f..03dc2f3c1ac76 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_apfloat/lib.rs b/src/librustc_apfloat/lib.rs index d9dbf78785652..d4a020657616a 100644 --- a/src/librustc_apfloat/lib.rs +++ b/src/librustc_apfloat/lib.rs @@ -39,7 +39,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_apfloat"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 55b39f226701f..6a9833d3784a4 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -21,9 +21,6 @@ //! one that doesn't; the one that doesn't might get decent parallel //! build speedups. -#![crate_name = "rustc_back"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index 731256557929d..eb47144d1f995 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -9,8 +9,6 @@ // except according to those terms. -#![crate_name = "rustc_bitflags"] -#![crate_type = "rlib"] #![no_std] #![deny(warnings)] diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 7a77939faa3e7..e7f4f9caee335 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_borrowck"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index 3483752d4ff01..9fedee80d46a8 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_const_eval"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_const_math/lib.rs b/src/librustc_const_math/lib.rs index 3947edecb5aff..93b70ef8e4a58 100644 --- a/src/librustc_const_math/lib.rs +++ b/src/librustc_const_math/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_const_math"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index 54eed6dc92a77..da00ebc4b9ee9 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -16,9 +16,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_data_structures"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d7b5d4a6fe3ba..e56c989b843d1 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_driver"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 12b5ccf483762..0ce999c9b6288 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_errors"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index c68153140d97c..8870033095c9c 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -10,9 +10,6 @@ //! Support for serializing the dep-graph and reloading it. -#![crate_name = "rustc_incremental"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 755370b64659d..5ef277f02ace6 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -19,9 +19,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_lint"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 5f12f561faf45..3c3e627ee4b36 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -13,9 +13,6 @@ #![allow(non_snake_case)] #![allow(dead_code)] -#![crate_name = "rustc_llvm"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 8fd87ae88a884..7d796dbd00f8f 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_metadata"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 7aa4679992471..dba625e98fd81 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -14,9 +14,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! */ -#![crate_name = "rustc_mir"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![deny(warnings)] #![feature(box_patterns)] diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 6c41aad98d54d..28b99e1185bd2 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_passes"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs index ef1d9093df20e..4cc65ee28e89f 100644 --- a/src/librustc_platform_intrinsics/lib.rs +++ b/src/librustc_platform_intrinsics/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_platform_intrinsics"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![deny(warnings)] #![allow(bad_style)] diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs index 602b71dca05ab..a2a6d183e9ccc 100644 --- a/src/librustc_plugin/lib.rs +++ b/src/librustc_plugin/lib.rs @@ -60,9 +60,6 @@ //! See the [`plugin` feature](../../unstable-book/language-features/plugin.html) of //! the Unstable Book for more examples. -#![crate_name = "rustc_plugin"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index eb82dddaf56fb..772b16bbecfba 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_privacy"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index bfc76ee2f74f6..ee349e3112889 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_resolve"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index bc9d760d14895..9b74df865d747 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustc_save_analysis"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 6da42caf75bef..1758e331129d5 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_trans"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_trans_utils/lib.rs b/src/librustc_trans_utils/lib.rs index 81e83076f8c0c..90e17906328fb 100644 --- a/src/librustc_trans_utils/lib.rs +++ b/src/librustc_trans_utils/lib.rs @@ -12,9 +12,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "rustc_trans_utils"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 294429b5b3671..86feea13b1723 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -63,9 +63,6 @@ This API is completely unstable and subject to change. */ -#![crate_name = "rustc_typeck"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 1c3f296bed96c..61a8165d26af1 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name = "rustdoc"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index c3107d1f190c2..2e354252c1573 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -14,9 +14,6 @@ Core encoding and decoding interfaces. */ -#![crate_name = "serialize"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 30495f297453d..cf1eb5cd52ea4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -209,10 +209,7 @@ //! [other]: #what-is-in-the-standard-library-documentation //! [primitive types]: ../book/first-edition/primitive-types.html -#![crate_name = "std"] #![stable(feature = "rust1", since = "1.0.0")] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libstd_unicode/lib.rs b/src/libstd_unicode/lib.rs index d568baa2cd770..e5a114caed0f4 100644 --- a/src/libstd_unicode/lib.rs +++ b/src/libstd_unicode/lib.rs @@ -20,9 +20,7 @@ //! provide for basic string-related manipulations. This crate does not //! (yet) aim to provide a full set of Unicode tables. -#![crate_name = "std_unicode"] #![unstable(feature = "unicode", issue = "27783")] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 43345b02bf614..e3c9f0a9345ea 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "syntax"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 439538a8b5ee3..fa39095d3298b 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -10,9 +10,6 @@ //! Syntax extensions in the Rust compiler. -#![crate_name = "syntax_ext"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 2385e3509ad1c..d34dcfa3ed324 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -14,9 +14,6 @@ //! //! This API is completely unstable and subject to change. -#![crate_name = "syntax_pos"] -#![crate_type = "dylib"] -#![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 4864e4581faab..ad0e582b1c324 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -40,9 +40,6 @@ //! [win]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682010%28v=vs.85%29.aspx //! [ti]: https://en.wikipedia.org/wiki/Terminfo -#![crate_name = "term"] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 5e34688f8cb8f..652bfa82b5c71 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -23,10 +23,11 @@ // running tests while providing a base that other test frameworks may // build off of. +// NB: this is also specified in this crate's Cargo.toml, but libsyntax contains logic specific to +// this crate, which relies on this attribute (rather than the value of `--crate-name` passed by +// cargo) to detect this crate. #![crate_name = "test"] #![unstable(feature = "test", issue = "27812")] -#![crate_type = "rlib"] -#![crate_type = "dylib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 2f425d8e9860e..461b49aa363b4 100644 --- a/src/libunwind/lib.rs +++ b/src/libunwind/lib.rs @@ -9,8 +9,6 @@ // except according to those terms. #![no_std] -#![crate_name = "unwind"] -#![crate_type = "rlib"] #![unstable(feature = "panic_unwind", issue = "32837")] #![deny(warnings)] diff --git a/src/test/run-make/alloc-extern-crates/Makefile b/src/test/run-make/alloc-extern-crates/Makefile index b8c52378554ba..7197f4e17e3cc 100644 --- a/src/test/run-make/alloc-extern-crates/Makefile +++ b/src/test/run-make/alloc-extern-crates/Makefile @@ -2,4 +2,4 @@ all: $(RUSTC) fakealloc.rs - $(RUSTC) ../../../liballoc/lib.rs --cfg feature=\"external_crate\" --extern external=$(TMPDIR)/$(shell $(RUSTC) --print file-names fakealloc.rs) + $(RUSTC) --crate-type=rlib ../../../liballoc/lib.rs --cfg feature=\"external_crate\" --extern external=$(TMPDIR)/$(shell $(RUSTC) --print file-names fakealloc.rs)