From 0981211c629d0d9f59c5164d8e2c42974d9449e2 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 15 Aug 2017 16:21:28 -0700 Subject: hard feature-gate for #[must_use] on functions We'll actually want a new "soft" warning-only gate to maintain backwards-compatibility, but it's cleaner to start out with the established, well-understood gate before implementing the alternative warn-only behavior in a later commit. This is in the matter of #43302. --- src/libsyntax/feature_gate.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 801343689b7..ee791609e8f 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -372,6 +372,9 @@ declare_features! ( // #[doc(cfg(...))] (active, doc_cfg, "1.21.0", Some(43781)), + + // allow `#[must_use]` on functions (RFC 1940) + (active, fn_must_use, "1.21.0", Some(43302)), ); declare_features! ( @@ -1014,7 +1017,7 @@ pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: Gate } pub fn feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: GateIssue, - explain: &str) -> DiagnosticBuilder<'a> { + explain: &str) -> DiagnosticBuilder<'a> { let diag = &sess.span_diagnostic; let issue = match issue { @@ -1234,6 +1237,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { function may change over time, for now \ a top-level `fn main()` is required"); } + if attr::contains_name(&i.attrs[..], "must_use") { + gate_feature_post!(&self, fn_must_use, i.span, + "`#[must_use]` on functions is experimental"); + } } ast::ItemKind::Struct(..) => { -- cgit 1.4.1-3-g733a5 From 7b6e9b4b8424e8ef722a3fa6388fe3bc8414bab0 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 15 Aug 2017 18:52:04 -0700 Subject: correct comment re feature-checking tooling The featureck.py that this comment referred to was removed in 9dd3c54a (March 2016). --- src/libsyntax/feature_gate.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index ee791609e8f..c82f0554393 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -112,8 +112,8 @@ macro_rules! declare_features { // was set. This is most important for knowing when a particular feature became // stable (active). // -// NB: The featureck.py script parses this information directly out of the source -// so take care when modifying it. +// NB: tools/tidy/src/features.rs parses this information directly out of the +// source, so take care when modifying it. declare_features! ( (active, asm, "1.0.0", Some(29722)), -- cgit 1.4.1-3-g733a5 From 8492ad2479379d2e07ccf2d3439ec29b19d164b8 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 22 Aug 2017 16:05:01 -0700 Subject: "soft" (warn instead of error) feature-gate for #[must_use] on functions Before `#[must_use]` for functions was implemented, a `#[must_use]` attribute on a function was a no-op. To avoid a breaking change in this behavior, we add an option for "this-and-such feature is experimental" feature-gate messages to be a mere warning rather than a compilation-halting failure (so old code that used to have a useless no-op `#[must_use]` attribute now warns rather than breaking). When we're on stable, we add a help note to clarify that the feature isn't "on." This is in support of #43302. --- src/libsyntax/feature_gate.rs | 60 ++++++++++++++++++---- src/test/compile-fail/feature-gate-fn_must_use.rs | 14 ++++- .../issue-43106-gating-of-builtin-attrs.rs | 2 +- 3 files changed, 63 insertions(+), 13 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c82f0554393..79f15f2fe19 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -918,20 +918,27 @@ struct Context<'a> { } macro_rules! gate_feature_fn { - ($cx: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr) => {{ - let (cx, has_feature, span, name, explain) = ($cx, $has_feature, $span, $name, $explain); + ($cx: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $level: expr) => {{ + let (cx, has_feature, span, + name, explain, level) = ($cx, $has_feature, $span, $name, $explain, $level); let has_feature: bool = has_feature(&$cx.features); debug!("gate_feature(feature = {:?}, span = {:?}); has? {}", name, span, has_feature); if !has_feature && !span.allows_unstable() { - emit_feature_err(cx.parse_sess, name, span, GateIssue::Language, explain); + leveled_feature_err(cx.parse_sess, name, span, GateIssue::Language, explain, level) + .emit(); } }} } macro_rules! gate_feature { ($cx: expr, $feature: ident, $span: expr, $explain: expr) => { - gate_feature_fn!($cx, |x:&Features| x.$feature, $span, stringify!($feature), $explain) - } + gate_feature_fn!($cx, |x:&Features| x.$feature, $span, + stringify!($feature), $explain, GateStrength::Hard) + }; + ($cx: expr, $feature: ident, $span: expr, $explain: expr, $level: expr) => { + gate_feature_fn!($cx, |x:&Features| x.$feature, $span, + stringify!($feature), $explain, $level) + }; } impl<'a> Context<'a> { @@ -941,7 +948,7 @@ impl<'a> Context<'a> { for &(n, ty, ref gateage) in BUILTIN_ATTRIBUTES { if name == n { if let Gated(_, name, desc, ref has_feature) = *gateage { - gate_feature_fn!(self, has_feature, attr.span, name, desc); + gate_feature_fn!(self, has_feature, attr.span, name, desc, GateStrength::Hard); } debug!("check_attribute: {:?} is builtin, {:?}, {:?}", attr.path, ty, gateage); return; @@ -1011,6 +1018,14 @@ pub enum GateIssue { Library(Option) } +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum GateStrength { + /// A hard error. (Most feature gates should use this.) + Hard, + /// Only a warning. (Use this only as backwards-compatibility demands.) + Soft, +} + pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: GateIssue, explain: &str) { feature_err(sess, feature, span, issue, explain).emit(); @@ -1018,6 +1033,11 @@ pub fn emit_feature_err(sess: &ParseSess, feature: &str, span: Span, issue: Gate pub fn feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: GateIssue, explain: &str) -> DiagnosticBuilder<'a> { + leveled_feature_err(sess, feature, span, issue, explain, GateStrength::Hard) +} + +fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: GateIssue, + explain: &str, level: GateStrength) -> DiagnosticBuilder<'a> { let diag = &sess.span_diagnostic; let issue = match issue { @@ -1025,10 +1045,15 @@ pub fn feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: Ga GateIssue::Library(lib) => lib, }; - let mut err = if let Some(n) = issue { - diag.struct_span_err(span, &format!("{} (see issue #{})", explain, n)) + let explanation = if let Some(n) = issue { + format!("{} (see issue #{})", explain, n) } else { - diag.struct_span_err(span, explain) + explain.to_owned() + }; + + let mut err = match level { + GateStrength::Hard => diag.struct_span_err(span, &explanation), + GateStrength::Soft => diag.struct_span_warn(span, &explanation), }; // #23973: do not suggest `#![feature(...)]` if we are in beta/stable @@ -1038,7 +1063,15 @@ pub fn feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue: Ga feature)); } + // If we're on stable and only emitting a "soft" warning, add a note to + // clarify that the feature isn't "on" (rather than being on but + // warning-worthy). + if !sess.unstable_features.is_nightly_build() && level == GateStrength::Soft { + err.help("a nightly build of the compiler is required to enable this feature"); + } + err + } const EXPLAIN_BOX_SYNTAX: &'static str = @@ -1095,6 +1128,12 @@ macro_rules! gate_feature_post { if !span.allows_unstable() { gate_feature!(cx.context, $feature, span, $explain) } + }}; + ($cx: expr, $feature: ident, $span: expr, $explain: expr, $level: expr) => {{ + let (cx, span) = ($cx, $span); + if !span.allows_unstable() { + gate_feature!(cx.context, $feature, span, $explain, $level) + } }} } @@ -1239,7 +1278,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } if attr::contains_name(&i.attrs[..], "must_use") { gate_feature_post!(&self, fn_must_use, i.span, - "`#[must_use]` on functions is experimental"); + "`#[must_use]` on functions is experimental", + GateStrength::Soft); } } diff --git a/src/test/compile-fail/feature-gate-fn_must_use.rs b/src/test/compile-fail/feature-gate-fn_must_use.rs index 7bb533251dc..a222f366145 100644 --- a/src/test/compile-fail/feature-gate-fn_must_use.rs +++ b/src/test/compile-fail/feature-gate-fn_must_use.rs @@ -8,7 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(rustc_attrs)] + #[must_use] -fn need_to_use_it() -> bool { true } //~ ERROR `#[must_use]` on functions is experimental +fn need_to_use_it() -> bool { true } //~ WARN `#[must_use]` on functions is experimental + -fn main() {} +// Feature gates are tidy-required to have a specially named (or +// comment-annotated) compile-fail test (which MUST fail), but for +// backwards-compatibility reasons, we want `#[must_use]` on functions to be +// compilable even if the `fn_must_use` feature is absent, thus necessitating +// the usage of `#[rustc_error]` here, pragmatically if awkwardly solving this +// dilemma until a superior solution can be devised. +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/feature-gate/issue-43106-gating-of-builtin-attrs.rs b/src/test/compile-fail/feature-gate/issue-43106-gating-of-builtin-attrs.rs index 021daf88420..204190d64ac 100644 --- a/src/test/compile-fail/feature-gate/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/compile-fail/feature-gate/issue-43106-gating-of-builtin-attrs.rs @@ -680,7 +680,7 @@ mod must_use { mod inner { #![must_use="1400"] } #[must_use = "1400"] fn f() { } - //~^ ERROR `#[must_use]` on functions is experimental + //~^ WARN `#[must_use]` on functions is experimental #[must_use = "1400"] struct S; -- cgit 1.4.1-3-g733a5 From 35c449419cfbd2bc1abc81077c95ef43ed766f97 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 22 Aug 2017 17:27:00 -0700 Subject: fn_must_use soft feature-gate warning on methods too, not only functions This continues to be in the matter of #43302. --- src/libsyntax/feature_gate.rs | 12 +++++++++++- src/test/compile-fail/feature-gate-fn_must_use.rs | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 79f15f2fe19..09574d5ba12 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1318,7 +1318,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { and possibly buggy"); } - ast::ItemKind::Impl(_, polarity, defaultness, _, _, _, _) => { + ast::ItemKind::Impl(_, polarity, defaultness, _, _, _, ref impl_items) => { if polarity == ast::ImplPolarity::Negative { gate_feature_post!(&self, optin_builtin_traits, i.span, @@ -1331,6 +1331,16 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { i.span, "specialization is unstable"); } + + for impl_item in impl_items { + if let ast::ImplItemKind::Method(..) = impl_item.node { + if attr::contains_name(&impl_item.attrs[..], "must_use") { + gate_feature_post!(&self, fn_must_use, impl_item.span, + "`#[must_use]` on methods is experimental", + GateStrength::Soft); + } + } + } } ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => { diff --git a/src/test/compile-fail/feature-gate-fn_must_use.rs b/src/test/compile-fail/feature-gate-fn_must_use.rs index a222f366145..2dd6b904072 100644 --- a/src/test/compile-fail/feature-gate-fn_must_use.rs +++ b/src/test/compile-fail/feature-gate-fn_must_use.rs @@ -10,6 +10,13 @@ #![feature(rustc_attrs)] +struct MyStruct; + +impl MyStruct { + #[must_use] + fn need_to_use_method() -> bool { true } //~ WARN `#[must_use]` on methods is experimental +} + #[must_use] fn need_to_use_it() -> bool { true } //~ WARN `#[must_use]` on functions is experimental -- cgit 1.4.1-3-g733a5 From f2fb45723ac7a1bfa897802256452d603a7adb2a Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 20 Aug 2017 08:22:46 -0700 Subject: syntax: remove unused field --- src/libsyntax/test.rs | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index eeb8bf72144..438eb2b8174 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(), -- cgit 1.4.1-3-g733a5 From 0463566f27dfc5979b5b12eb7cea670a4e3f991c Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 20 Aug 2017 08:40:07 -0700 Subject: 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(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 438eb2b8174..35dc9819529 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()); -- cgit 1.4.1-3-g733a5 From b3f50caee0e2f2f4d44e1c83bf73a112c2a398b1 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 19 Aug 2017 16:54:17 -0700 Subject: *: 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(-) (limited to 'src/libsyntax') diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 4e91be365e2..2d41ed64810 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 3a9cc1dd5a6..513b299fcf3 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 9a7cba21e3c..1defe308713 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 8e3b3f2074d..96fcc81e8e6 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 38143593eb1..55316db3d5a 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 546d2a21939..c270c6ae0db 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 43345c6d097..24430b2e377 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 83f2de54023..a0eacc817ca 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 4ee0c3d92bd..5b1cf2dee9a 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 348180a48dc..8be6f647023 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 90f4b364482..5a340f1323d 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 38665b403d6..3f425c24a91 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 1fb2c6b7dbb..6d0d6d115b7 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 a3c4f6a4b1d..90b3020fff9 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 5b0760e561e..03dc2f3c1ac 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 d9dbf787856..d4a02065761 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 55b39f22670..6a9833d3784 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 73125655792..eb47144d1f9 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 7a77939faa3..e7f4f9caee3 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 3483752d4ff..9fedee80d46 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 3947edecb5a..93b70ef8e4a 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 54eed6dc92a..da00ebc4b9e 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 d7b5d4a6fe3..e56c989b843 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 12b5ccf4837..0ce999c9b62 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 c68153140d9..8870033095c 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 755370b6465..5ef277f02ac 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 5f12f561faf..3c3e627ee4b 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 8fd87ae88a8..7d796dbd00f 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 7aa46799924..dba625e98fd 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 6c41aad98d5..28b99e1185b 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 ef1d9093df2..4cc65ee28e8 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 602b71dca05..a2a6d183e9c 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 eb82dddaf56..772b16bbecf 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 bfc76ee2f74..ee349e31128 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 bc9d760d148..9b74df865d7 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 6da42caf75b..1758e331129 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 81e83076f8c..90e17906328 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 294429b5b36..86feea13b17 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 1c3f296bed9..61a8165d26a 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 c3107d1f190..2e354252c15 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 30495f29745..cf1eb5cd52e 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 d568baa2cd7..e5a114caed0 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 43345b02bf6..e3c9f0a9345 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 439538a8b5e..fa39095d329 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 2385e3509ad..d34dcfa3ed3 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 4864e4581fa..ad0e582b1c3 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 5e34688f8cb..652bfa82b5c 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 2f425d8e986..461b49aa363 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 b8c52378554..7197f4e17e3 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) -- cgit 1.4.1-3-g733a5