1
Fork 0

Adjust cfgs

This commit is contained in:
Mark Rousskov 2022-08-09 09:56:13 -04:00
parent 7b42606758
commit 154a09dd91
49 changed files with 80 additions and 398 deletions

View file

@ -14,7 +14,6 @@
#![feature(const_trait_impl)] #![feature(const_trait_impl)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(slice_internals)] #![feature(slice_internals)]

View file

@ -31,7 +31,6 @@
//! in the HIR, especially for multiple identifiers. //! in the HIR, especially for multiple identifiers.
#![feature(box_patterns)] #![feature(box_patterns)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(never_type)] #![feature(never_type)]
#![recursion_limit = "256"] #![recursion_limit = "256"]

View file

@ -8,7 +8,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_is_partitioned)] #![feature(iter_is_partitioned)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![recursion_limit = "256"] #![recursion_limit = "256"]

View file

@ -4,7 +4,6 @@
//! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax` //! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax`
//! to this crate. //! to this crate.
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#[macro_use] #[macro_use]

View file

@ -2,7 +2,6 @@
#![allow(rustc::potential_query_instability)] #![allow(rustc::potential_query_instability)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -8,7 +8,6 @@
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(is_sorted)] #![feature(is_sorted)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(proc_macro_internals)] #![feature(proc_macro_internals)]
#![feature(proc_macro_quote)] #![feature(proc_macro_quote)]

View file

@ -6,7 +6,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(hash_raw_entry)] #![feature(hash_raw_entry)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(extern_types)] #![feature(extern_types)]
#![feature(once_cell)] #![feature(once_cell)]

View file

@ -9,7 +9,6 @@ Rust MIR: a lowered representation of Rust.
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -1,4 +1,3 @@
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(once_cell)] #![feature(once_cell)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View file

@ -5,7 +5,6 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(adt_const_params)] #![feature(adt_const_params)]
#![feature(let_else)] #![feature(let_else)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -2,7 +2,6 @@
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(macro_metavar_expr)] #![feature(macro_metavar_expr)]
#![feature(proc_macro_diagnostic)] #![feature(proc_macro_diagnostic)]

View file

@ -18,7 +18,6 @@
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(extend_one)] #![feature(extend_one)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -330,7 +330,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
} }
// JUSTIFICATION: before session exists, only config // JUSTIFICATION: before session exists, only config
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R { pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R {
tracing::trace!("run_compiler"); tracing::trace!("run_compiler");
util::run_in_thread_pool_with_globals( util::run_in_thread_pool_with_globals(

View file

@ -1,4 +1,4 @@
#![cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #![allow(rustc::bad_opt_access)]
use crate::interface::parse_cfgspecs; use crate::interface::parse_cfgspecs;
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;

View file

@ -559,7 +559,7 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<C
// command line, then reuse the empty `base` Vec to hold the types that // command line, then reuse the empty `base` Vec to hold the types that
// will be found in crate attributes. // will be found in crate attributes.
// JUSTIFICATION: before wrapper fn is available // JUSTIFICATION: before wrapper fn is available
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
let mut base = session.opts.crate_types.clone(); let mut base = session.opts.crate_types.clone();
if base.is_empty() { if base.is_empty() {
base.extend(attr_types); base.extend(attr_types);

View file

@ -33,7 +33,6 @@
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![feature(iter_order_by)] #![feature(iter_order_by)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(never_type)] #![feature(never_type)]
#![recursion_limit = "256"] #![recursion_limit = "256"]

View file

@ -4,7 +4,6 @@
#![feature(generators)] #![feature(generators)]
#![feature(generic_associated_types)] #![feature(generic_associated_types)]
#![feature(iter_from_generator)] #![feature(iter_from_generator)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(once_cell)] #![feature(once_cell)]
#![feature(proc_macro_internals)] #![feature(proc_macro_internals)]

View file

@ -39,7 +39,6 @@
#![feature(extern_types)] #![feature(extern_types)]
#![feature(new_uninit)] #![feature(new_uninit)]
#![feature(once_cell)] #![feature(once_cell)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(trusted_len)] #![feature(trusted_len)]

View file

@ -5,7 +5,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(once_cell)] #![feature(once_cell)]

View file

@ -1,6 +1,5 @@
#![allow(rustc::potential_query_instability)] #![allow(rustc::potential_query_instability)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -3,7 +3,6 @@
#![feature(array_windows)] #![feature(array_windows)]
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(never_type)] #![feature(never_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]

View file

@ -7,7 +7,6 @@
#![allow(rustc::potential_query_instability)] #![allow(rustc::potential_query_instability)]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -5,8 +5,8 @@
#![feature(try_blocks)] #![feature(try_blocks)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
#![allow(rustc::potential_query_instability)] #![allow(rustc::potential_query_instability)]
#![cfg_attr(not(bootstrap), deny(rustc::untranslatable_diagnostic))] #![deny(rustc::untranslatable_diagnostic)]
#![cfg_attr(not(bootstrap), deny(rustc::diagnostic_outside_of_impl))] #![deny(rustc::diagnostic_outside_of_impl)]
mod errors; mod errors;

View file

@ -10,7 +10,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![feature(let_else)] #![feature(let_else)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -949,7 +949,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
ret.insert((sym::debug_assertions, None)); ret.insert((sym::debug_assertions, None));
} }
// JUSTIFICATION: before wrapper fn is available // JUSTIFICATION: before wrapper fn is available
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
if sess.opts.crate_types.contains(&CrateType::ProcMacro) { if sess.opts.crate_types.contains(&CrateType::ProcMacro) {
ret.insert((sym::proc_macro, None)); ret.insert((sym::proc_macro, None));
} }
@ -2198,7 +2198,7 @@ fn parse_remap_path_prefix(
} }
// JUSTIFICATION: before wrapper fn is available // JUSTIFICATION: before wrapper fn is available
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
pub fn build_session_options(matches: &getopts::Matches) -> Options { pub fn build_session_options(matches: &getopts::Matches) -> Options {
let color = parse_color(matches); let color = parse_color(matches);

View file

@ -1,5 +1,4 @@
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -127,11 +127,11 @@ top_level_options!(
/// `CodegenOptions`, think about how it influences incremental compilation. If in /// `CodegenOptions`, think about how it influences incremental compilation. If in
/// doubt, specify `[TRACKED]`, which is always "correct" but might lead to /// doubt, specify `[TRACKED]`, which is always "correct" but might lead to
/// unnecessary re-compilation. /// unnecessary re-compilation.
#[cfg_attr(not(bootstrap), rustc_lint_opt_ty)] #[rustc_lint_opt_ty]
pub struct Options { pub struct Options {
/// The crate config requested for the session, which may be combined /// The crate config requested for the session, which may be combined
/// with additional crate configurations during the compile process. /// with additional crate configurations during the compile process.
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::crate_types` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::crate_types` instead of this field")]
crate_types: Vec<CrateType> [TRACKED], crate_types: Vec<CrateType> [TRACKED],
optimize: OptLevel [TRACKED], optimize: OptLevel [TRACKED],
/// Include the `debug_assertions` flag in dependency tracking, since it /// Include the `debug_assertions` flag in dependency tracking, since it
@ -178,9 +178,9 @@ top_level_options!(
/// what rustc was invoked with, but massaged a bit to agree with /// what rustc was invoked with, but massaged a bit to agree with
/// commands like `--emit llvm-ir` which they're often incompatible with /// commands like `--emit llvm-ir` which they're often incompatible with
/// if we otherwise use the defaults of rustc. /// if we otherwise use the defaults of rustc.
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::codegen_units` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::codegen_units` instead of this field")]
cli_forced_codegen_units: Option<usize> [UNTRACKED], cli_forced_codegen_units: Option<usize> [UNTRACKED],
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
cli_forced_thinlto_off: bool [UNTRACKED], cli_forced_thinlto_off: bool [UNTRACKED],
/// Remap source path prefixes in all output (messages, object files, debug, etc.). /// Remap source path prefixes in all output (messages, object files, debug, etc.).
@ -231,7 +231,7 @@ macro_rules! options {
),* ,) => ),* ,) =>
( (
#[derive(Clone)] #[derive(Clone)]
#[cfg_attr(not(bootstrap), rustc_lint_opt_ty)] #[rustc_lint_opt_ty]
pub struct $struct_name { $( $( #[$attr] )* pub $opt: $t),* } pub struct $struct_name { $( $( #[$attr] )* pub $opt: $t),* }
impl Default for $struct_name { impl Default for $struct_name {
@ -282,7 +282,7 @@ macro_rules! options {
impl Options { impl Options {
// JUSTIFICATION: defn of the suggested wrapper fn // JUSTIFICATION: defn of the suggested wrapper fn
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
pub fn time_passes(&self) -> bool { pub fn time_passes(&self) -> bool {
self.unstable_opts.time_passes || self.unstable_opts.time self.unstable_opts.time_passes || self.unstable_opts.time
} }
@ -290,7 +290,7 @@ impl Options {
impl CodegenOptions { impl CodegenOptions {
// JUSTIFICATION: defn of the suggested wrapper fn // JUSTIFICATION: defn of the suggested wrapper fn
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
pub fn instrument_coverage(&self) -> InstrumentCoverage { pub fn instrument_coverage(&self) -> InstrumentCoverage {
self.instrument_coverage.unwrap_or(InstrumentCoverage::Off) self.instrument_coverage.unwrap_or(InstrumentCoverage::Off)
} }
@ -1091,7 +1091,7 @@ options! {
ar: String = (String::new(), parse_string, [UNTRACKED], ar: String = (String::new(), parse_string, [UNTRACKED],
"this option is deprecated and does nothing"), "this option is deprecated and does nothing"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::code_model` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::code_model` instead of this field")]
code_model: Option<CodeModel> = (None, parse_code_model, [TRACKED], code_model: Option<CodeModel> = (None, parse_code_model, [TRACKED],
"choose the code model to use (`rustc --print code-models` for details)"), "choose the code model to use (`rustc --print code-models` for details)"),
codegen_units: Option<usize> = (None, parse_opt_number, [UNTRACKED], codegen_units: Option<usize> = (None, parse_opt_number, [UNTRACKED],
@ -1111,14 +1111,14 @@ options! {
"extra data to put in each output filename"), "extra data to put in each output filename"),
force_frame_pointers: Option<bool> = (None, parse_opt_bool, [TRACKED], force_frame_pointers: Option<bool> = (None, parse_opt_bool, [TRACKED],
"force use of the frame pointers"), "force use of the frame pointers"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::must_emit_unwind_tables` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::must_emit_unwind_tables` instead of this field")]
force_unwind_tables: Option<bool> = (None, parse_opt_bool, [TRACKED], force_unwind_tables: Option<bool> = (None, parse_opt_bool, [TRACKED],
"force use of unwind tables"), "force use of unwind tables"),
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED], incremental: Option<String> = (None, parse_opt_string, [UNTRACKED],
"enable incremental compilation"), "enable incremental compilation"),
inline_threshold: Option<u32> = (None, parse_opt_number, [TRACKED], inline_threshold: Option<u32> = (None, parse_opt_number, [TRACKED],
"set the threshold for inlining a function"), "set the threshold for inlining a function"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")]
instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED], instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED],
"instrument the generated code to support LLVM source-based code coverage \ "instrument the generated code to support LLVM source-based code coverage \
reports (note, the compiler build config must include `profiler = true`); \ reports (note, the compiler build config must include `profiler = true`); \
@ -1131,7 +1131,7 @@ options! {
"a single extra argument to append to the linker invocation (can be used several times)"), "a single extra argument to append to the linker invocation (can be used several times)"),
link_args: Vec<String> = (Vec::new(), parse_list, [UNTRACKED], link_args: Vec<String> = (Vec::new(), parse_list, [UNTRACKED],
"extra arguments to append to the linker invocation (space separated)"), "extra arguments to append to the linker invocation (space separated)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::link_dead_code` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::link_dead_code` instead of this field")]
link_dead_code: Option<bool> = (None, parse_opt_bool, [TRACKED], link_dead_code: Option<bool> = (None, parse_opt_bool, [TRACKED],
"keep dead code at link time (useful for code coverage) (default: no)"), "keep dead code at link time (useful for code coverage) (default: no)"),
link_self_contained: Option<bool> = (None, parse_opt_bool, [UNTRACKED], link_self_contained: Option<bool> = (None, parse_opt_bool, [UNTRACKED],
@ -1146,7 +1146,7 @@ options! {
"generate build artifacts that are compatible with linker-based LTO"), "generate build artifacts that are compatible with linker-based LTO"),
llvm_args: Vec<String> = (Vec::new(), parse_list, [TRACKED], llvm_args: Vec<String> = (Vec::new(), parse_list, [TRACKED],
"a list of arguments to pass to LLVM (space separated)"), "a list of arguments to pass to LLVM (space separated)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
lto: LtoCli = (LtoCli::Unspecified, parse_lto, [TRACKED], lto: LtoCli = (LtoCli::Unspecified, parse_lto, [TRACKED],
"perform LLVM link-time optimizations"), "perform LLVM link-time optimizations"),
metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED], metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
@ -1163,10 +1163,10 @@ options! {
"disable LLVM's SLP vectorization pass"), "disable LLVM's SLP vectorization pass"),
opt_level: String = ("0".to_string(), parse_string, [TRACKED], opt_level: String = ("0".to_string(), parse_string, [TRACKED],
"optimization level (0-3, s, or z; default: 0)"), "optimization level (0-3, s, or z; default: 0)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::overflow_checks` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::overflow_checks` instead of this field")]
overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED], overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
"use overflow checks for integer arithmetic"), "use overflow checks for integer arithmetic"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::panic_strategy` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::panic_strategy` instead of this field")]
panic: Option<PanicStrategy> = (None, parse_opt_panic_strategy, [TRACKED], panic: Option<PanicStrategy> = (None, parse_opt_panic_strategy, [TRACKED],
"panic strategy to compile crate with"), "panic strategy to compile crate with"),
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED], passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
@ -1178,7 +1178,7 @@ options! {
"compile the program with profiling instrumentation"), "compile the program with profiling instrumentation"),
profile_use: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED], profile_use: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
"use the given `.profdata` file for profile-guided optimization"), "use the given `.profdata` file for profile-guided optimization"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::relocation_model` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::relocation_model` instead of this field")]
relocation_model: Option<RelocModel> = (None, parse_relocation_model, [TRACKED], relocation_model: Option<RelocModel> = (None, parse_relocation_model, [TRACKED],
"control generation of position-independent code (PIC) \ "control generation of position-independent code (PIC) \
(`rustc --print relocation-models` for details)"), (`rustc --print relocation-models` for details)"),
@ -1190,7 +1190,7 @@ options! {
"save all temporary output files during compilation (default: no)"), "save all temporary output files during compilation (default: no)"),
soft_float: bool = (false, parse_bool, [TRACKED], soft_float: bool = (false, parse_bool, [TRACKED],
"use soft float ABI (*eabihf targets only) (default: no)"), "use soft float ABI (*eabihf targets only) (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::split_debuginfo` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::split_debuginfo` instead of this field")]
split_debuginfo: Option<SplitDebuginfo> = (None, parse_split_debuginfo, [TRACKED], split_debuginfo: Option<SplitDebuginfo> = (None, parse_split_debuginfo, [TRACKED],
"how to handle split-debuginfo, a platform-specific option"), "how to handle split-debuginfo, a platform-specific option"),
strip: Strip = (Strip::None, parse_strip, [UNTRACKED], strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
@ -1226,13 +1226,13 @@ options! {
"encode MIR of all functions into the crate metadata (default: no)"), "encode MIR of all functions into the crate metadata (default: no)"),
assume_incomplete_release: bool = (false, parse_bool, [TRACKED], assume_incomplete_release: bool = (false, parse_bool, [TRACKED],
"make cfg(version) treat the current version as incomplete (default: no)"), "make cfg(version) treat the current version as incomplete (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::asm_comments` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::asm_comments` instead of this field")]
asm_comments: bool = (false, parse_bool, [TRACKED], asm_comments: bool = (false, parse_bool, [TRACKED],
"generate comments into the assembly (may change behavior) (default: no)"), "generate comments into the assembly (may change behavior) (default: no)"),
assert_incr_state: Option<String> = (None, parse_opt_string, [UNTRACKED], assert_incr_state: Option<String> = (None, parse_opt_string, [UNTRACKED],
"assert that the incremental cache is in given state: \ "assert that the incremental cache is in given state: \
either `loaded` or `not-loaded`."), either `loaded` or `not-loaded`."),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::binary_dep_depinfo` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::binary_dep_depinfo` instead of this field")]
binary_dep_depinfo: bool = (false, parse_bool, [TRACKED], binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
"include artifacts (sysroot, crate dependencies) used during compilation in dep-info \ "include artifacts (sysroot, crate dependencies) used during compilation in dep-info \
(default: no)"), (default: no)"),
@ -1312,7 +1312,7 @@ options! {
"export symbols from executables, as if they were dynamic libraries"), "export symbols from executables, as if they were dynamic libraries"),
extra_const_ub_checks: bool = (false, parse_bool, [TRACKED], extra_const_ub_checks: bool = (false, parse_bool, [TRACKED],
"turns on more checks to detect const UB, which can be slow (default: no)"), "turns on more checks to detect const UB, which can be slow (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field")]
fewer_names: Option<bool> = (None, parse_opt_bool, [TRACKED], fewer_names: Option<bool> = (None, parse_opt_bool, [TRACKED],
"reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) \ "reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) \
(default: no)"), (default: no)"),
@ -1355,7 +1355,7 @@ options! {
"control whether `#[inline]` functions are in all CGUs"), "control whether `#[inline]` functions are in all CGUs"),
input_stats: bool = (false, parse_bool, [UNTRACKED], input_stats: bool = (false, parse_bool, [UNTRACKED],
"gather statistics about the input (default: no)"), "gather statistics about the input (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")]
instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED], instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED],
"instrument the generated code to support LLVM source-based code coverage \ "instrument the generated code to support LLVM source-based code coverage \
reports (note, the compiler build config must include `profiler = true`); \ reports (note, the compiler build config must include `profiler = true`); \
@ -1364,7 +1364,7 @@ options! {
`=except-unused-generics` `=except-unused-generics`
`=except-unused-functions` `=except-unused-functions`
`=off` (default)"), `=off` (default)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::instrument_mcount` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::instrument_mcount` instead of this field")]
instrument_mcount: bool = (false, parse_bool, [TRACKED], instrument_mcount: bool = (false, parse_bool, [TRACKED],
"insert function instrument code for mcount-based tracing (default: no)"), "insert function instrument code for mcount-based tracing (default: no)"),
keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED], keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],
@ -1388,7 +1388,7 @@ options! {
merge_functions: Option<MergeFunctions> = (None, parse_merge_functions, [TRACKED], merge_functions: Option<MergeFunctions> = (None, parse_merge_functions, [TRACKED],
"control the operation of the MergeFunctions LLVM pass, taking \ "control the operation of the MergeFunctions LLVM pass, taking \
the same values as the target option of the same name"), the same values as the target option of the same name"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::meta_stats` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::meta_stats` instead of this field")]
meta_stats: bool = (false, parse_bool, [UNTRACKED], meta_stats: bool = (false, parse_bool, [UNTRACKED],
"gather metadata statistics (default: no)"), "gather metadata statistics (default: no)"),
mir_emit_retag: bool = (false, parse_bool, [TRACKED], mir_emit_retag: bool = (false, parse_bool, [TRACKED],
@ -1400,7 +1400,7 @@ options! {
disabled by other flags as usual."), disabled by other flags as usual."),
mir_pretty_relative_line_numbers: bool = (false, parse_bool, [UNTRACKED], mir_pretty_relative_line_numbers: bool = (false, parse_bool, [UNTRACKED],
"use line numbers relative to the function in mir pretty printing"), "use line numbers relative to the function in mir pretty printing"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::mir_opt_level` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::mir_opt_level` instead of this field")]
mir_opt_level: Option<usize> = (None, parse_opt_number, [TRACKED], mir_opt_level: Option<usize> = (None, parse_opt_number, [TRACKED],
"MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"), "MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"),
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED], move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
@ -1467,7 +1467,7 @@ options! {
See #77382 and #74551."), See #77382 and #74551."),
print_fuel: Option<String> = (None, parse_opt_string, [TRACKED], print_fuel: Option<String> = (None, parse_opt_string, [TRACKED],
"make rustc print the total optimization fuel used by a crate"), "make rustc print the total optimization fuel used by a crate"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::print_llvm_passes` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::print_llvm_passes` instead of this field")]
print_llvm_passes: bool = (false, parse_bool, [UNTRACKED], print_llvm_passes: bool = (false, parse_bool, [UNTRACKED],
"print the LLVM optimization passes being run (default: no)"), "print the LLVM optimization passes being run (default: no)"),
print_mono_items: Option<String> = (None, parse_opt_string, [UNTRACKED], print_mono_items: Option<String> = (None, parse_opt_string, [UNTRACKED],
@ -1545,7 +1545,7 @@ options! {
"exclude spans when debug-printing compiler state (default: no)"), "exclude spans when debug-printing compiler state (default: no)"),
src_hash_algorithm: Option<SourceFileHashAlgorithm> = (None, parse_src_file_hash, [TRACKED], src_hash_algorithm: Option<SourceFileHashAlgorithm> = (None, parse_src_file_hash, [TRACKED],
"hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)"), "hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::stack_protector` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::stack_protector` instead of this field")]
stack_protector: StackProtector = (StackProtector::None, parse_stack_protector, [TRACKED], stack_protector: StackProtector = (StackProtector::None, parse_stack_protector, [TRACKED],
"control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)"), "control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)"),
strict_init_checks: bool = (false, parse_bool, [TRACKED], strict_init_checks: bool = (false, parse_bool, [TRACKED],
@ -1566,7 +1566,7 @@ options! {
symbol_mangling_version: Option<SymbolManglingVersion> = (None, symbol_mangling_version: Option<SymbolManglingVersion> = (None,
parse_symbol_mangling_version, [TRACKED], parse_symbol_mangling_version, [TRACKED],
"which mangling version to use for symbol names ('legacy' (default) or 'v0')"), "which mangling version to use for symbol names ('legacy' (default) or 'v0')"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::teach` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::teach` instead of this field")]
teach: bool = (false, parse_bool, [TRACKED], teach: bool = (false, parse_bool, [TRACKED],
"show extended diagnostic help (default: no)"), "show extended diagnostic help (default: no)"),
temps_dir: Option<String> = (None, parse_opt_string, [UNTRACKED], temps_dir: Option<String> = (None, parse_opt_string, [UNTRACKED],
@ -1582,7 +1582,7 @@ options! {
"emit directionality isolation markers in translated diagnostics"), "emit directionality isolation markers in translated diagnostics"),
tune_cpu: Option<String> = (None, parse_opt_string, [TRACKED], tune_cpu: Option<String> = (None, parse_opt_string, [TRACKED],
"select processor to schedule for (`rustc --print target-cpus` for details)"), "select processor to schedule for (`rustc --print target-cpus` for details)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::lto` instead of this field")]
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED], thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
"enable ThinLTO when possible"), "enable ThinLTO when possible"),
thir_unsafeck: bool = (false, parse_bool, [TRACKED], thir_unsafeck: bool = (false, parse_bool, [TRACKED],
@ -1591,19 +1591,19 @@ options! {
/// a sequential compiler for now. This'll likely be adjusted /// a sequential compiler for now. This'll likely be adjusted
/// in the future. Note that -Zthreads=0 is the way to get /// in the future. Note that -Zthreads=0 is the way to get
/// the num_cpus behavior. /// the num_cpus behavior.
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::threads` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::threads` instead of this field")]
threads: usize = (1, parse_threads, [UNTRACKED], threads: usize = (1, parse_threads, [UNTRACKED],
"use a thread pool with N threads"), "use a thread pool with N threads"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::time_passes` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::time_passes` instead of this field")]
time: bool = (false, parse_bool, [UNTRACKED], time: bool = (false, parse_bool, [UNTRACKED],
"measure time of rustc processes (default: no)"), "measure time of rustc processes (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::time_llvm_passes` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::time_llvm_passes` instead of this field")]
time_llvm_passes: bool = (false, parse_bool, [UNTRACKED], time_llvm_passes: bool = (false, parse_bool, [UNTRACKED],
"measure time of each LLVM pass (default: no)"), "measure time of each LLVM pass (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::time_passes` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::time_passes` instead of this field")]
time_passes: bool = (false, parse_bool, [UNTRACKED], time_passes: bool = (false, parse_bool, [UNTRACKED],
"measure time of each rustc pass (default: no)"), "measure time of each rustc pass (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::tls_model` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::tls_model` instead of this field")]
tls_model: Option<TlsModel> = (None, parse_tls_model, [TRACKED], tls_model: Option<TlsModel> = (None, parse_tls_model, [TRACKED],
"choose the TLS model to use (`rustc --print tls-models` for details)"), "choose the TLS model to use (`rustc --print tls-models` for details)"),
trace_macros: bool = (false, parse_bool, [UNTRACKED], trace_macros: bool = (false, parse_bool, [UNTRACKED],
@ -1638,17 +1638,17 @@ options! {
"enable unsound and buggy MIR optimizations (default: no)"), "enable unsound and buggy MIR optimizations (default: no)"),
/// This name is kind of confusing: Most unstable options enable something themselves, while /// This name is kind of confusing: Most unstable options enable something themselves, while
/// this just allows "normal" options to be feature-gated. /// this just allows "normal" options to be feature-gated.
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::unstable_options` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::unstable_options` instead of this field")]
unstable_options: bool = (false, parse_bool, [UNTRACKED], unstable_options: bool = (false, parse_bool, [UNTRACKED],
"adds unstable command line options to rustc interface (default: no)"), "adds unstable command line options to rustc interface (default: no)"),
use_ctors_section: Option<bool> = (None, parse_opt_bool, [TRACKED], use_ctors_section: Option<bool> = (None, parse_opt_bool, [TRACKED],
"use legacy .ctors section for initializers rather than .init_array"), "use legacy .ctors section for initializers rather than .init_array"),
validate_mir: bool = (false, parse_bool, [UNTRACKED], validate_mir: bool = (false, parse_bool, [UNTRACKED],
"validate MIR after each transformation"), "validate MIR after each transformation"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::verbose` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::verbose` instead of this field")]
verbose: bool = (false, parse_bool, [UNTRACKED], verbose: bool = (false, parse_bool, [UNTRACKED],
"in general, enable more debug printouts (default: no)"), "in general, enable more debug printouts (default: no)"),
#[cfg_attr(not(bootstrap), rustc_lint_opt_deny_field_access("use `Session::verify_llvm_ir` instead of this field"))] #[rustc_lint_opt_deny_field_access("use `Session::verify_llvm_ir` instead of this field")]
verify_llvm_ir: bool = (false, parse_bool, [TRACKED], verify_llvm_ir: bool = (false, parse_bool, [TRACKED],
"verify LLVM IR (default: no)"), "verify LLVM IR (default: no)"),
virtual_function_elimination: bool = (false, parse_bool, [TRACKED], virtual_function_elimination: bool = (false, parse_bool, [TRACKED],

View file

@ -638,7 +638,7 @@ impl Session {
let found_positive = requested_features.clone().any(|r| r == "+crt-static"); let found_positive = requested_features.clone().any(|r| r == "+crt-static");
// JUSTIFICATION: necessary use of crate_types directly (see FIXME below) // JUSTIFICATION: necessary use of crate_types directly (see FIXME below)
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
if found_positive || found_negative { if found_positive || found_negative {
found_positive found_positive
} else if crate_type == Some(CrateType::ProcMacro) } else if crate_type == Some(CrateType::ProcMacro)
@ -894,7 +894,7 @@ impl Session {
} }
// JUSTIFICATION: defn of the suggested wrapper fns // JUSTIFICATION: defn of the suggested wrapper fns
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
impl Session { impl Session {
pub fn verbose(&self) -> bool { pub fn verbose(&self) -> bool {
self.opts.unstable_opts.verbose self.opts.unstable_opts.verbose
@ -1174,7 +1174,7 @@ impl Session {
} }
// JUSTIFICATION: part of session construction // JUSTIFICATION: part of session construction
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
fn default_emitter( fn default_emitter(
sopts: &config::Options, sopts: &config::Options,
registry: rustc_errors::registry::Registry, registry: rustc_errors::registry::Registry,
@ -1260,7 +1260,7 @@ pub enum DiagnosticOutput {
} }
// JUSTIFICATION: literally session construction // JUSTIFICATION: literally session construction
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
pub fn build_session( pub fn build_session(
sopts: config::Options, sopts: config::Options,
local_crate_source_file: Option<PathBuf>, local_crate_source_file: Option<PathBuf>,
@ -1437,7 +1437,7 @@ pub fn build_session(
/// If it is useful to have a Session available already for validating a commandline argument, you /// If it is useful to have a Session available already for validating a commandline argument, you
/// can do so here. /// can do so here.
// JUSTIFICATION: needs to access args to validate them // JUSTIFICATION: needs to access args to validate them
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
fn validate_commandline_args_with_session_available(sess: &Session) { fn validate_commandline_args_with_session_available(sess: &Session) {
// Since we don't know if code in an rlib will be linked to statically or // Since we don't know if code in an rlib will be linked to statically or
// dynamically downstream, rustc generates `__imp_` symbols that help linkers // dynamically downstream, rustc generates `__imp_` symbols that help linkers

View file

@ -17,7 +17,6 @@
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(hash_drain_filter)] #![feature(hash_drain_filter)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(if_let_guard)] #![feature(if_let_guard)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -65,7 +65,6 @@ This API is completely unstable and subject to change.
#![feature(is_sorted)] #![feature(is_sorted)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -30,13 +30,13 @@ extern "Rust" {
#[rustc_allocator] #[rustc_allocator]
#[rustc_allocator_nounwind] #[rustc_allocator_nounwind]
fn __rust_alloc(size: usize, align: usize) -> *mut u8; fn __rust_alloc(size: usize, align: usize) -> *mut u8;
#[cfg_attr(not(bootstrap), rustc_deallocator)] #[rustc_deallocator]
#[rustc_allocator_nounwind] #[rustc_allocator_nounwind]
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize); fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
#[cfg_attr(not(bootstrap), rustc_reallocator)] #[rustc_reallocator]
#[rustc_allocator_nounwind] #[rustc_allocator_nounwind]
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
#[cfg_attr(not(bootstrap), rustc_allocator_zeroed)] #[rustc_allocator_zeroed]
#[rustc_allocator_nounwind] #[rustc_allocator_nounwind]
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8; fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
} }

View file

@ -2566,7 +2566,7 @@ macro_rules! tuple {
macro_rules! maybe_tuple_doc { macro_rules! maybe_tuple_doc {
($a:ident @ #[$meta:meta] $item:item) => { ($a:ident @ #[$meta:meta] $item:item) => {
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
#[doc = "This trait is implemented for tuples up to twelve items long."] #[doc = "This trait is implemented for tuples up to twelve items long."]
#[$meta] #[$meta]
$item $item

View file

@ -900,7 +900,7 @@ mod impls {
macro_rules! maybe_tuple_doc { macro_rules! maybe_tuple_doc {
($a:ident @ #[$meta:meta] $item:item) => { ($a:ident @ #[$meta:meta] $item:item) => {
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
#[doc = "This trait is implemented for tuples up to twelve items long."] #[doc = "This trait is implemented for tuples up to twelve items long."]
#[$meta] #[$meta]
$item $item

View file

@ -63,7 +63,7 @@ use crate::mem;
use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering}; use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering};
#[stable(feature = "drop_in_place", since = "1.8.0")] #[stable(feature = "drop_in_place", since = "1.8.0")]
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")] #[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")]
#[inline] #[inline]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
@ -71,214 +71,6 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
unsafe { crate::ptr::drop_in_place(to_drop) } unsafe { crate::ptr::drop_in_place(to_drop) }
} }
// These have been renamed.
#[cfg(bootstrap)]
extern "rust-intrinsic" {
pub fn atomic_cxchg<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_acq<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_rel<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_acqrel<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_failacq<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_acq_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchg_acqrel_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_acq<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_rel<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_acqrel<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_failacq<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_acq_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_cxchgweak_acqrel_failrelaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
pub fn atomic_load<T: Copy>(src: *const T) -> T;
pub fn atomic_load_acq<T: Copy>(src: *const T) -> T;
pub fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
pub fn atomic_load_unordered<T: Copy>(src: *const T) -> T;
pub fn atomic_store<T: Copy>(dst: *mut T, val: T);
pub fn atomic_store_rel<T: Copy>(dst: *mut T, val: T);
pub fn atomic_store_relaxed<T: Copy>(dst: *mut T, val: T);
pub fn atomic_store_unordered<T: Copy>(dst: *mut T, val: T);
pub fn atomic_xchg<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xchg_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xchg_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xchg_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xchg_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xadd<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xadd_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xadd_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xadd_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xadd_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xsub<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xsub_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xsub_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xsub_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xsub_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_and<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_and_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_and_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_and_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_and_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_nand<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_nand_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_nand_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_nand_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_nand_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_or<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_or_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_or_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_or_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_or_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xor<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xor_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xor_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xor_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_xor_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_max<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_max_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_max_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_max_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_max_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_min<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_min_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_min_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_min_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_min_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umin<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umin_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umin_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umin_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umin_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umax<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umax_acq<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umax_rel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umax_acqrel<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_umax_relaxed<T: Copy>(dst: *mut T, src: T) -> T;
pub fn atomic_fence();
pub fn atomic_fence_acq();
pub fn atomic_fence_rel();
pub fn atomic_fence_acqrel();
pub fn atomic_singlethreadfence();
pub fn atomic_singlethreadfence_acq();
pub fn atomic_singlethreadfence_rel();
pub fn atomic_singlethreadfence_acqrel();
}
// These have been renamed.
#[cfg(bootstrap)]
mod atomics {
pub use super::atomic_cxchg as atomic_cxchg_seqcst_seqcst;
pub use super::atomic_cxchg_acq as atomic_cxchg_acquire_acquire;
pub use super::atomic_cxchg_acq_failrelaxed as atomic_cxchg_acquire_relaxed;
pub use super::atomic_cxchg_acqrel as atomic_cxchg_acqrel_acquire;
pub use super::atomic_cxchg_acqrel_failrelaxed as atomic_cxchg_acqrel_relaxed;
pub use super::atomic_cxchg_failacq as atomic_cxchg_seqcst_acquire;
pub use super::atomic_cxchg_failrelaxed as atomic_cxchg_seqcst_relaxed;
pub use super::atomic_cxchg_rel as atomic_cxchg_release_relaxed;
pub use super::atomic_cxchg_relaxed as atomic_cxchg_relaxed_relaxed;
pub use super::atomic_cxchgweak as atomic_cxchgweak_seqcst_seqcst;
pub use super::atomic_cxchgweak_acq as atomic_cxchgweak_acquire_acquire;
pub use super::atomic_cxchgweak_acq_failrelaxed as atomic_cxchgweak_acquire_relaxed;
pub use super::atomic_cxchgweak_acqrel as atomic_cxchgweak_acqrel_acquire;
pub use super::atomic_cxchgweak_acqrel_failrelaxed as atomic_cxchgweak_acqrel_relaxed;
pub use super::atomic_cxchgweak_failacq as atomic_cxchgweak_seqcst_acquire;
pub use super::atomic_cxchgweak_failrelaxed as atomic_cxchgweak_seqcst_relaxed;
pub use super::atomic_cxchgweak_rel as atomic_cxchgweak_release_relaxed;
pub use super::atomic_cxchgweak_relaxed as atomic_cxchgweak_relaxed_relaxed;
pub use super::atomic_load as atomic_load_seqcst;
pub use super::atomic_load_acq as atomic_load_acquire;
pub use super::atomic_load_relaxed;
pub use super::atomic_load_unordered;
pub use super::atomic_store as atomic_store_seqcst;
pub use super::atomic_store_rel as atomic_store_release;
pub use super::atomic_store_relaxed;
pub use super::atomic_store_unordered;
pub use super::atomic_xchg as atomic_xchg_seqcst;
pub use super::atomic_xchg_acq as atomic_xchg_acquire;
pub use super::atomic_xchg_acqrel;
pub use super::atomic_xchg_rel as atomic_xchg_release;
pub use super::atomic_xchg_relaxed;
pub use super::atomic_xadd as atomic_xadd_seqcst;
pub use super::atomic_xadd_acq as atomic_xadd_acquire;
pub use super::atomic_xadd_acqrel;
pub use super::atomic_xadd_rel as atomic_xadd_release;
pub use super::atomic_xadd_relaxed;
pub use super::atomic_xsub as atomic_xsub_seqcst;
pub use super::atomic_xsub_acq as atomic_xsub_acquire;
pub use super::atomic_xsub_acqrel;
pub use super::atomic_xsub_rel as atomic_xsub_release;
pub use super::atomic_xsub_relaxed;
pub use super::atomic_and as atomic_and_seqcst;
pub use super::atomic_and_acq as atomic_and_acquire;
pub use super::atomic_and_acqrel;
pub use super::atomic_and_rel as atomic_and_release;
pub use super::atomic_and_relaxed;
pub use super::atomic_nand as atomic_nand_seqcst;
pub use super::atomic_nand_acq as atomic_nand_acquire;
pub use super::atomic_nand_acqrel;
pub use super::atomic_nand_rel as atomic_nand_release;
pub use super::atomic_nand_relaxed;
pub use super::atomic_or as atomic_or_seqcst;
pub use super::atomic_or_acq as atomic_or_acquire;
pub use super::atomic_or_acqrel;
pub use super::atomic_or_rel as atomic_or_release;
pub use super::atomic_or_relaxed;
pub use super::atomic_xor as atomic_xor_seqcst;
pub use super::atomic_xor_acq as atomic_xor_acquire;
pub use super::atomic_xor_acqrel;
pub use super::atomic_xor_rel as atomic_xor_release;
pub use super::atomic_xor_relaxed;
pub use super::atomic_max as atomic_max_seqcst;
pub use super::atomic_max_acq as atomic_max_acquire;
pub use super::atomic_max_acqrel;
pub use super::atomic_max_rel as atomic_max_release;
pub use super::atomic_max_relaxed;
pub use super::atomic_min as atomic_min_seqcst;
pub use super::atomic_min_acq as atomic_min_acquire;
pub use super::atomic_min_acqrel;
pub use super::atomic_min_rel as atomic_min_release;
pub use super::atomic_min_relaxed;
pub use super::atomic_umin as atomic_umin_seqcst;
pub use super::atomic_umin_acq as atomic_umin_acquire;
pub use super::atomic_umin_acqrel;
pub use super::atomic_umin_rel as atomic_umin_release;
pub use super::atomic_umin_relaxed;
pub use super::atomic_umax as atomic_umax_seqcst;
pub use super::atomic_umax_acq as atomic_umax_acquire;
pub use super::atomic_umax_acqrel;
pub use super::atomic_umax_rel as atomic_umax_release;
pub use super::atomic_umax_relaxed;
pub use super::atomic_fence as atomic_fence_seqcst;
pub use super::atomic_fence_acq as atomic_fence_acquire;
pub use super::atomic_fence_acqrel;
pub use super::atomic_fence_rel as atomic_fence_release;
pub use super::atomic_singlethreadfence as atomic_singlethreadfence_seqcst;
pub use super::atomic_singlethreadfence_acq as atomic_singlethreadfence_acquire;
pub use super::atomic_singlethreadfence_acqrel;
pub use super::atomic_singlethreadfence_rel as atomic_singlethreadfence_release;
}
#[cfg(bootstrap)]
pub use atomics::*;
#[cfg(not(bootstrap))]
extern "rust-intrinsic" { extern "rust-intrinsic" {
// N.B., these intrinsics take raw pointers because they mutate aliased // N.B., these intrinsics take raw pointers because they mutate aliased
// memory, which is not valid for either `&` or `&mut`. // memory, which is not valid for either `&` or `&mut`.
@ -951,7 +743,6 @@ extern "rust-intrinsic" {
// //
// These are the aliases for the old names. // These are the aliases for the old names.
// To be removed when stdarch and panic_unwind have been updated. // To be removed when stdarch and panic_unwind have been updated.
#[cfg(not(bootstrap))]
mod atomics { mod atomics {
pub use super::atomic_cxchg_acqrel_acquire as atomic_cxchg_acqrel; pub use super::atomic_cxchg_acqrel_acquire as atomic_cxchg_acqrel;
pub use super::atomic_cxchg_acqrel_relaxed as atomic_cxchg_acqrel_failrelaxed; pub use super::atomic_cxchg_acqrel_relaxed as atomic_cxchg_acqrel_failrelaxed;
@ -965,7 +756,6 @@ mod atomics {
pub use super::atomic_store_seqcst as atomic_store; pub use super::atomic_store_seqcst as atomic_store;
} }
#[cfg(not(bootstrap))]
pub use atomics::*; pub use atomics::*;
extern "rust-intrinsic" { extern "rust-intrinsic" {
@ -1463,7 +1253,7 @@ extern "rust-intrinsic" {
/// } /// }
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_transmute", since = "1.56.0")] #[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
#[rustc_diagnostic_item = "transmute"] #[rustc_diagnostic_item = "transmute"]
pub fn transmute<T, U>(e: T) -> U; pub fn transmute<T, U>(e: T) -> U;
@ -2300,12 +2090,10 @@ extern "rust-intrinsic" {
/// `ptr` must point to a vtable. /// `ptr` must point to a vtable.
/// The intrinsic will return the size stored in that vtable. /// The intrinsic will return the size stored in that vtable.
#[cfg(not(bootstrap))]
pub fn vtable_size(ptr: *const ()) -> usize; pub fn vtable_size(ptr: *const ()) -> usize;
/// `ptr` must point to a vtable. /// `ptr` must point to a vtable.
/// The intrinsic will return the alignment stored in that vtable. /// The intrinsic will return the alignment stored in that vtable.
#[cfg(not(bootstrap))]
pub fn vtable_align(ptr: *const ()) -> usize; pub fn vtable_align(ptr: *const ()) -> usize;
} }
@ -2452,7 +2240,7 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
/// [`Vec::append`]: ../../std/vec/struct.Vec.html#method.append /// [`Vec::append`]: ../../std/vec/struct.Vec.html#method.append
#[doc(alias = "memcpy")] #[doc(alias = "memcpy")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")] #[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
#[inline] #[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@ -2539,7 +2327,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
/// ``` /// ```
#[doc(alias = "memmove")] #[doc(alias = "memmove")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")] #[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
#[inline] #[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@ -2607,7 +2395,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
/// ``` /// ```
#[doc(alias = "memset")] #[doc(alias = "memset")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")] #[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
#[inline] #[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces

View file

@ -4,7 +4,7 @@
/// any value of type `Self` are safely transmutable into a value of type `Dst`, in a given `Context`, /// any value of type `Self` are safely transmutable into a value of type `Dst`, in a given `Context`,
/// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied. /// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied.
#[unstable(feature = "transmutability", issue = "99571")] #[unstable(feature = "transmutability", issue = "99571")]
#[cfg_attr(not(bootstrap), lang = "transmute_trait")] #[lang = "transmute_trait"]
#[rustc_on_unimplemented( #[rustc_on_unimplemented(
message = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`.", message = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`.",
label = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`." label = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`."

View file

@ -996,7 +996,7 @@ impl<T> (T,) {}
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on arbitrary-length tuples. /// This trait is implemented on arbitrary-length tuples.
impl<T: Clone> Clone for (T,) { impl<T: Clone> Clone for (T,) {
fn clone(&self) -> Self { fn clone(&self) -> Self {
@ -1007,7 +1007,7 @@ impl<T: Clone> Clone for (T,) {
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on arbitrary-length tuples. /// This trait is implemented on arbitrary-length tuples.
impl<T: Copy> Copy for (T,) { impl<T: Copy> Copy for (T,) {
// empty // empty
@ -1484,13 +1484,12 @@ mod prim_fn {}
// Required to make auto trait impls render. // Required to make auto trait impls render.
// See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls // See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
#[doc(hidden)] #[doc(hidden)]
#[cfg(not(bootstrap))]
impl<Ret, T> fn(T) -> Ret {} impl<Ret, T> fn(T) -> Ret {}
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on function pointers with any number of arguments. /// This trait is implemented on function pointers with any number of arguments.
impl<Ret, T> Clone for fn(T) -> Ret { impl<Ret, T> Clone for fn(T) -> Ret {
fn clone(&self) -> Self { fn clone(&self) -> Self {
@ -1501,7 +1500,7 @@ impl<Ret, T> Clone for fn(T) -> Ret {
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on function pointers with any number of arguments. /// This trait is implemented on function pointers with any number of arguments.
impl<Ret, T> Copy for fn(T) -> Ret { impl<Ret, T> Copy for fn(T) -> Ret {
// empty // empty

View file

@ -180,7 +180,6 @@ pub struct DynMetadata<Dyn: ?Sized> {
phantom: crate::marker::PhantomData<Dyn>, phantom: crate::marker::PhantomData<Dyn>,
} }
#[cfg(not(bootstrap))]
extern "C" { extern "C" {
/// Opaque type for accessing vtables. /// Opaque type for accessing vtables.
/// ///
@ -189,17 +188,6 @@ extern "C" {
type VTable; type VTable;
} }
/// The common prefix of all vtables. It is followed by function pointers for trait methods.
///
/// Private implementation detail of `DynMetadata::size_of` etc.
#[repr(C)]
#[cfg(bootstrap)]
struct VTable {
drop_in_place: fn(*mut ()),
size_of: usize,
align_of: usize,
}
impl<Dyn: ?Sized> DynMetadata<Dyn> { impl<Dyn: ?Sized> DynMetadata<Dyn> {
/// Returns the size of the type associated with this vtable. /// Returns the size of the type associated with this vtable.
#[inline] #[inline]
@ -207,9 +195,6 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
// Note that "size stored in vtable" is *not* the same as "result of size_of_val_raw". // Note that "size stored in vtable" is *not* the same as "result of size_of_val_raw".
// Consider a reference like `&(i32, dyn Send)`: the vtable will only store the size of the // Consider a reference like `&(i32, dyn Send)`: the vtable will only store the size of the
// `Send` part! // `Send` part!
#[cfg(bootstrap)]
return self.vtable_ptr.size_of;
#[cfg(not(bootstrap))]
// SAFETY: DynMetadata always contains a valid vtable pointer // SAFETY: DynMetadata always contains a valid vtable pointer
return unsafe { return unsafe {
crate::intrinsics::vtable_size(self.vtable_ptr as *const VTable as *const ()) crate::intrinsics::vtable_size(self.vtable_ptr as *const VTable as *const ())
@ -219,9 +204,6 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
/// Returns the alignment of the type associated with this vtable. /// Returns the alignment of the type associated with this vtable.
#[inline] #[inline]
pub fn align_of(self) -> usize { pub fn align_of(self) -> usize {
#[cfg(bootstrap)]
return self.vtable_ptr.align_of;
#[cfg(not(bootstrap))]
// SAFETY: DynMetadata always contains a valid vtable pointer // SAFETY: DynMetadata always contains a valid vtable pointer
return unsafe { return unsafe {
crate::intrinsics::vtable_align(self.vtable_ptr as *const VTable as *const ()) crate::intrinsics::vtable_align(self.vtable_ptr as *const VTable as *const ())

View file

@ -1834,7 +1834,7 @@ macro_rules! maybe_fnptr_doc {
$item $item
}; };
($a:ident @ #[$meta:meta] $item:item) => { ($a:ident @ #[$meta:meta] $item:item) => {
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
#[doc = "This trait is implemented for function pointers with up to twelve arguments."] #[doc = "This trait is implemented for function pointers with up to twelve arguments."]
#[$meta] #[$meta]
$item $item

View file

@ -4101,7 +4101,6 @@ impl<T, const N: usize> [[T; N]] {
} }
} }
#[cfg(not(bootstrap))]
#[cfg(not(test))] #[cfg(not(test))]
impl [f32] { impl [f32] {
/// Sorts the slice of floats. /// Sorts the slice of floats.
@ -4131,7 +4130,6 @@ impl [f32] {
} }
} }
#[cfg(not(bootstrap))]
#[cfg(not(test))] #[cfg(not(test))]
impl [f64] { impl [f64] {
/// Sorts the slice of floats. /// Sorts the slice of floats.

View file

@ -1584,16 +1584,8 @@ impl<T> AtomicPtr<T> {
#[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")] #[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn fetch_byte_add(&self, val: usize, order: Ordering) -> *mut T { pub fn fetch_byte_add(&self, val: usize, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics. // SAFETY: data races are prevented by atomic intrinsics.
unsafe { unsafe { atomic_add(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
atomic_add(self.p.get(), core::ptr::invalid_mut(val), order).cast()
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_add(self.p.get().cast::<usize>(), val, order) as *mut T
}
} }
/// Offsets the pointer's address by subtracting `val` *bytes*, returning the /// Offsets the pointer's address by subtracting `val` *bytes*, returning the
@ -1628,16 +1620,8 @@ impl<T> AtomicPtr<T> {
#[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")] #[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn fetch_byte_sub(&self, val: usize, order: Ordering) -> *mut T { pub fn fetch_byte_sub(&self, val: usize, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics. // SAFETY: data races are prevented by atomic intrinsics.
unsafe { unsafe { atomic_sub(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
atomic_sub(self.p.get(), core::ptr::invalid_mut(val), order).cast()
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_sub(self.p.get().cast::<usize>(), val, order) as *mut T
}
} }
/// Performs a bitwise "or" operation on the address of the current pointer, /// Performs a bitwise "or" operation on the address of the current pointer,
@ -1687,16 +1671,8 @@ impl<T> AtomicPtr<T> {
#[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")] #[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn fetch_or(&self, val: usize, order: Ordering) -> *mut T { pub fn fetch_or(&self, val: usize, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics. // SAFETY: data races are prevented by atomic intrinsics.
unsafe { unsafe { atomic_or(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
atomic_or(self.p.get(), core::ptr::invalid_mut(val), order).cast()
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_or(self.p.get().cast::<usize>(), val, order) as *mut T
}
} }
/// Performs a bitwise "and" operation on the address of the current /// Performs a bitwise "and" operation on the address of the current
@ -1745,16 +1721,8 @@ impl<T> AtomicPtr<T> {
#[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")] #[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn fetch_and(&self, val: usize, order: Ordering) -> *mut T { pub fn fetch_and(&self, val: usize, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics. // SAFETY: data races are prevented by atomic intrinsics.
unsafe { unsafe { atomic_and(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
atomic_and(self.p.get(), core::ptr::invalid_mut(val), order).cast()
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_and(self.p.get().cast::<usize>(), val, order) as *mut T
}
} }
/// Performs a bitwise "xor" operation on the address of the current /// Performs a bitwise "xor" operation on the address of the current
@ -1801,16 +1769,8 @@ impl<T> AtomicPtr<T> {
#[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")] #[unstable(feature = "strict_provenance_atomic_ptr", issue = "99108")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn fetch_xor(&self, val: usize, order: Ordering) -> *mut T { pub fn fetch_xor(&self, val: usize, order: Ordering) -> *mut T {
#[cfg(not(bootstrap))]
// SAFETY: data races are prevented by atomic intrinsics. // SAFETY: data races are prevented by atomic intrinsics.
unsafe { unsafe { atomic_xor(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
atomic_xor(self.p.get(), core::ptr::invalid_mut(val), order).cast()
}
#[cfg(bootstrap)]
// SAFETY: data races are prevented by atomic intrinsics.
unsafe {
atomic_xor(self.p.get().cast::<usize>(), val, order) as *mut T
}
} }
} }
@ -3073,30 +3033,22 @@ unsafe fn atomic_compare_exchange<T: Copy>(
let (val, ok) = unsafe { let (val, ok) = unsafe {
match (success, failure) { match (success, failure) {
(Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed_relaxed(dst, old, new), (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed_relaxed(dst, old, new),
#[cfg(not(bootstrap))]
(Relaxed, Acquire) => intrinsics::atomic_cxchg_relaxed_acquire(dst, old, new), (Relaxed, Acquire) => intrinsics::atomic_cxchg_relaxed_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Relaxed, SeqCst) => intrinsics::atomic_cxchg_relaxed_seqcst(dst, old, new), (Relaxed, SeqCst) => intrinsics::atomic_cxchg_relaxed_seqcst(dst, old, new),
(Acquire, Relaxed) => intrinsics::atomic_cxchg_acquire_relaxed(dst, old, new), (Acquire, Relaxed) => intrinsics::atomic_cxchg_acquire_relaxed(dst, old, new),
(Acquire, Acquire) => intrinsics::atomic_cxchg_acquire_acquire(dst, old, new), (Acquire, Acquire) => intrinsics::atomic_cxchg_acquire_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Acquire, SeqCst) => intrinsics::atomic_cxchg_acquire_seqcst(dst, old, new), (Acquire, SeqCst) => intrinsics::atomic_cxchg_acquire_seqcst(dst, old, new),
(Release, Relaxed) => intrinsics::atomic_cxchg_release_relaxed(dst, old, new), (Release, Relaxed) => intrinsics::atomic_cxchg_release_relaxed(dst, old, new),
#[cfg(not(bootstrap))]
(Release, Acquire) => intrinsics::atomic_cxchg_release_acquire(dst, old, new), (Release, Acquire) => intrinsics::atomic_cxchg_release_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Release, SeqCst) => intrinsics::atomic_cxchg_release_seqcst(dst, old, new), (Release, SeqCst) => intrinsics::atomic_cxchg_release_seqcst(dst, old, new),
(AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_relaxed(dst, old, new), (AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_relaxed(dst, old, new),
(AcqRel, Acquire) => intrinsics::atomic_cxchg_acqrel_acquire(dst, old, new), (AcqRel, Acquire) => intrinsics::atomic_cxchg_acqrel_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(AcqRel, SeqCst) => intrinsics::atomic_cxchg_acqrel_seqcst(dst, old, new), (AcqRel, SeqCst) => intrinsics::atomic_cxchg_acqrel_seqcst(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchg_seqcst_relaxed(dst, old, new), (SeqCst, Relaxed) => intrinsics::atomic_cxchg_seqcst_relaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchg_seqcst_acquire(dst, old, new), (SeqCst, Acquire) => intrinsics::atomic_cxchg_seqcst_acquire(dst, old, new),
(SeqCst, SeqCst) => intrinsics::atomic_cxchg_seqcst_seqcst(dst, old, new), (SeqCst, SeqCst) => intrinsics::atomic_cxchg_seqcst_seqcst(dst, old, new),
(_, AcqRel) => panic!("there is no such thing as an acquire-release failure ordering"), (_, AcqRel) => panic!("there is no such thing as an acquire-release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"), (_, Release) => panic!("there is no such thing as a release failure ordering"),
#[cfg(bootstrap)]
_ => panic!("a failure ordering can't be stronger than a success ordering"),
} }
}; };
if ok { Ok(val) } else { Err(val) } if ok { Ok(val) } else { Err(val) }
@ -3116,30 +3068,22 @@ unsafe fn atomic_compare_exchange_weak<T: Copy>(
let (val, ok) = unsafe { let (val, ok) = unsafe {
match (success, failure) { match (success, failure) {
(Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed_relaxed(dst, old, new), (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed_relaxed(dst, old, new),
#[cfg(not(bootstrap))]
(Relaxed, Acquire) => intrinsics::atomic_cxchgweak_relaxed_acquire(dst, old, new), (Relaxed, Acquire) => intrinsics::atomic_cxchgweak_relaxed_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Relaxed, SeqCst) => intrinsics::atomic_cxchgweak_relaxed_seqcst(dst, old, new), (Relaxed, SeqCst) => intrinsics::atomic_cxchgweak_relaxed_seqcst(dst, old, new),
(Acquire, Relaxed) => intrinsics::atomic_cxchgweak_acquire_relaxed(dst, old, new), (Acquire, Relaxed) => intrinsics::atomic_cxchgweak_acquire_relaxed(dst, old, new),
(Acquire, Acquire) => intrinsics::atomic_cxchgweak_acquire_acquire(dst, old, new), (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acquire_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Acquire, SeqCst) => intrinsics::atomic_cxchgweak_acquire_seqcst(dst, old, new), (Acquire, SeqCst) => intrinsics::atomic_cxchgweak_acquire_seqcst(dst, old, new),
(Release, Relaxed) => intrinsics::atomic_cxchgweak_release_relaxed(dst, old, new), (Release, Relaxed) => intrinsics::atomic_cxchgweak_release_relaxed(dst, old, new),
#[cfg(not(bootstrap))]
(Release, Acquire) => intrinsics::atomic_cxchgweak_release_acquire(dst, old, new), (Release, Acquire) => intrinsics::atomic_cxchgweak_release_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(Release, SeqCst) => intrinsics::atomic_cxchgweak_release_seqcst(dst, old, new), (Release, SeqCst) => intrinsics::atomic_cxchgweak_release_seqcst(dst, old, new),
(AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_relaxed(dst, old, new), (AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_relaxed(dst, old, new),
(AcqRel, Acquire) => intrinsics::atomic_cxchgweak_acqrel_acquire(dst, old, new), (AcqRel, Acquire) => intrinsics::atomic_cxchgweak_acqrel_acquire(dst, old, new),
#[cfg(not(bootstrap))]
(AcqRel, SeqCst) => intrinsics::atomic_cxchgweak_acqrel_seqcst(dst, old, new), (AcqRel, SeqCst) => intrinsics::atomic_cxchgweak_acqrel_seqcst(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_seqcst_relaxed(dst, old, new), (SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_seqcst_relaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchgweak_seqcst_acquire(dst, old, new), (SeqCst, Acquire) => intrinsics::atomic_cxchgweak_seqcst_acquire(dst, old, new),
(SeqCst, SeqCst) => intrinsics::atomic_cxchgweak_seqcst_seqcst(dst, old, new), (SeqCst, SeqCst) => intrinsics::atomic_cxchgweak_seqcst_seqcst(dst, old, new),
(_, AcqRel) => panic!("there is no such thing as an acquire-release failure ordering"), (_, AcqRel) => panic!("there is no such thing as an acquire-release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"), (_, Release) => panic!("there is no such thing as a release failure ordering"),
#[cfg(bootstrap)]
_ => panic!("a failure ordering can't be stronger than a success ordering"),
} }
}; };
if ok { Ok(val) } else { Err(val) } if ok { Ok(val) } else { Err(val) }

View file

@ -107,7 +107,7 @@ macro_rules! tuple_impls {
// Otherwise, it hides the docs entirely. // Otherwise, it hides the docs entirely.
macro_rules! maybe_tuple_doc { macro_rules! maybe_tuple_doc {
($a:ident @ #[$meta:meta] $item:item) => { ($a:ident @ #[$meta:meta] $item:item) => {
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
#[doc = "This trait is implemented for tuples up to twelve items long."] #[doc = "This trait is implemented for tuples up to twelve items long."]
#[$meta] #[$meta]
$item $item

View file

@ -211,7 +211,7 @@
// Tell the compiler to link to either panic_abort or panic_unwind // Tell the compiler to link to either panic_abort or panic_unwind
#![needs_panic_runtime] #![needs_panic_runtime]
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind` // Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
#![cfg_attr(not(bootstrap), deny(ffi_unwind_calls))] #![deny(ffi_unwind_calls)]
// std may use features in a platform-specific way // std may use features in a platform-specific way
#![allow(unused_features)] #![allow(unused_features)]
#![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count, rt))] #![cfg_attr(test, feature(internal_output_capture, print_internals, update_panic_count, rt))]
@ -243,7 +243,6 @@
#![feature(intra_doc_pointers)] #![feature(intra_doc_pointers)]
#![feature(label_break_value)] #![feature(label_break_value)]
#![feature(lang_items)] #![feature(lang_items)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(linkage)] #![feature(linkage)]
#![feature(link_cfg)] #![feature(link_cfg)]
@ -586,7 +585,7 @@ mod backtrace_rs;
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated, deprecated_in_future)] #[allow(deprecated, deprecated_in_future)]
pub use core::{ pub use core::{
assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne, matches, todo, r#try, assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne, matches, r#try, todo,
unimplemented, unreachable, write, writeln, unimplemented, unreachable, write, writeln,
}; };

View file

@ -14,7 +14,7 @@ use crate::os::wasi::io::OwnedFd;
use crate::sys_common::{AsInner, IntoInner}; use crate::sys_common::{AsInner, IntoInner};
/// Raw file descriptors. /// Raw file descriptors.
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub type RawFd = raw::c_int; pub type RawFd = raw::c_int;
@ -23,7 +23,7 @@ pub type RawFd = raw::c_int;
/// This is only available on unix and WASI platforms and must be imported in /// This is only available on unix and WASI platforms and must be imported in
/// order to call the method. Windows platforms have a corresponding /// order to call the method. Windows platforms have a corresponding
/// `AsRawHandle` and `AsRawSocket` set of traits. /// `AsRawHandle` and `AsRawSocket` set of traits.
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub trait AsRawFd { pub trait AsRawFd {
/// Extracts the raw file descriptor. /// Extracts the raw file descriptor.
@ -59,7 +59,7 @@ pub trait AsRawFd {
/// A trait to express the ability to construct an object from a raw file /// A trait to express the ability to construct an object from a raw file
/// descriptor. /// descriptor.
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[stable(feature = "from_raw_os", since = "1.1.0")] #[stable(feature = "from_raw_os", since = "1.1.0")]
pub trait FromRawFd { pub trait FromRawFd {
/// Constructs a new instance of `Self` from the given raw file /// Constructs a new instance of `Self` from the given raw file
@ -103,7 +103,7 @@ pub trait FromRawFd {
/// A trait to express the ability to consume an object and acquire ownership of /// A trait to express the ability to consume an object and acquire ownership of
/// its raw file descriptor. /// its raw file descriptor.
#[cfg_attr(not(bootstrap), rustc_allowed_through_unstable_modules)] #[rustc_allowed_through_unstable_modules]
#[stable(feature = "into_raw_os", since = "1.4.0")] #[stable(feature = "into_raw_os", since = "1.4.0")]
pub trait IntoRawFd { pub trait IntoRawFd {
/// Consumes this object, returning the raw underlying file descriptor. /// Consumes this object, returning the raw underlying file descriptor.

View file

@ -996,7 +996,7 @@ impl<T> (T,) {}
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on arbitrary-length tuples. /// This trait is implemented on arbitrary-length tuples.
impl<T: Clone> Clone for (T,) { impl<T: Clone> Clone for (T,) {
fn clone(&self) -> Self { fn clone(&self) -> Self {
@ -1007,7 +1007,7 @@ impl<T: Clone> Clone for (T,) {
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on arbitrary-length tuples. /// This trait is implemented on arbitrary-length tuples.
impl<T: Copy> Copy for (T,) { impl<T: Copy> Copy for (T,) {
// empty // empty
@ -1484,13 +1484,12 @@ mod prim_fn {}
// Required to make auto trait impls render. // Required to make auto trait impls render.
// See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls // See src/librustdoc/passes/collect_trait_impls.rs:collect_trait_impls
#[doc(hidden)] #[doc(hidden)]
#[cfg(not(bootstrap))]
impl<Ret, T> fn(T) -> Ret {} impl<Ret, T> fn(T) -> Ret {}
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on function pointers with any number of arguments. /// This trait is implemented on function pointers with any number of arguments.
impl<Ret, T> Clone for fn(T) -> Ret { impl<Ret, T> Clone for fn(T) -> Ret {
fn clone(&self) -> Self { fn clone(&self) -> Self {
@ -1501,7 +1500,7 @@ impl<Ret, T> Clone for fn(T) -> Ret {
// Fake impl that's only really used for docs. // Fake impl that's only really used for docs.
#[cfg(doc)] #[cfg(doc)]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(bootstrap), doc(fake_variadic))] #[doc(fake_variadic)]
/// This trait is implemented on function pointers with any number of arguments. /// This trait is implemented on function pointers with any number of arguments.
impl<Ret, T> Copy for fn(T) -> Ret { impl<Ret, T> Copy for fn(T) -> Ret {
// empty // empty

View file

@ -8,7 +8,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(test)] #![feature(test)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -1,4 +1,3 @@
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(once_cell)] #![feature(once_cell)]
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -4,7 +4,6 @@
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(drain_filter)] #![feature(drain_filter)]
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(let_else)] #![feature(let_else)]
#![feature(lint_reasons)] #![feature(lint_reasons)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -2,7 +2,6 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(control_flow_enum)] #![feature(control_flow_enum)]
#![feature(let_else)] #![feature(let_else)]
#![cfg_attr(bootstrap, feature(let_chains))]
#![feature(lint_reasons)] #![feature(lint_reasons)]
#![feature(once_cell)] #![feature(once_cell)]
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -95,7 +95,7 @@ struct ClippyCallbacks {
impl rustc_driver::Callbacks for ClippyCallbacks { impl rustc_driver::Callbacks for ClippyCallbacks {
// JUSTIFICATION: necessary in clippy driver to set `mir_opt_level` // JUSTIFICATION: necessary in clippy driver to set `mir_opt_level`
#[cfg_attr(not(bootstrap), allow(rustc::bad_opt_access))] #[allow(rustc::bad_opt_access)]
fn config(&mut self, config: &mut interface::Config) { fn config(&mut self, config: &mut interface::Config) {
let previous = config.register_lints.take(); let previous = config.register_lints.take();
let clippy_args_var = self.clippy_args_var.take(); let clippy_args_var = self.clippy_args_var.take();