From 49ee9f3f08ba4583bc722a663e43551067ace271 Mon Sep 17 00:00:00 2001 From: lukaramu Date: Thu, 24 Aug 2017 17:33:36 +0200 Subject: Fix inconsistent doc headings This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574. --- src/liballoc/allocator.rs | 24 ++++++++++++------------ src/liballoc/boxed.rs | 2 +- src/liballoc/slice.rs | 18 +++++++++--------- src/liballoc/str.rs | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/allocator.rs b/src/liballoc/allocator.rs index fc6585a9f95..f14f2702324 100644 --- a/src/liballoc/allocator.rs +++ b/src/liballoc/allocator.rs @@ -110,7 +110,7 @@ impl Layout { /// Creates a layout, bypassing all checks. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe as it does not verify that `align` is /// a power-of-two that is also less than or equal to 2^31, nor @@ -485,7 +485,7 @@ pub unsafe trait Alloc { /// behavior, e.g. to ensure initialization to particular sets of /// bit patterns.) /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure that `layout` has non-zero size. @@ -513,7 +513,7 @@ pub unsafe trait Alloc { /// Deallocate the memory referenced by `ptr`. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -617,7 +617,7 @@ pub unsafe trait Alloc { /// behavior is well-defined (though underspecified) when this /// constraint is violated; further discussion below. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -688,7 +688,7 @@ pub unsafe trait Alloc { /// Behaves like `alloc`, but also ensures that the contents /// are set to zero before being returned. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `alloc` is. /// @@ -714,7 +714,7 @@ pub unsafe trait Alloc { /// the returned block. For some `layout` inputs, like arrays, this /// may include extra storage usable for additional data. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `alloc` is. /// @@ -736,7 +736,7 @@ pub unsafe trait Alloc { /// the returned block. For some `layout` inputs, like arrays, this /// may include extra storage usable for additional data. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe for the same reasons that `realloc` is. /// @@ -770,7 +770,7 @@ pub unsafe trait Alloc { /// memory block referenced by `ptr` has not been transferred, and /// the contents of the memory block are unaltered. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -827,7 +827,7 @@ pub unsafe trait Alloc { /// the memory block has not been transferred, and the contents of /// the memory block are unaltered. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -920,7 +920,7 @@ pub unsafe trait Alloc { /// /// Captures a common usage pattern for allocators. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure both: @@ -993,7 +993,7 @@ pub unsafe trait Alloc { /// The returned block is suitable for passing to the /// `alloc`/`realloc` methods of this allocator. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure all of the following: @@ -1037,7 +1037,7 @@ pub unsafe trait Alloc { /// /// Captures a common usage pattern for allocators. /// - /// # Unsafety + /// # Safety /// /// This function is unsafe because undefined behavior can result /// if the caller does not ensure both: diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index c0d43d9c527..82aac4dbf63 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -633,7 +633,7 @@ impl FusedIterator for Box {} /// that `FnBox` may be deprecated in the future if `Box` /// closures become directly usable.) /// -/// ### Example +/// # Examples /// /// Here is a snippet of code which creates a hashmap full of boxed /// once closures and then removes them one by one, calling each diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 356ca7a5f5e..fd60e8aaded 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -171,7 +171,7 @@ mod hack { impl [T] { /// Returns the number of elements in the slice. /// - /// # Example + /// # Examples /// /// ``` /// let a = [1, 2, 3]; @@ -185,7 +185,7 @@ impl [T] { /// Returns `true` if the slice has a length of 0. /// - /// # Example + /// # Examples /// /// ``` /// let a = [1, 2, 3]; @@ -523,7 +523,7 @@ impl [T] { /// Reverses the order of elements in the slice, in place. /// - /// # Example + /// # Examples /// /// ``` /// let mut v = [1, 2, 3]; @@ -580,7 +580,7 @@ impl [T] { /// /// Panics if `size` is 0. /// - /// # Example + /// # Examples /// /// ``` /// let slice = ['r', 'u', 's', 't']; @@ -613,7 +613,7 @@ impl [T] { /// /// Panics if `size` is 0. /// - /// # Example + /// # Examples /// /// ``` /// let slice = ['l', 'o', 'r', 'e', 'm']; @@ -1040,7 +1040,7 @@ impl [T] { /// `Err` is returned, containing the index where a matching /// element could be inserted while maintaining sorted order. /// - /// # Example + /// # Examples /// /// Looks up a series of four elements. The first is found, with a /// uniquely determined position; the second and third are not @@ -1074,7 +1074,7 @@ impl [T] { /// `Err` is returned, containing the index where a matching /// element could be inserted while maintaining sorted order. /// - /// # Example + /// # Examples /// /// Looks up a series of four elements. The first is found, with a /// uniquely determined position; the second and third are not @@ -1419,7 +1419,7 @@ impl [T] { /// /// This function will panic if the two slices have different lengths. /// - /// # Example + /// # Examples /// /// ``` /// let mut dst = [0, 0, 0]; @@ -1445,7 +1445,7 @@ impl [T] { /// /// This function will panic if the two slices have different lengths. /// - /// # Example + /// # Examples /// /// ``` /// let mut dst = [0, 0, 0]; diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 80317cd763b..79b2bbce2af 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -1714,7 +1714,7 @@ impl str { /// /// [`Err`]: str/trait.FromStr.html#associatedtype.Err /// - /// # Example + /// # Examples /// /// Basic usage /// -- 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/liballoc') 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 From 0a6c724ddedf10e60b6fff76a9347cabf1807c04 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 25 Aug 2017 23:09:00 +0200 Subject: Add missing link in string doc --- src/liballoc/string.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/liballoc') diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 96bd6273c94..b1919c7c968 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -82,7 +82,7 @@ use boxed::Box; /// /// # Examples /// -/// You can create a `String` from a literal string with `String::from`: +/// You can create a `String` from a literal string with [`String::from`]: /// /// ``` /// let hello = String::from("Hello, world!"); @@ -98,6 +98,7 @@ use boxed::Box; /// hello.push_str("orld!"); /// ``` /// +/// [`String::from`]: #method.from /// [`char`]: ../../std/primitive.char.html /// [`push`]: #method.push /// [`push_str`]: #method.push_str -- cgit 1.4.1-3-g733a5 From 611b1111394a065783091b17b025c34427af3d68 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Sat, 24 Jun 2017 17:48:27 +0900 Subject: Move unused-extern-crate to late pass --- src/Cargo.lock | 4 +--- src/liballoc/tests/lib.rs | 5 ----- src/libcore/tests/lib.rs | 4 ---- src/librustc/dep_graph/dep_node.rs | 2 ++ src/librustc/lib.rs | 4 ++-- src/librustc/ty/context.rs | 3 +++ src/librustc/ty/maps.rs | 14 ++++++++++++++ src/librustc/ty/mod.rs | 1 + src/librustc_borrowck/Cargo.toml | 1 - src/librustc_borrowck/lib.rs | 2 -- src/librustc_driver/driver.rs | 1 + src/librustc_metadata/Cargo.toml | 1 - src/librustc_metadata/cstore_impl.rs | 2 ++ src/librustc_metadata/lib.rs | 1 - src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_resolve/check_unused.rs | 6 ++---- src/librustc_resolve/lib.rs | 6 ++++-- src/librustc_resolve/resolve_imports.rs | 8 +++++--- src/librustc_tsan/Cargo.toml | 1 + src/librustc_tsan/lib.rs | 9 ++++++++- src/librustc_typeck/check_unused.rs | 10 ++++++++++ src/libstd/lib.rs | 3 ++- src/libstd/prelude/mod.rs | 1 + src/libstd/sys/unix/ext/fs.rs | 2 -- src/libsyntax_ext/Cargo.toml | 1 - src/libsyntax_ext/lib.rs | 1 - src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs | 1 + src/test/compile-fail/E0254.rs | 1 + src/test/compile-fail/E0259.rs | 1 + src/test/compile-fail/E0260.rs | 1 + src/test/compile-fail/enable-unstable-lib-feature.rs | 1 + src/test/compile-fail/issue-36881.rs | 1 + src/test/compile-fail/lint-stability-deprecated.rs | 2 +- src/test/compile-fail/macro-reexport-malformed-1.rs | 1 + src/test/compile-fail/macro-reexport-malformed-2.rs | 1 + src/test/compile-fail/macro-reexport-malformed-3.rs | 1 + src/test/compile-fail/macro-use-bad-args-1.rs | 1 + src/test/compile-fail/macro-use-bad-args-2.rs | 1 + src/test/compile-fail/no-std-inject.rs | 1 + src/test/compile-fail/placement-expr-unstable.rs | 2 -- .../resolve-conflict-extern-crate-vs-extern-crate.rs | 1 + src/test/compile-fail/resolve_self_super_hint.rs | 1 + src/test/compile-fail/unused-attr.rs | 2 +- 43 files changed, 76 insertions(+), 39 deletions(-) (limited to 'src/liballoc') diff --git a/src/Cargo.lock b/src/Cargo.lock index ad96ff40cd6..123c884585c 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -1327,7 +1327,6 @@ dependencies = [ "graphviz 0.0.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc 0.0.0", - "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", "rustc_mir 0.0.0", "syntax 0.0.0", @@ -1464,7 +1463,6 @@ dependencies = [ "proc_macro 0.0.0", "rustc 0.0.0", "rustc_back 0.0.0", - "rustc_const_math 0.0.0", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", "serialize 0.0.0", @@ -1605,6 +1603,7 @@ dependencies = [ name = "rustc_tsan" version = "0.0.0" dependencies = [ + "alloc 0.0.0", "alloc_system 0.0.0", "build_helper 0.1.0", "cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1859,7 +1858,6 @@ name = "syntax_ext" version = "0.0.0" dependencies = [ "fmt_macros 0.0.0", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc_macro 0.0.0", "rustc_errors 0.0.0", "syntax 0.0.0", diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 86309dd87de..8f3e71ef794 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -10,7 +10,6 @@ #![deny(warnings)] -#![feature(alloc)] #![feature(attr_literals)] #![feature(box_syntax)] #![feature(inclusive_range_syntax)] @@ -27,14 +26,10 @@ #![feature(splice)] #![feature(str_escape)] #![feature(string_retain)] -#![feature(test)] #![feature(unboxed_closures)] #![feature(unicode)] -extern crate alloc; -extern crate test; extern crate std_unicode; -extern crate core; use std::hash::{Hash, Hasher}; use std::collections::hash_map::DefaultHasher; diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 84a3be99c27..ab2022b1824 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -26,7 +26,6 @@ #![feature(inclusive_range)] #![feature(inclusive_range_syntax)] #![feature(iter_rfind)] -#![feature(libc)] #![feature(nonzero)] #![feature(ord_max_min)] #![feature(rand)] @@ -41,13 +40,10 @@ #![feature(test)] #![feature(trusted_len)] #![feature(try_from)] -#![feature(unicode)] #![feature(unique)] extern crate core; extern crate test; -extern crate libc; -extern crate std_unicode; extern crate rand; mod any; diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index 9e5d4081231..01fff605283 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -522,6 +522,8 @@ define_dep_nodes!( <'tcx> [] DylibDepFormats(DefId), [] IsAllocator(DefId), [] IsPanicRuntime(DefId), + [] IsCompilerBuiltins(DefId), + [] HasGlobalAllocator(DefId), [] ExternCrate(DefId), [] LintLevels, ); diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 03dc2f3c1ac..900f4031d2f 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -26,7 +26,6 @@ #![feature(core_intrinsics)] #![feature(discriminant_value)] #![feature(i128_type)] -#![feature(libc)] #![feature(never_type)] #![feature(nonzero)] #![feature(quote)] @@ -45,7 +44,6 @@ extern crate core; extern crate fmt_macros; extern crate getopts; extern crate graphviz; -extern crate libc; extern crate owning_ref; extern crate rustc_back; extern crate rustc_data_structures; @@ -62,7 +60,9 @@ extern crate serialize as rustc_serialize; // used by deriving // Note that librustc doesn't actually depend on these crates, see the note in // `Cargo.toml` for this crate about why these are here. +#[allow(unused_extern_crates)] extern crate flate2; +#[allow(unused_extern_crates)] extern crate test; #[macro_use] diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index da1039c5de1..0f815584378 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -797,6 +797,8 @@ pub struct GlobalCtxt<'tcx> { pub maybe_unused_trait_imports: NodeSet, + pub maybe_unused_extern_crates: Vec<(NodeId, Span, CrateNum)>, + // Internal cache for metadata decoding. No need to track deps on this. pub rcache: RefCell>>, @@ -1038,6 +1040,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { mir_passes, freevars: RefCell::new(resolutions.freevars), maybe_unused_trait_imports: resolutions.maybe_unused_trait_imports, + maybe_unused_extern_crates: resolutions.maybe_unused_extern_crates, rcache: RefCell::new(FxHashMap()), normalized_cache: RefCell::new(FxHashMap()), inhabitedness_cache: RefCell::new(FxHashMap()), diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index 042ec49b0bd..a73202ced61 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -516,6 +516,18 @@ impl<'tcx> QueryDescription for queries::is_panic_runtime<'tcx> { } } +impl<'tcx> QueryDescription for queries::is_compiler_builtins<'tcx> { + fn describe(_: TyCtxt, _: DefId) -> String { + "checking if the crate is_compiler_builtins".to_string() + } +} + +impl<'tcx> QueryDescription for queries::has_global_allocator<'tcx> { + fn describe(_: TyCtxt, _: DefId) -> String { + "checking if the crate has_global_allocator".to_string() + } +} + impl<'tcx> QueryDescription for queries::extern_crate<'tcx> { fn describe(_: TyCtxt, _: DefId) -> String { "getting crate's ExternCrateData".to_string() @@ -1079,6 +1091,8 @@ define_maps! { <'tcx> [] is_allocator: IsAllocator(DefId) -> bool, [] is_panic_runtime: IsPanicRuntime(DefId) -> bool, + [] is_compiler_builtins: IsCompilerBuiltins(DefId) -> bool, + [] has_global_allocator: HasGlobalAllocator(DefId) -> bool, [] extern_crate: ExternCrate(DefId) -> Rc>, diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 852bd48a5ee..efd735b3f28 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -131,6 +131,7 @@ pub struct Resolutions { pub freevars: FreevarMap, pub trait_map: TraitMap, pub maybe_unused_trait_imports: NodeSet, + pub maybe_unused_extern_crates: Vec<(NodeId, Span, CrateNum)>, pub export_map: ExportMap, } diff --git a/src/librustc_borrowck/Cargo.toml b/src/librustc_borrowck/Cargo.toml index af99c0e9387..25f02537490 100644 --- a/src/librustc_borrowck/Cargo.toml +++ b/src/librustc_borrowck/Cargo.toml @@ -15,6 +15,5 @@ syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } graphviz = { path = "../libgraphviz" } rustc = { path = "../librustc" } -rustc_data_structures = { path = "../librustc_data_structures" } rustc_mir = { path = "../librustc_mir" } rustc_errors = { path = "../librustc_errors" } diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index e7f4f9caee3..9bedbfed5db 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -28,9 +28,7 @@ extern crate rustc_errors as errors; extern crate graphviz as dot; #[macro_use] extern crate rustc; -extern crate rustc_data_structures; extern crate rustc_mir; -extern crate core; // for NonZero pub use borrowck::check_crate; pub use borrowck::build_borrowck_dataflow_data_for_fn; diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 163c698e3ff..96688c6ac9c 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -877,6 +877,7 @@ pub fn phase_2_configure_and_expand(sess: &Session, export_map: resolver.export_map, trait_map: resolver.trait_map, maybe_unused_trait_imports: resolver.maybe_unused_trait_imports, + maybe_unused_extern_crates: resolver.maybe_unused_extern_crates, }, hir_forest, }) diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 67b459ea18f..40b75be36fe 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -15,7 +15,6 @@ owning_ref = "0.3.3" proc_macro = { path = "../libproc_macro" } rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } -rustc_const_math = { path = "../librustc_const_math" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } serialize = { path = "../libserialize" } diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/cstore_impl.rs index cfba11b5151..ad320a7ff3d 100644 --- a/src/librustc_metadata/cstore_impl.rs +++ b/src/librustc_metadata/cstore_impl.rs @@ -137,6 +137,8 @@ provide! { <'tcx> tcx, def_id, cdata, dylib_dependency_formats => { Rc::new(cdata.get_dylib_dependency_formats(&tcx.dep_graph)) } is_panic_runtime => { cdata.is_panic_runtime(&tcx.dep_graph) } + is_compiler_builtins => { cdata.is_compiler_builtins(&tcx.dep_graph) } + has_global_allocator => { cdata.has_global_allocator(&tcx.dep_graph) } extern_crate => { Rc::new(cdata.extern_crate.get()) } } diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 7d796dbd00f..f79abecf9da 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -39,7 +39,6 @@ extern crate proc_macro; #[macro_use] extern crate rustc; extern crate rustc_back; -extern crate rustc_const_math; extern crate rustc_data_structures; mod diagnostics; diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 47fa5357abf..a07de6e6914 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -264,7 +264,7 @@ impl<'a> Resolver<'a> { id: item.id, parent, imported_module: Cell::new(Some(module)), - subclass: ImportDirectiveSubclass::ExternCrate, + subclass: ImportDirectiveSubclass::ExternCrate { cnum: crate_id }, span: item.span, module_path: Vec::new(), vis: Cell::new(vis), diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index 05c227340d8..6e7f212bd4d 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -120,10 +120,8 @@ pub fn check_crate(resolver: &mut Resolver, krate: &ast::Crate) { _ if directive.used.get() || directive.vis.get() == ty::Visibility::Public || directive.span.source_equal(&DUMMY_SP) => {} - ImportDirectiveSubclass::ExternCrate => { - let lint = lint::builtin::UNUSED_EXTERN_CRATES; - let msg = "unused extern crate"; - ; resolver.session.buffer_lint(lint, directive.id, directive.span, msg) + ImportDirectiveSubclass::ExternCrate { cnum } => { + resolver.maybe_unused_extern_crates.push((directive.id, directive.span, cnum)); } ImportDirectiveSubclass::MacroUse => { let lint = lint::builtin::UNUSED_IMPORTS; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index ee349e31128..324d6081635 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -35,7 +35,7 @@ use rustc::middle::cstore::CrateLoader; use rustc::session::Session; use rustc::lint; use rustc::hir::def::*; -use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, DefId}; +use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, CrateNum, DefId}; use rustc::ty; use rustc::hir::{Freevar, FreevarMap, TraitCandidate, TraitMap, GlobMap}; use rustc::util::nodemap::{NodeMap, NodeSet, FxHashMap, FxHashSet, DefIdMap}; @@ -1102,7 +1102,7 @@ impl<'a> NameBinding<'a> { match self.kind { NameBindingKind::Import { directive: &ImportDirective { - subclass: ImportDirectiveSubclass::ExternCrate, .. + subclass: ImportDirectiveSubclass::ExternCrate { .. }, .. }, .. } => true, _ => false, @@ -1250,6 +1250,7 @@ pub struct Resolver<'a> { used_imports: FxHashSet<(NodeId, Namespace)>, pub maybe_unused_trait_imports: NodeSet, + pub maybe_unused_extern_crates: Vec<(NodeId, Span, CrateNum)>, /// privacy errors are delayed until the end in order to deduplicate them privacy_errors: Vec>, @@ -1457,6 +1458,7 @@ impl<'a> Resolver<'a> { used_imports: FxHashSet(), maybe_unused_trait_imports: NodeSet(), + maybe_unused_extern_crates: Vec::new(), privacy_errors: Vec::new(), ambiguity_errors: Vec::new(), diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index 5616971e9d1..d4846fb1bd5 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -19,7 +19,7 @@ use {resolve_error, ResolutionError}; use rustc::ty; use rustc::lint::builtin::PUB_USE_OF_PRIVATE_EXTERN_CRATE; -use rustc::hir::def_id::DefId; +use rustc::hir::def_id::{CrateNum, DefId}; use rustc::hir::def::*; use rustc::util::nodemap::{FxHashMap, FxHashSet}; @@ -48,7 +48,9 @@ pub enum ImportDirectiveSubclass<'a> { max_vis: Cell, // The visibility of the greatest reexport. // n.b. `max_vis` is only used in `finalize_import` to check for reexport errors. }, - ExternCrate, + ExternCrate { + cnum: CrateNum, + }, MacroUse, } @@ -924,7 +926,7 @@ fn import_directive_subclass_to_string(subclass: &ImportDirectiveSubclass) -> St match *subclass { SingleImport { source, .. } => source.to_string(), GlobImport { .. } => "*".to_string(), - ExternCrate => "".to_string(), + ExternCrate { .. } => "".to_string(), MacroUse => "#[macro_use]".to_string(), } } diff --git a/src/librustc_tsan/Cargo.toml b/src/librustc_tsan/Cargo.toml index 97c1181e3a2..7b83985ba67 100644 --- a/src/librustc_tsan/Cargo.toml +++ b/src/librustc_tsan/Cargo.toml @@ -14,5 +14,6 @@ build_helper = { path = "../build_helper" } cmake = "0.1.18" [dependencies] +alloc = { path = "../liballoc" } alloc_system = { path = "../liballoc_system" } core = { path = "../libcore" } diff --git a/src/librustc_tsan/lib.rs b/src/librustc_tsan/lib.rs index 54941362e84..3429e3bda0f 100644 --- a/src/librustc_tsan/lib.rs +++ b/src/librustc_tsan/lib.rs @@ -9,8 +9,10 @@ // except according to those terms. #![sanitizer_runtime] -#![feature(sanitizer_runtime)] #![feature(alloc_system)] +#![feature(allocator_api)] +#![feature(global_allocator)] +#![feature(sanitizer_runtime)] #![feature(staged_api)] #![no_std] #![unstable(feature = "sanitizer_runtime_lib", @@ -18,3 +20,8 @@ issue = "0")] extern crate alloc_system; + +use alloc_system::System; + +#[global_allocator] +static ALLOC: System = System; diff --git a/src/librustc_typeck/check_unused.rs b/src/librustc_typeck/check_unused.rs index e95d49f00bf..bfa9371d138 100644 --- a/src/librustc_typeck/check_unused.rs +++ b/src/librustc_typeck/check_unused.rs @@ -72,4 +72,14 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let mut visitor = CheckVisitor { tcx, used_trait_imports }; tcx.hir.krate().visit_all_item_likes(&mut visitor); + + for &(id, span, cnum) in &tcx.maybe_unused_extern_crates { + if !tcx.is_compiler_builtins(cnum.as_def_id()) + && !tcx.is_panic_runtime(cnum.as_def_id()) + && !tcx.has_global_allocator(cnum.as_def_id()) { + let lint = lint::builtin::UNUSED_EXTERN_CRATES; + let msg = "unused extern crate"; + tcx.lint_node(lint, id, span, msg); + } + } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cf1eb5cd52e..9b80a5c462f 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -283,7 +283,7 @@ #![feature(on_unimplemented)] #![feature(oom)] #![feature(optin_builtin_traits)] -#![feature(panic_unwind)] +#![cfg_attr(any(unix, target_os = "redox"), feature(panic_unwind))] #![feature(peek)] #![feature(placement_in_syntax)] #![feature(placement_new_protocol)] @@ -358,6 +358,7 @@ extern crate std_unicode; extern crate libc; // We always need an unwinder currently for backtraces +#[cfg(any(unix, target_os = "redox"))] extern crate unwind; // compiler-rt intrinsics diff --git a/src/libstd/prelude/mod.rs b/src/libstd/prelude/mod.rs index 49cdba21a1d..538753d8692 100644 --- a/src/libstd/prelude/mod.rs +++ b/src/libstd/prelude/mod.rs @@ -23,6 +23,7 @@ //! On a technical level, Rust inserts //! //! ``` +//! # #[allow(unused_extern_crates)] //! extern crate std; //! ``` //! diff --git a/src/libstd/sys/unix/ext/fs.rs b/src/libstd/sys/unix/ext/fs.rs index a94585723a1..f44b9aa9615 100644 --- a/src/libstd/sys/unix/ext/fs.rs +++ b/src/libstd/sys/unix/ext/fs.rs @@ -154,8 +154,6 @@ pub trait OpenOptionsExt { /// # Examples /// /// ```no_run - /// # #![feature(libc)] - /// extern crate libc; /// use std::fs::OpenOptions; /// use std::os::unix::fs::OpenOptionsExt; /// diff --git a/src/libsyntax_ext/Cargo.toml b/src/libsyntax_ext/Cargo.toml index bdcec26cb83..1c470240288 100644 --- a/src/libsyntax_ext/Cargo.toml +++ b/src/libsyntax_ext/Cargo.toml @@ -10,7 +10,6 @@ crate-type = ["dylib"] [dependencies] fmt_macros = { path = "../libfmt_macros" } -log = "0.3" proc_macro = { path = "../libproc_macro" } rustc_errors = { path = "../librustc_errors" } syntax = { path = "../libsyntax" } diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index fa39095d329..42bbb4ae0cb 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -18,7 +18,6 @@ #![feature(proc_macro_internals)] extern crate fmt_macros; -extern crate log; #[macro_use] extern crate syntax; extern crate syntax_pos; diff --git a/src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs b/src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs index edbb77fe390..bb292e2e52a 100644 --- a/src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs +++ b/src/test/compile-fail-fulldeps/plugin-as-extern-crate.rs @@ -15,6 +15,7 @@ // libsyntax is not compiled for it. #![deny(plugin_as_library)] +#![allow(unused_extern_crates)] extern crate macro_crate_test; //~ ERROR compiler plugin used as an ordinary library diff --git a/src/test/compile-fail/E0254.rs b/src/test/compile-fail/E0254.rs index 89227f6b010..996a6b97cd9 100644 --- a/src/test/compile-fail/E0254.rs +++ b/src/test/compile-fail/E0254.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(alloc)] +#![allow(unused_extern_crates)] extern crate alloc; //~^ NOTE previous import of the extern crate `alloc` here diff --git a/src/test/compile-fail/E0259.rs b/src/test/compile-fail/E0259.rs index 60bcd2ae076..c285c4d9e00 100644 --- a/src/test/compile-fail/E0259.rs +++ b/src/test/compile-fail/E0259.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(alloc, libc)] +#![allow(unused_extern_crates)] extern crate alloc; //~^ NOTE previous import of the extern crate `alloc` here diff --git a/src/test/compile-fail/E0260.rs b/src/test/compile-fail/E0260.rs index 5e802bbbe3d..ad8888e58f7 100644 --- a/src/test/compile-fail/E0260.rs +++ b/src/test/compile-fail/E0260.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(alloc)] +#![allow(unused_extern_crates)] extern crate alloc; //~^ NOTE previous import of the extern crate `alloc` here diff --git a/src/test/compile-fail/enable-unstable-lib-feature.rs b/src/test/compile-fail/enable-unstable-lib-feature.rs index c65b2366bf1..bc9e2345f0e 100644 --- a/src/test/compile-fail/enable-unstable-lib-feature.rs +++ b/src/test/compile-fail/enable-unstable-lib-feature.rs @@ -16,6 +16,7 @@ #![deny(non_snake_case)] // To trigger a hard error // Shouldn't generate a warning about unstable features +#[allow(unused_extern_crates)] extern crate stability_cfg2; pub fn BOGUS() { } //~ ERROR diff --git a/src/test/compile-fail/issue-36881.rs b/src/test/compile-fail/issue-36881.rs index e05dc066199..0f5aa24926b 100644 --- a/src/test/compile-fail/issue-36881.rs +++ b/src/test/compile-fail/issue-36881.rs @@ -11,6 +11,7 @@ // aux-build:issue-36881-aux.rs fn main() { + #[allow(unused_extern_crates)] extern crate issue_36881_aux; use issue_36881_aux::Foo; //~ ERROR unresolved import } diff --git a/src/test/compile-fail/lint-stability-deprecated.rs b/src/test/compile-fail/lint-stability-deprecated.rs index 8443518b3f5..9bc2c021904 100644 --- a/src/test/compile-fail/lint-stability-deprecated.rs +++ b/src/test/compile-fail/lint-stability-deprecated.rs @@ -14,7 +14,7 @@ // aux-build:stability_cfg2.rs #![warn(deprecated)] -#![allow(dead_code)] +#![allow(dead_code, unused_extern_crates)] #![feature(staged_api, test_feature, rustc_attrs)] #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/compile-fail/macro-reexport-malformed-1.rs b/src/test/compile-fail/macro-reexport-malformed-1.rs index ea2dfca0714..a2778a83130 100644 --- a/src/test/compile-fail/macro-reexport-malformed-1.rs +++ b/src/test/compile-fail/macro-reexport-malformed-1.rs @@ -11,5 +11,6 @@ #![no_std] #![feature(macro_reexport)] +#[allow(unused_extern_crates)] #[macro_reexport] //~ ERROR bad macro reexport extern crate std; diff --git a/src/test/compile-fail/macro-reexport-malformed-2.rs b/src/test/compile-fail/macro-reexport-malformed-2.rs index 844955fb7e6..c5af9e3799d 100644 --- a/src/test/compile-fail/macro-reexport-malformed-2.rs +++ b/src/test/compile-fail/macro-reexport-malformed-2.rs @@ -11,5 +11,6 @@ #![no_std] #![feature(macro_reexport)] +#[allow(unused_extern_crates)] #[macro_reexport="foo"] //~ ERROR bad macro reexport extern crate std; diff --git a/src/test/compile-fail/macro-reexport-malformed-3.rs b/src/test/compile-fail/macro-reexport-malformed-3.rs index 381c22854e6..d72d1ee004e 100644 --- a/src/test/compile-fail/macro-reexport-malformed-3.rs +++ b/src/test/compile-fail/macro-reexport-malformed-3.rs @@ -11,5 +11,6 @@ #![no_std] #![feature(macro_reexport)] +#[allow(unused_extern_crates)] #[macro_reexport(foo="bar")] //~ ERROR bad macro reexport extern crate std; diff --git a/src/test/compile-fail/macro-use-bad-args-1.rs b/src/test/compile-fail/macro-use-bad-args-1.rs index 39c09c69779..a07cc834411 100644 --- a/src/test/compile-fail/macro-use-bad-args-1.rs +++ b/src/test/compile-fail/macro-use-bad-args-1.rs @@ -10,5 +10,6 @@ #![no_std] +#[allow(unused_extern_crates)] #[macro_use(foo(bar))] //~ ERROR bad macro import extern crate std; diff --git a/src/test/compile-fail/macro-use-bad-args-2.rs b/src/test/compile-fail/macro-use-bad-args-2.rs index 11a0108b99b..89004f16897 100644 --- a/src/test/compile-fail/macro-use-bad-args-2.rs +++ b/src/test/compile-fail/macro-use-bad-args-2.rs @@ -10,5 +10,6 @@ #![no_std] +#[allow(unused_extern_crates)] #[macro_use(foo="bar")] //~ ERROR bad macro import extern crate std; diff --git a/src/test/compile-fail/no-std-inject.rs b/src/test/compile-fail/no-std-inject.rs index f384eafa34b..49064853d21 100644 --- a/src/test/compile-fail/no-std-inject.rs +++ b/src/test/compile-fail/no-std-inject.rs @@ -9,6 +9,7 @@ // except according to those terms. #![no_std] +#![allow(unused_extern_crates)] extern crate core; //~ ERROR: the name `core` is defined multiple times extern crate std; diff --git a/src/test/compile-fail/placement-expr-unstable.rs b/src/test/compile-fail/placement-expr-unstable.rs index cc73cbe15fe..35695efe1a9 100644 --- a/src/test/compile-fail/placement-expr-unstable.rs +++ b/src/test/compile-fail/placement-expr-unstable.rs @@ -12,8 +12,6 @@ #![feature(placement_in_syntax)] -extern crate core; - fn main() { use std::boxed::HEAP; //~ ERROR use of unstable library feature diff --git a/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs b/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs index 87a17c0f19a..6a04a2c3704 100644 --- a/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs +++ b/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#[allow(unused_extern_crates)] extern crate std; //~^ ERROR the name `std` is defined multiple times diff --git a/src/test/compile-fail/resolve_self_super_hint.rs b/src/test/compile-fail/resolve_self_super_hint.rs index 09951348448..a89fd802baf 100644 --- a/src/test/compile-fail/resolve_self_super_hint.rs +++ b/src/test/compile-fail/resolve_self_super_hint.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(alloc)] +#![allow(unused_extern_crates)] mod a { extern crate alloc; diff --git a/src/test/compile-fail/unused-attr.rs b/src/test/compile-fail/unused-attr.rs index 6416e1cacdc..e20d03478ec 100644 --- a/src/test/compile-fail/unused-attr.rs +++ b/src/test/compile-fail/unused-attr.rs @@ -9,7 +9,7 @@ // except according to those terms. #![deny(unused_attributes)] -#![allow(dead_code, unused_imports)] +#![allow(dead_code, unused_imports, unused_extern_crates)] #![feature(custom_attribute)] #![foo] //~ ERROR unused attribute -- cgit 1.4.1-3-g733a5