1
Fork 0

Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPC

Remove unused feature gates

I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
This commit is contained in:
Dylan DPC 2020-02-11 16:36:54 +01:00 committed by GitHub
commit ec0cfd1d01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 14 additions and 70 deletions

View file

@ -103,7 +103,6 @@
//! More documentation can be found in each respective module below, and you can //! More documentation can be found in each respective module below, and you can
//! also check out the `src/bootstrap/README.md` file for more information. //! also check out the `src/bootstrap/README.md` file for more information.
#![feature(core_intrinsics)]
#![feature(drain_filter)] #![feature(drain_filter)]
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};

View file

@ -27,7 +27,6 @@
//! This API is completely unstable and subject to change. //! This API is completely unstable and subject to change.
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(arbitrary_self_types)]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
@ -39,21 +38,15 @@
#![feature(marker_trait_attr)] #![feature(marker_trait_attr)]
#![feature(extern_types)] #![feature(extern_types)]
#![feature(nll)] #![feature(nll)]
#![feature(optin_builtin_traits)]
#![feature(option_expect_none)] #![feature(option_expect_none)]
#![feature(range_is_empty)] #![feature(range_is_empty)]
#![feature(specialization)] #![feature(specialization)]
#![feature(unboxed_closures)]
#![feature(thread_local)]
#![feature(trace_macros)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(vec_remove_item)] #![feature(vec_remove_item)]
#![feature(stmt_expr_attributes)] #![feature(stmt_expr_attributes)]
#![feature(integer_atomics)]
#![feature(test)] #![feature(test)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(log_syntax)]
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(hash_raw_entry)] #![feature(hash_raw_entry)]

View file

@ -6,18 +6,11 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(const_cstr_unchecked)] #![feature(const_cstr_unchecked)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(extern_types)] #![feature(extern_types)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(libc)]
#![feature(nll)] #![feature(nll)]
#![feature(optin_builtin_traits)]
#![feature(concat_idents)]
#![feature(link_args)]
#![feature(static_nobundle)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
@ -196,7 +189,7 @@ unsafe impl Sync for LlvmCodegenBackend {}
impl LlvmCodegenBackend { impl LlvmCodegenBackend {
pub fn new() -> Box<dyn CodegenBackend> { pub fn new() -> Box<dyn CodegenBackend> {
box LlvmCodegenBackend(()) Box::new(LlvmCodegenBackend(()))
} }
} }
@ -245,7 +238,7 @@ impl CodegenBackend for LlvmCodegenBackend {
} }
fn metadata_loader(&self) -> Box<MetadataLoaderDyn> { fn metadata_loader(&self) -> Box<MetadataLoaderDyn> {
box metadata::LlvmMetadataLoader Box::new(metadata::LlvmMetadataLoader)
} }
fn provide(&self, providers: &mut ty::query::Providers<'_>) { fn provide(&self, providers: &mut ty::query::Providers<'_>) {
@ -262,12 +255,12 @@ impl CodegenBackend for LlvmCodegenBackend {
metadata: EncodedMetadata, metadata: EncodedMetadata,
need_metadata_module: bool, need_metadata_module: bool,
) -> Box<dyn Any> { ) -> Box<dyn Any> {
box rustc_codegen_ssa::base::codegen_crate( Box::new(rustc_codegen_ssa::base::codegen_crate(
LlvmCodegenBackend(()), LlvmCodegenBackend(()),
tcx, tcx,
metadata, metadata,
need_metadata_module, need_metadata_module,
) ))
} }
fn join_codegen( fn join_codegen(

View file

@ -22,10 +22,11 @@ impl MetadataLoader for LlvmMetadataLoader {
// Use ArchiveRO for speed here, it's backed by LLVM and uses mmap // Use ArchiveRO for speed here, it's backed by LLVM and uses mmap
// internally to read the file. We also avoid even using a memcpy by // internally to read the file. We also avoid even using a memcpy by
// just keeping the archive along while the metadata is in use. // just keeping the archive along while the metadata is in use.
let archive = ArchiveRO::open(filename).map(|ar| OwningRef::new(box ar)).map_err(|e| { let archive =
debug!("llvm didn't like `{}`: {}", filename.display(), e); ArchiveRO::open(filename).map(|ar| OwningRef::new(Box::new(ar))).map_err(|e| {
format!("failed to read rlib metadata in '{}': {}", filename.display(), e) debug!("llvm didn't like `{}`: {}", filename.display(), e);
})?; format!("failed to read rlib metadata in '{}': {}", filename.display(), e)
})?;
let buf: OwningRef<_, [u8]> = archive.try_map(|ar| { let buf: OwningRef<_, [u8]> = archive.try_map(|ar| {
ar.iter() ar.iter()
.filter_map(|s| s.ok()) .filter_map(|s| s.ok())
@ -44,9 +45,10 @@ impl MetadataLoader for LlvmMetadataLoader {
let buf = path_to_c_string(filename); let buf = path_to_c_string(filename);
let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf.as_ptr()) let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf.as_ptr())
.ok_or_else(|| format!("error reading library: '{}'", filename.display()))?; .ok_or_else(|| format!("error reading library: '{}'", filename.display()))?;
let of = ObjectFile::new(mb).map(|of| OwningRef::new(box of)).ok_or_else(|| { let of =
format!("provided path not an object file: '{}'", filename.display()) ObjectFile::new(mb).map(|of| OwningRef::new(Box::new(of))).ok_or_else(|| {
})?; format!("provided path not an object file: '{}'", filename.display())
})?;
let buf = of.try_map(|of| search_meta_section(of, target, filename))?; let buf = of.try_map(|of| search_meta_section(of, target, filename))?;
Ok(rustc_erase_owner!(buf)) Ok(rustc_erase_owner!(buf))
} }

View file

@ -1,10 +1,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(libc)]
#![feature(stmt_expr_attributes)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(nll)] #![feature(nll)]

View file

@ -3,10 +3,6 @@
//! This API is completely unstable and subject to change. //! This API is completely unstable and subject to change.
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(arbitrary_self_types)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(never_type)] #![feature(never_type)]
#![feature(nll)] #![feature(nll)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]

View file

@ -12,7 +12,6 @@
#![feature(generators)] #![feature(generators)]
#![feature(generator_trait)] #![feature(generator_trait)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(unsize)]
#![feature(specialization)] #![feature(specialization)]
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(nll)] #![feature(nll)]
@ -20,11 +19,9 @@
#![feature(hash_raw_entry)] #![feature(hash_raw_entry)]
#![feature(stmt_expr_attributes)] #![feature(stmt_expr_attributes)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(integer_atomics)]
#![feature(test)] #![feature(test)]
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]
#![feature(thread_id_value)] #![feature(thread_id_value)]
#![cfg_attr(unix, feature(libc))]
#![allow(rustc::default_hash_types)] #![allow(rustc::default_hash_types)]
#[macro_use] #[macro_use]

View file

@ -5,12 +5,7 @@
//! This API is completely unstable and subject to change. //! This API is completely unstable and subject to change.
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(box_syntax)]
#![cfg_attr(unix, feature(libc))]
#![feature(nll)] #![feature(nll)]
#![feature(set_stdio)]
#![feature(no_debug)]
#![feature(integer_atomics)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
pub extern crate getopts; pub extern crate getopts;

View file

@ -4,9 +4,7 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![cfg_attr(unix, feature(libc))]
#![feature(nll)] #![feature(nll)]
#![feature(optin_builtin_traits)]
pub use emitter::ColorConfig; pub use emitter::ColorConfig;

View file

@ -3,7 +3,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(nll)] #![feature(nll)]
#![feature(specialization)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#[macro_use] #[macro_use]

View file

@ -2,10 +2,8 @@
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(set_stdio)] #![feature(set_stdio)]
#![feature(nll)] #![feature(nll)]
#![feature(arbitrary_self_types)]
#![feature(generator_trait)] #![feature(generator_trait)]
#![feature(generators)] #![feature(generators)]
#![cfg_attr(unix, feature(libc))]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#[cfg(unix)] #[cfg(unix)]

View file

@ -28,7 +28,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(test, feature(test))] #![cfg_attr(test, feature(test))]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -1,15 +1,11 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(libc)]
#![feature(nll)] #![feature(nll)]
#![feature(proc_macro_internals)] #![feature(proc_macro_internals)]
#![feature(proc_macro_quote)]
#![feature(rustc_private)]
#![feature(specialization)] #![feature(specialization)]
#![feature(stmt_expr_attributes)] #![feature(stmt_expr_attributes)]
#![recursion_limit = "256"] #![recursion_limit = "256"]

View file

@ -6,21 +6,15 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(nll)] #![feature(nll)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(inner_deref)]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(core_intrinsics)]
#![feature(decl_macro)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
#![feature(iter_order_by)] #![feature(iter_order_by)]
#![feature(never_type)] #![feature(never_type)]
#![feature(specialization)] #![feature(specialization)]
#![feature(try_trait)]
#![feature(unicode_internals)]
#![feature(slice_concat_ext)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(try_blocks)] #![feature(try_blocks)]
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]

View file

@ -9,7 +9,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(label_break_value)]
#![feature(nll)] #![feature(nll)]
#![recursion_limit = "256"] #![recursion_limit = "256"]

View file

@ -8,9 +8,7 @@
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(nll)] #![feature(nll)]
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(rustc_attrs)]
#![feature(specialization)] #![feature(specialization)]
#![feature(step_trait)]
use rustc_data_structures::AtomicRef; use rustc_data_structures::AtomicRef;
use rustc_macros::HashStable_Generic; use rustc_macros::HashStable_Generic;

View file

@ -8,7 +8,6 @@
//! LLVM. //! LLVM.
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(box_syntax)]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(nll)] #![feature(nll)]

View file

@ -58,10 +58,8 @@ This API is completely unstable and subject to change.
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
#![feature(bool_to_option)] #![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(exhaustive_patterns)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(nll)] #![feature(nll)]
#![feature(try_blocks)] #![feature(try_blocks)]

View file

@ -3,19 +3,15 @@
html_playground_url = "https://play.rust-lang.org/" html_playground_url = "https://play.rust-lang.org/"
)] )]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(arbitrary_self_types)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(nll)] #![feature(nll)]
#![feature(set_stdio)]
#![feature(test)] #![feature(test)]
#![feature(vec_remove_item)] #![feature(vec_remove_item)]
#![feature(ptr_offset_from)] #![feature(ptr_offset_from)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(drain_filter)]
#![feature(never_type)] #![feature(never_type)]
#![feature(unicode_internals)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
extern crate env_logger; extern crate env_logger;

View file

@ -10,7 +10,6 @@ Core encoding and decoding interfaces.
test(attr(allow(unused_variables), deny(warnings))) test(attr(allow(unused_variables), deny(warnings)))
)] )]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(specialization)] #![feature(specialization)]
#![feature(never_type)] #![feature(never_type)]
#![feature(nll)] #![feature(nll)]

View file

@ -10,7 +10,7 @@ error: internal compiler error: mutable allocation in constant
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _; LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:357:17 thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:355:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic error: internal compiler error: unexpected panic