Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 1.78 bootstrap compiler #122754

Merged
merged 5 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(never_type)]
#![feature(negative_impls)]
#![feature(stmt_expr_attributes)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_data_structures/src/sync/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ mod no_sync {
use super::Mode;
use std::cell::RefCell;

#[doc(no_inline)]
pub use std::cell::RefMut as LockGuard;

pub struct Lock<T>(RefCell<T>);
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(array_windows)]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ declare_features! (
/// Enables `#[cfg(panic = "...")]` config key.
(accepted, cfg_panic, "1.60.0", Some(77443)),
/// Allows `cfg(target_abi = "...")`.
(accepted, cfg_target_abi, "CURRENT_RUSTC_VERSION", Some(80970)),
(accepted, cfg_target_abi, "1.78.0", Some(80970)),
/// Allows `cfg(target_feature = "...")`.
(accepted, cfg_target_feature, "1.27.0", Some(29717)),
/// Allows `cfg(target_vendor = "...")`.
Expand Down Expand Up @@ -149,7 +149,7 @@ declare_features! (
/// Allows the use of destructuring assignments.
(accepted, destructuring_assignment, "1.59.0", Some(71126)),
/// Allows using the `#[diagnostic]` attribute tool namespace
(accepted, diagnostic_namespace, "CURRENT_RUSTC_VERSION", Some(111996)),
(accepted, diagnostic_namespace, "1.78.0", Some(111996)),
/// Allows `#[doc(alias = "...")]`.
(accepted, doc_alias, "1.48.0", Some(50146)),
/// Allows `..` in tuple (struct) patterns.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ declare_features! (
(removed, external_doc, "1.54.0", Some(44732),
Some("use #[doc = include_str!(\"filename\")] instead, which handles macro invocations")),
/// Allows using `#[ffi_returns_twice]` on foreign functions.
(removed, ffi_returns_twice, "CURRENT_RUSTC_VERSION", Some(58314),
(removed, ffi_returns_twice, "1.78.0", Some(58314),
Some("being investigated by the ffi-unwind project group")),
/// Allows generators to be cloned.
(removed, generator_clone, "1.65.0", Some(95360), Some("renamed to `coroutine_clone`")),
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ declare_features! (
/// Allows using `#[omit_gdb_pretty_printer_section]`.
(internal, omit_gdb_pretty_printer_section, "1.5.0", None),
/// Set the maximum pattern complexity allowed (not limited by default).
(internal, pattern_complexity, "CURRENT_RUSTC_VERSION", None),
(internal, pattern_complexity, "1.78.0", None),
/// Allows using `#[prelude_import]` on glob `use` items.
(internal, prelude_import, "1.2.0", None),
/// Used to identify crates that contain the profiler runtime.
Expand Down Expand Up @@ -301,11 +301,11 @@ declare_features! (
(unstable, csky_target_feature, "1.73.0", Some(44839)),
(unstable, ermsb_target_feature, "1.49.0", Some(44839)),
(unstable, hexagon_target_feature, "1.27.0", Some(44839)),
(unstable, lahfsahf_target_feature, "CURRENT_RUSTC_VERSION", Some(44839)),
(unstable, lahfsahf_target_feature, "1.78.0", Some(44839)),
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
(unstable, mips_target_feature, "1.27.0", Some(44839)),
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
(unstable, prfchw_target_feature, "CURRENT_RUSTC_VERSION", Some(44839)),
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),
(unstable, riscv_target_feature, "1.45.0", Some(44839)),
(unstable, rtm_target_feature, "1.35.0", Some(44839)),
(unstable, sse4a_target_feature, "1.27.0", Some(44839)),
Expand Down Expand Up @@ -346,7 +346,7 @@ declare_features! (
/// Enables experimental inline assembly support for additional architectures.
(unstable, asm_experimental_arch, "1.58.0", Some(93335)),
/// Allows using `label` operands in inline assembly.
(unstable, asm_goto, "CURRENT_RUSTC_VERSION", Some(119364)),
(unstable, asm_goto, "1.78.0", Some(119364)),
/// Allows the `may_unwind` option in inline assembly.
(unstable, asm_unwind, "1.58.0", Some(93334)),
/// Allows users to enforce equality of associated constants `TraitImpl<AssocConst=3>`.
Expand Down Expand Up @@ -410,7 +410,7 @@ declare_features! (
/// Allows references to types with interior mutability within constants
(unstable, const_refs_to_cell, "1.51.0", Some(80384)),
/// Allows creating pointers and references to `static` items in constants.
(unstable, const_refs_to_static, "CURRENT_RUSTC_VERSION", Some(119618)),
(unstable, const_refs_to_static, "1.78.0", Some(119618)),
/// Allows `impl const Trait for T` syntax.
(unstable, const_trait_impl, "1.42.0", Some(67792)),
/// Allows the `?` operator in const contexts.
Expand Down Expand Up @@ -462,9 +462,9 @@ declare_features! (
/// Allows defining `extern type`s.
(unstable, extern_types, "1.23.0", Some(43467)),
/// Allow using 128-bit (quad precision) floating point numbers.
(unstable, f128, "CURRENT_RUSTC_VERSION", Some(116909)),
(unstable, f128, "1.78.0", Some(116909)),
/// Allow using 16-bit (half precision) floating point numbers.
(unstable, f16, "CURRENT_RUSTC_VERSION", Some(116909)),
(unstable, f16, "1.78.0", Some(116909)),
/// Allows the use of `#[ffi_const]` on foreign functions.
(unstable, ffi_const, "1.45.0", Some(58328)),
/// Allows the use of `#[ffi_pure]` on foreign functions.
Expand All @@ -474,7 +474,7 @@ declare_features! (
/// Support delegating implementation of functions to other already implemented functions.
(incomplete, fn_delegation, "1.76.0", Some(118212)),
/// Allows impls for the Freeze trait.
(internal, freeze_impls, "CURRENT_RUSTC_VERSION", Some(121675)),
(internal, freeze_impls, "1.78.0", Some(121675)),
/// Allows defining gen blocks and `gen fn`.
(unstable, gen_blocks, "1.75.0", Some(117078)),
/// Infer generic args for both consts and types.
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(never_type)]
#![feature(rustc_attrs)]
#![feature(variant_count)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ This API is completely unstable and subject to change.
#![feature(is_sorted)]
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(never_type)]
#![feature(lazy_cell)]
#![feature(slice_partition_dedup)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(try_blocks)]
#![feature(never_type)]
#![feature(box_patterns)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(control_flow_enum)]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_infer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#![feature(let_chains)]
#![feature(if_let_guard)]
#![feature(iterator_try_collect)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(try_blocks)]
#![recursion_limit = "512"] // For rustdoc

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![cfg_attr(bootstrap, feature(exhaustive_patterns))]
#![cfg_attr(not(bootstrap), feature(min_exhaustive_patterns))]
#![feature(min_exhaustive_patterns)]
#![feature(rustdoc_internals)]
#![feature(allocator_api)]
#![feature(array_windows)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_mir_build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(try_blocks)]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_mir_dataflow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(box_patterns)]
#![feature(exact_size_is_empty)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(try_blocks)]

#[macro_use]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_mir_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#![feature(is_sorted)]
#![feature(let_chains)]
#![feature(map_try_insert)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(never_type)]
#![feature(option_get_or_insert_default)]
#![feature(round_char_boundary)]
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_target/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@

#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![cfg_attr(bootstrap, feature(exhaustive_patterns))]
#![cfg_attr(not(bootstrap), feature(min_exhaustive_patterns))]
#![feature(min_exhaustive_patterns)]
#![feature(rustdoc_internals)]
#![feature(assert_matches)]
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(rustc_attrs)]
#![feature(step_trait)]
#![allow(internal_features)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_trait_selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#![feature(option_take_if)]
#![feature(never_type)]
#![feature(type_alias_impl_trait)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![recursion_limit = "512"] // For rustdoc

#[macro_use]
Expand Down
5 changes: 2 additions & 3 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "Rust" {
#[derive(Copy, Clone, Default, Debug)]
#[cfg(not(test))]
// the compiler needs to know when a Box uses the global allocator vs a custom one
#[cfg_attr(not(bootstrap), lang = "global_alloc_ty")]
#[lang = "global_alloc_ty"]
pub struct Global;

#[cfg(test)]
Expand Down Expand Up @@ -387,8 +387,7 @@ pub const fn handle_alloc_error(layout: Layout) -> ! {
}

#[cfg(not(feature = "panic_immediate_abort"))]
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // on bootstrap bump, remove unsafe block
unsafe {
{
core::intrinsics::const_eval_select((layout,), ct_error, rt_error)
}

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ pub trait AsMut<T: ?Sized> {
/// For example, take this code:
///
/// ```
/// # #![cfg_attr(not(bootstrap), allow(non_local_definitions))]
/// # #![allow(non_local_definitions)]
/// struct Wrapper<T>(Vec<T>);
/// impl<T> From<Wrapper<T>> for Vec<T> {
/// fn from(w: Wrapper<T>) -> Vec<T> {
Expand Down
14 changes: 2 additions & 12 deletions library/core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,7 @@ impl CStr {
unsafe { &*(bytes as *const [u8] as *const CStr) }
}

#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // on bootstrap bump, remove unsafe block
// SAFETY: The const and runtime versions have identical behavior
// unless the safety contract of `from_bytes_with_nul_unchecked` is
// violated, which is UB.
unsafe {
intrinsics::const_eval_select((bytes,), const_impl, rt_impl)
}
intrinsics::const_eval_select((bytes,), const_impl, rt_impl)
}

/// Returns the inner pointer to this C string.
Expand Down Expand Up @@ -759,11 +753,7 @@ const unsafe fn const_strlen(ptr: *const c_char) -> usize {
unsafe { strlen(s) }
}

#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // on bootstrap bump, remove unsafe block
// SAFETY: the two functions always provide equivalent functionality
unsafe {
intrinsics::const_eval_select((ptr,), strlen_ct, strlen_rt)
}
intrinsics::const_eval_select((ptr,), strlen_ct, strlen_rt)
}

/// An iterator over the bytes of a [`CStr`], without the nul terminator.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ pub trait Hasher {
/// ```
/// #![feature(hasher_prefixfree_extras)]
/// # // Stubs to make the `impl` below pass the compiler
/// # #![cfg_attr(not(bootstrap), allow(non_local_definitions))]
/// # #![allow(non_local_definitions)]
/// # struct MyCollection<T>(Option<T>);
/// # impl<T> MyCollection<T> {
/// # fn len(&self) -> usize { todo!() }
Expand Down
Loading
Loading