Merge ref 'f51d1bcdc6' from rust-lang/rust

Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f51d1bcdc6
Filtered ref: 2ebfe7b93d9b7f9d2dfac7b79e2d473810287782
Upstream diff: 526a91cbcc...f51d1bcdc6

This merge was created using https://github.com/rust-lang/josh-sync.
This commit is contained in:
Ralf Jung 2025-12-20 08:13:11 +01:00
commit 4e732530d5
76 changed files with 701 additions and 698 deletions

View file

@ -10,7 +10,6 @@
// tidy-alphabetical-start
#![allow(clippy::mut_from_ref)] // Arena allocators are one place where this pattern is fine.
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(maybe_uninit_slice))]
#![cfg_attr(test, feature(test))]
#![deny(unsafe_op_in_unsafe_fn)]
#![doc(test(no_crate_inject, attr(deny(warnings), allow(internal_features))))]

View file

@ -5,7 +5,6 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(slice_as_array))]
#![feature(assert_matches)]
#![feature(extern_types)]
#![feature(file_buffered)]

View file

@ -266,6 +266,10 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
"leoncasa" => Some(LLVMFeature::new("hasleoncasa")),
s => Some(LLVMFeature::new(s)),
},
Arch::Wasm32 | Arch::Wasm64 => match s {
"gc" if major < 22 => None,
s => Some(LLVMFeature::new(s)),
},
Arch::X86 | Arch::X86_64 => {
match s {
"sse4.2" => Some(LLVMFeature::with_dependencies(
@ -360,25 +364,25 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
let target_abi = &sess.target.options.abi;
let target_pointer_width = sess.target.pointer_width;
let version = get_version();
let lt_20_1_1 = version < (20, 1, 1);
let lt_21_0_0 = version < (21, 0, 0);
let (major, _, _) = version;
cfg.has_reliable_f16 = match (target_arch, target_os) {
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in llvm20)
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in LLVM 20.1.1)
(Arch::AArch64, _)
if !cfg.target_features.iter().any(|f| f.as_str() == "neon") && lt_20_1_1 =>
if !cfg.target_features.iter().any(|f| f.as_str() == "neon")
&& version < (20, 1, 1) =>
{
false
}
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
(Arch::Arm64EC, _) => false,
// Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
(Arch::S390x, _) if lt_21_0_0 => false,
(Arch::S390x, _) if major < 21 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != Abi::Llvm => false,
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
(Arch::CSky, _) => false,
(Arch::Hexagon, _) if lt_21_0_0 => false, // (fixed in llvm21)
(Arch::Hexagon, _) if major < 21 => false, // (fixed in llvm21)
(Arch::PowerPC | Arch::PowerPC64, _) => false,
(Arch::Sparc | Arch::Sparc64, _) => false,
(Arch::Wasm32 | Arch::Wasm64, _) => false,
@ -389,15 +393,15 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
};
cfg.has_reliable_f128 = match (target_arch, target_os) {
// Unsupported https://github.com/llvm/llvm-project/issues/121122
(Arch::AmdGpu, _) => false,
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
(Arch::Arm64EC, _) => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in llvm20)
(Arch::Mips64 | Arch::Mips64r6, _) if lt_20_1_1 => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in LLVM 20.1.0)
(Arch::Mips64 | Arch::Mips64r6, _) if version < (20, 1, 0) => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>. This issue is closed
// but basic math still does not work.
(Arch::Nvptx64, _) => false,
// Unsupported https://github.com/llvm/llvm-project/issues/121122
(Arch::AmdGpu, _) => false,
// ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
// list at <https://github.com/rust-lang/rust/issues/116909>)
(Arch::PowerPC | Arch::PowerPC64, _) => false,
@ -405,7 +409,7 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
(Arch::Sparc, _) => false,
// Stack alignment bug <https://github.com/llvm/llvm-project/issues/77401>. NB: tests may
// not fail if our compiler-builtins is linked. (fixed in llvm21)
(Arch::X86, _) if lt_21_0_0 => false,
(Arch::X86, _) if major < 21 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != Abi::Llvm => false,
// There are no known problems on other platforms, so the only requirement is that symbols

View file

@ -61,7 +61,7 @@ declare_features! (
/// Allows explicit discriminants on non-unit enum variants.
(accepted, arbitrary_enum_discriminant, "1.66.0", Some(60553)),
/// Allows #[cfg(...)] on inline assembly templates and operands.
(accepted, asm_cfg, "CURRENT_RUSTC_VERSION", Some(140364)),
(accepted, asm_cfg, "1.93.0", Some(140364)),
/// Allows using `const` operands in inline assembly.
(accepted, asm_const, "1.82.0", Some(93332)),
/// Allows using `label` operands in inline assembly.
@ -218,7 +218,7 @@ declare_features! (
/// Allows access to crate names passed via `--extern` through prelude.
(accepted, extern_prelude, "1.30.0", Some(44660)),
/// Allows using `system` as a calling convention with varargs.
(accepted, extern_system_varargs, "CURRENT_RUSTC_VERSION", Some(136946)),
(accepted, extern_system_varargs, "1.93.0", Some(136946)),
/// Allows using F16C intrinsics from `core::arch::{x86, x86_64}`.
(accepted, f16c_target_feature, "1.68.0", Some(44839)),
/// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
@ -392,7 +392,7 @@ declare_features! (
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
(accepted, rvalue_static_promotion, "1.21.0", Some(38865)),
/// Allows use of the `vector` and related s390x target features.
(accepted, s390x_target_feature_vector, "CURRENT_RUSTC_VERSION", Some(145649)),
(accepted, s390x_target_feature_vector, "1.93.0", Some(145649)),
/// Allows `Self` in type definitions (RFC 2300).
(accepted, self_in_typedefs, "1.32.0", Some(49303)),
/// Allows `Self` struct constructor (RFC 2302).

View file

@ -190,7 +190,7 @@ declare_features! (
/// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
(removed, negate_unsigned, "1.0.0", Some(29645), None),
/// Allows diverging expressions to fall back to `!` rather than `()`.
(removed, never_type_fallback, "CURRENT_RUSTC_VERSION", Some(65992), Some("removed in favor of unconditional fallback"), 148871),
(removed, never_type_fallback, "1.93.0", Some(65992), Some("removed in favor of unconditional fallback"), 148871),
/// Allows `#[no_coverage]` on functions.
/// The feature was renamed to `coverage_attribute` and the attribute to `#[coverage(on|off)]`
(removed, no_coverage, "1.74.0", Some(84605), Some("renamed to `coverage_attribute`"), 114656),

View file

@ -412,7 +412,7 @@ declare_features! (
(unstable, c_variadic, "1.34.0", Some(44930)),
/// Allows defining c-variadic naked functions with any extern ABI that is allowed
/// on c-variadic foreign functions.
(unstable, c_variadic_naked_functions, "CURRENT_RUSTC_VERSION", Some(148767)),
(unstable, c_variadic_naked_functions, "1.93.0", Some(148767)),
/// Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled.
(unstable, cfg_contract_checks, "1.86.0", Some(128044)),
/// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
@ -486,7 +486,7 @@ declare_features! (
/// Allows deriving the From trait on single-field structs.
(unstable, derive_from, "1.91.0", Some(144889)),
/// Allows giving non-const impls custom diagnostic messages if attempted to be used as const
(unstable, diagnostic_on_const, "CURRENT_RUSTC_VERSION", Some(143874)),
(unstable, diagnostic_on_const, "1.93.0", Some(143874)),
/// Allows `#[doc(cfg(...))]`.
(unstable, doc_cfg, "1.21.0", Some(43781)),
/// Allows `#[doc(masked)]`.

View file

@ -3,7 +3,6 @@
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
#![feature(const_default)]

View file

@ -58,7 +58,6 @@ This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![feature(assert_matches)]
#![feature(gen_blocks)]
#![feature(if_let_guard)]

View file

@ -2683,7 +2683,6 @@ declare_lint! {
///
/// ```rust,compile_fail
/// # #![allow(unused)]
/// # #![cfg_attr(bootstrap, deny(deref_nullptr))]
/// use std::ptr;
/// unsafe {
/// let x = &*ptr::null::<i32>();

View file

@ -2346,8 +2346,7 @@ declare_lint! {
/// [sanitize]: https://doc.rust-lang.org/nightly/unstable-book/language-features/no-sanitize.html
/// ### Example
///
#[cfg_attr(bootstrap, doc = "```ignore")]
#[cfg_attr(not(bootstrap), doc = "```rust,no_run")]
/// ```rust,no_run
/// #![feature(sanitize)]
///
/// #[sanitize(realtime = "nonblocking")]
@ -2356,8 +2355,7 @@ declare_lint! {
/// fn main() {
/// x();
/// }
#[cfg_attr(bootstrap, doc = "```")]
#[cfg_attr(not(bootstrap), doc = "```")]
/// ```
///
/// {{produces}}
///
@ -4907,8 +4905,7 @@ declare_lint! {
///
/// ### Example
///
#[cfg_attr(bootstrap, doc = "```ignore")]
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
/// ```rust,compile_fail
/// #![feature(supertrait_item_shadowing)]
/// #![deny(resolving_to_items_shadowing_supertrait_items)]
///
@ -4924,8 +4921,7 @@ declare_lint! {
///
/// struct MyType;
/// MyType.hello();
#[cfg_attr(bootstrap, doc = "```")]
#[cfg_attr(not(bootstrap), doc = "```")]
/// ```
///
/// {{produces}}
///
@ -4951,8 +4947,7 @@ declare_lint! {
///
/// ### Example
///
#[cfg_attr(bootstrap, doc = "```ignore")]
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
/// ```rust,compile_fail
/// #![feature(supertrait_item_shadowing)]
/// #![deny(shadowing_supertrait_items)]
///
@ -4965,8 +4960,7 @@ declare_lint! {
/// fn hello(&self) {}
/// }
/// impl<T> Downstream for T {}
#[cfg_attr(bootstrap, doc = "```")]
#[cfg_attr(not(bootstrap), doc = "```")]
/// ```
///
/// {{produces}}
///

View file

@ -1675,15 +1675,14 @@ impl<'a> CrateMetadataRef<'a> {
for virtual_dir in virtual_source_base_dir.iter().flatten() {
if let Some(real_dir) = &real_source_base_dir
&& let rustc_span::FileName::Real(old_name) = name
&& let (_working_dir, embeddable_name) =
old_name.embeddable_name(RemapPathScopeComponents::MACRO)
&& let Ok(rest) = embeddable_name.strip_prefix(virtual_dir)
&& let virtual_path = old_name.path(RemapPathScopeComponents::MACRO)
&& let Ok(rest) = virtual_path.strip_prefix(virtual_dir)
{
let new_path = real_dir.join(rest);
debug!(
"try_to_translate_virtual_to_real: `{}` -> `{}`",
embeddable_name.display(),
virtual_path.display(),
new_path.display(),
);

View file

@ -838,26 +838,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
self.parent_module,
self.infcx.typing_env(self.param_env),
);
// check if the function's return type is inhabited
// this was added here because of this regression
// https://github.com/rust-lang/rust/issues/149571
let output_is_inhabited =
if matches!(self.tcx.def_kind(self.def_id), DefKind::Fn | DefKind::AssocFn) {
self.tcx
.fn_sig(self.def_id)
.instantiate_identity()
.skip_binder()
.output()
.is_inhabited_from(
self.tcx,
self.parent_module,
self.infcx.typing_env(self.param_env),
)
} else {
true
};
if !ty_is_inhabited {
// Unreachable code warnings are already emitted during type checking.
// However, during type checking, full type information is being
@ -868,7 +848,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
// uninhabited types (e.g. empty enums). The check above is used so
// that we do not emit the same warning twice if the uninhabited type
// is indeed `!`.
if !ty.is_never() && output_is_inhabited {
if !ty.is_never()
&& matches!(self.tcx.def_kind(self.def_id), DefKind::Fn | DefKind::AssocFn)
// check if the function's return type is inhabited
// this was added here because of this regression
// https://github.com/rust-lang/rust/issues/149571
&& self
.tcx
.fn_sig(self.def_id)
.instantiate_identity()
.skip_binder()
.output()
.is_inhabited_from(
self.tcx,
self.parent_module,
self.infcx.typing_env(self.param_env),
)
{
lints.push((target_bb, ty, term.source_info.span));
}

View file

@ -28,7 +28,7 @@ use crate::errors::{
PointerPattern, TypeNotPartialEq, TypeNotStructural, UnionPattern, UnsizedPattern,
};
impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
impl<'tcx> PatCtxt<'tcx> {
/// Converts a constant to a pattern (if possible).
/// This means aggregate values (like structs and enums) are converted
/// to a pattern that matches the value (as if you'd compared via structural equality).
@ -64,7 +64,7 @@ struct ConstToPat<'tcx> {
}
impl<'tcx> ConstToPat<'tcx> {
fn new(pat_ctxt: &PatCtxt<'_, 'tcx>, id: hir::HirId, span: Span, c: ty::Const<'tcx>) -> Self {
fn new(pat_ctxt: &PatCtxt<'tcx>, id: hir::HirId, span: Span, c: ty::Const<'tcx>) -> Self {
trace!(?pat_ctxt.typeck_results.hir_owner);
ConstToPat { tcx: pat_ctxt.tcx, typing_env: pat_ctxt.typing_env, span, id, c }
}

View file

@ -30,19 +30,20 @@ pub(crate) use self::check_match::check_match;
use self::migration::PatMigration;
use crate::errors::*;
struct PatCtxt<'a, 'tcx> {
/// Context for lowering HIR patterns to THIR patterns.
struct PatCtxt<'tcx> {
tcx: TyCtxt<'tcx>,
typing_env: ty::TypingEnv<'tcx>,
typeck_results: &'a ty::TypeckResults<'tcx>,
typeck_results: &'tcx ty::TypeckResults<'tcx>,
/// Used by the Rust 2024 migration lint.
rust_2024_migration: Option<PatMigration<'a>>,
rust_2024_migration: Option<PatMigration<'tcx>>,
}
pub(super) fn pat_from_hir<'a, 'tcx>(
pub(super) fn pat_from_hir<'tcx>(
tcx: TyCtxt<'tcx>,
typing_env: ty::TypingEnv<'tcx>,
typeck_results: &'a ty::TypeckResults<'tcx>,
typeck_results: &'tcx ty::TypeckResults<'tcx>,
pat: &'tcx hir::Pat<'tcx>,
) -> Box<Pat<'tcx>> {
let mut pcx = PatCtxt {
@ -62,7 +63,7 @@ pub(super) fn pat_from_hir<'a, 'tcx>(
result
}
impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
impl<'tcx> PatCtxt<'tcx> {
fn lower_pattern(&mut self, pat: &'tcx hir::Pat<'tcx>) -> Box<Pat<'tcx>> {
let adjustments: &[PatAdjustment<'tcx>] =
self.typeck_results.pat_adjustments().get(pat.hir_id).map_or(&[], |v| &**v);

View file

@ -8,7 +8,6 @@
//! LLVM.
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![expect(internal_features)]
#![feature(iter_intersperse)]
#![feature(rustc_attrs)]

View file

@ -745,6 +745,7 @@ static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("bulk-memory", Stable, &[]),
("exception-handling", Unstable(sym::wasm_target_feature), &[]),
("extended-const", Stable, &[]),
("gc", Unstable(sym::wasm_target_feature), &["reference-types"]),
("multivalue", Stable, &[]),
("mutable-globals", Stable, &[]),
("nontrapping-fptoint", Stable, &[]),

View file

@ -2053,7 +2053,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
/// assert_eq!(deque, [1, 2, 3, 4]);
/// assert_eq!(deque.pop_front_if(pred), None);
/// ```
#[stable(feature = "vec_deque_pop_if", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "vec_deque_pop_if", since = "1.93.0")]
pub fn pop_front_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T> {
let first = self.front_mut()?;
if predicate(first) { self.pop_front() } else { None }
@ -2075,7 +2075,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
/// assert_eq!(deque, [0, 1, 2, 3]);
/// assert_eq!(deque.pop_back_if(pred), None);
/// ```
#[stable(feature = "vec_deque_pop_if", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "vec_deque_pop_if", since = "1.93.0")]
pub fn pop_back_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T> {
let last = self.back_mut()?;
if predicate(last) { self.pop_back() } else { None }

View file

@ -602,7 +602,7 @@ pub use core::fmt::{DebugAsHex, FormattingOptions, Sign};
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::fmt::{Formatter, Result, Write};
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
pub use core::fmt::{FromFn, from_fn};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::fmt::{LowerExp, UpperExp};

View file

@ -934,7 +934,7 @@ impl String {
/// assert_eq!(rebuilt, "hello");
/// ```
#[must_use = "losing the pointer will leak memory"]
#[stable(feature = "vec_into_raw_parts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "vec_into_raw_parts", since = "1.93.0")]
pub fn into_raw_parts(self) -> (*mut u8, usize, usize) {
self.vec.into_raw_parts()
}

View file

@ -834,7 +834,7 @@ impl<T> Vec<T> {
/// assert_eq!(rebuilt, [4294967295, 0, 1]);
/// ```
#[must_use = "losing the pointer will leak memory"]
#[stable(feature = "vec_into_raw_parts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "vec_into_raw_parts", since = "1.93.0")]
pub fn into_raw_parts(self) -> (*mut T, usize, usize) {
let mut me = ManuallyDrop::new(self);
(me.as_mut_ptr(), me.len(), me.capacity())

View file

@ -74,12 +74,12 @@ impl char {
/// The maximum number of bytes required to [encode](char::encode_utf8) a `char` to
/// UTF-8 encoding.
#[stable(feature = "char_max_len_assoc", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "char_max_len_assoc", since = "1.93.0")]
pub const MAX_LEN_UTF8: usize = 4;
/// The maximum number of two-byte units required to [encode](char::encode_utf16) a `char`
/// to UTF-16 encoding.
#[stable(feature = "char_max_len_assoc", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "char_max_len_assoc", since = "1.93.0")]
pub const MAX_LEN_UTF16: usize = 2;
/// `U+FFFD REPLACEMENT CHARACTER` (<28>) is used in Unicode to represent a

View file

@ -1226,7 +1226,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
/// assert_eq!(format!("{}", wrapped), "'a'");
/// assert_eq!(format!("{:?}", wrapped), "'a'");
/// ```
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
#[must_use = "returns a type implementing Debug and Display, which do not have any effects unless they are used"]
pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
FromFn(f)
@ -1235,10 +1235,10 @@ pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F>
/// Implements [`fmt::Debug`] and [`fmt::Display`] via the provided closure.
///
/// Created with [`from_fn`].
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
pub struct FromFn<F>(F);
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
impl<F> fmt::Debug for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result,
@ -1248,7 +1248,7 @@ where
}
}
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
impl<F> fmt::Display for FromFn<F>
where
F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result,

View file

@ -41,7 +41,7 @@ pub use num_buffer::{NumBuffer, NumBufferTrait};
#[stable(feature = "debug_builders", since = "1.2.0")]
pub use self::builders::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
#[stable(feature = "fmt_from_fn", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "fmt_from_fn", since = "1.93.0")]
pub use self::builders::{FromFn, from_fn};
/// The type returned by formatter methods.

View file

@ -1139,8 +1139,8 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// [`write_clone_of_slice`]: slice::write_clone_of_slice
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "maybe_uninit_write_slice", since = "1.93.0")]
#[rustc_const_stable(feature = "maybe_uninit_write_slice", since = "1.93.0")]
pub const fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
where
T: Copy,
@ -1200,7 +1200,7 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// [`write_copy_of_slice`]: slice::write_copy_of_slice
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "maybe_uninit_write_slice", since = "1.93.0")]
pub fn write_clone_of_slice(&mut self, src: &[T]) -> &mut [T]
where
T: Clone,
@ -1462,7 +1462,7 @@ impl<T> [MaybeUninit<T>] {
/// requirement the compiler knows about it is that the data pointer must be
/// non-null. Dropping such a `Vec<T>` however will cause undefined
/// behaviour.
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "maybe_uninit_slice", since = "1.93.0")]
#[inline(always)]
#[rustc_const_unstable(feature = "const_drop_in_place", issue = "109342")]
pub const unsafe fn assume_init_drop(&mut self)
@ -1484,8 +1484,8 @@ impl<T> [MaybeUninit<T>] {
/// Calling this when the content is not yet fully initialized causes undefined
/// behavior: it is up to the caller to guarantee that every `MaybeUninit<T>` in
/// the slice really is in an initialized state.
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "maybe_uninit_slice", since = "1.93.0")]
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "1.93.0")]
#[inline(always)]
pub const unsafe fn assume_init_ref(&self) -> &[T] {
// SAFETY: casting `slice` to a `*const [T]` is safe since the caller guarantees that
@ -1503,8 +1503,8 @@ impl<T> [MaybeUninit<T>] {
/// behavior: it is up to the caller to guarantee that every `MaybeUninit<T>` in the
/// slice really is in an initialized state. For instance, `.assume_init_mut()` cannot
/// be used to initialize a `MaybeUninit` slice.
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "maybe_uninit_slice", since = "1.93.0")]
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "1.93.0")]
#[inline(always)]
pub const unsafe fn assume_init_mut(&mut self) -> &mut [T] {
// SAFETY: similar to safety notes for `slice_get_ref`, but we have a

View file

@ -1275,8 +1275,8 @@ macro_rules! int_impl {
/// i.e. when [`checked_neg`] would return `None`.
///
#[doc = concat!("[`checked_neg`]: ", stringify!($SelfT), "::checked_neg")]
#[stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "unchecked_neg", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "unchecked_neg", since = "1.93.0")]
#[rustc_const_stable(feature = "unchecked_neg", since = "1.93.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1392,8 +1392,8 @@ macro_rules! int_impl {
/// i.e. when [`checked_shl`] would return `None`.
///
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "unchecked_shifts", since = "1.93.0")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "1.93.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -1564,8 +1564,8 @@ macro_rules! int_impl {
/// i.e. when [`checked_shr`] would return `None`.
///
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "unchecked_shifts", since = "1.93.0")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "1.93.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]

View file

@ -1851,8 +1851,8 @@ macro_rules! uint_impl {
/// i.e. when [`checked_shl`] would return `None`.
///
#[doc = concat!("[`checked_shl`]: ", stringify!($SelfT), "::checked_shl")]
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "unchecked_shifts", since = "1.93.0")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "1.93.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]
@ -2020,8 +2020,8 @@ macro_rules! uint_impl {
/// i.e. when [`checked_shr`] would return `None`.
///
#[doc = concat!("[`checked_shr`]: ", stringify!($SelfT), "::checked_shr")]
#[stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "unchecked_shifts", since = "1.93.0")]
#[rustc_const_stable(feature = "unchecked_shifts", since = "1.93.0")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline(always)]

View file

@ -1462,8 +1462,8 @@ impl<T> *const [T] {
/// Gets a raw pointer to the underlying array.
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
#[inline]
#[must_use]
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]> {

View file

@ -1712,8 +1712,8 @@ impl<T> *mut [T] {
/// Gets a raw, mutable pointer to the underlying array.
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
#[inline]
#[must_use]
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]> {

View file

@ -842,8 +842,8 @@ impl<T> [T] {
/// Gets a reference to the underlying array.
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
#[inline]
#[must_use]
pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]> {
@ -861,8 +861,8 @@ impl<T> [T] {
/// Gets a mutable reference to the slice's underlying array.
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "core_slice_as_array", since = "1.93.0")]
#[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")]
#[inline]
#[must_use]
pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]> {

View file

@ -325,8 +325,8 @@ impl Duration {
/// assert_eq!(10_u64.pow(15), duration.as_secs());
/// assert_eq!(321, duration.subsec_nanos());
/// ```
#[stable(feature = "duration_from_nanos_u128", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "duration_from_nanos_u128", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "duration_from_nanos_u128", since = "1.93.0")]
#[rustc_const_stable(feature = "duration_from_nanos_u128", since = "1.93.0")]
#[must_use]
#[inline]
#[track_caller]

View file

@ -22,7 +22,6 @@
#![feature(staged_api)]
#![feature(allow_internal_unstable)]
#![feature(decl_macro)]
#![cfg_attr(bootstrap, feature(maybe_uninit_write_slice))]
#![feature(negative_impls)]
#![feature(panic_can_unwind)]
#![feature(restricted_std)]

View file

@ -667,7 +667,7 @@ pub mod arch {
pub use std_detect::is_loongarch_feature_detected;
#[unstable(feature = "is_riscv_feature_detected", issue = "111192")]
pub use std_detect::is_riscv_feature_detected;
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")]
pub use std_detect::is_s390x_feature_detected;
#[stable(feature = "simd_x86", since = "1.27.0")]
pub use std_detect::is_x86_feature_detected;

View file

@ -60,7 +60,7 @@ cfg_select! {
pub use loongarch::*;
}
target_arch = "s390x" => {
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")]
pub use s390x::*;
}
_ => {

View file

@ -9,7 +9,7 @@ features! {
///
/// When the feature is known to be enabled at compile time (e.g. via `-Ctarget-feature`)
/// the macro expands to `true`.
#[stable(feature = "stdarch_s390x_feature_detection", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")]
@FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] concurrent_functions: "concurrent-functions";
/// s390x concurrent-functions facility
@FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] deflate_conversion: "deflate-conversion";
@ -32,30 +32,30 @@ features! {
/// s390x message-security-assist-extension9 facility
@FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] message_security_assist_extension12: "message-security-assist-extension12";
/// s390x message-security-assist-extension12 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] miscellaneous_extensions_2: "miscellaneous-extensions-2";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] miscellaneous_extensions_2: "miscellaneous-extensions-2";
/// s390x miscellaneous-extensions-2 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] miscellaneous_extensions_3: "miscellaneous-extensions-3";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] miscellaneous_extensions_3: "miscellaneous-extensions-3";
/// s390x miscellaneous-extensions-3 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] miscellaneous_extensions_4: "miscellaneous-extensions-4";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] miscellaneous_extensions_4: "miscellaneous-extensions-4";
/// s390x miscellaneous-extensions-4 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] nnp_assist: "nnp-assist";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] nnp_assist: "nnp-assist";
/// s390x nnp-assist facility
@FEATURE: #[unstable(feature = "s390x_target_feature", issue = "44839")] transactional_execution: "transactional-execution";
/// s390x transactional-execution facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector: "vector";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector: "vector";
/// s390x vector facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_enhancements_1: "vector-enhancements-1";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_enhancements_1: "vector-enhancements-1";
/// s390x vector-enhancements-1 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_enhancements_2: "vector-enhancements-2";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_enhancements_2: "vector-enhancements-2";
/// s390x vector-enhancements-2 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_enhancements_3: "vector-enhancements-3";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_enhancements_3: "vector-enhancements-3";
/// s390x vector-enhancements-3 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_packed_decimal: "vector-packed-decimal";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_packed_decimal: "vector-packed-decimal";
/// s390x vector-packed-decimal facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_packed_decimal_enhancement: "vector-packed-decimal-enhancement";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_packed_decimal_enhancement: "vector-packed-decimal-enhancement";
/// s390x vector-packed-decimal-enhancement facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_packed_decimal_enhancement_2: "vector-packed-decimal-enhancement-2";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_packed_decimal_enhancement_2: "vector-packed-decimal-enhancement-2";
/// s390x vector-packed-decimal-enhancement-2 facility
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "CURRENT_RUSTC_VERSION")] vector_packed_decimal_enhancement_3: "vector-packed-decimal-enhancement-3";
@FEATURE: #[stable(feature = "s390x_target_feature_vector", since = "1.93.0")] vector_packed_decimal_enhancement_3: "vector-packed-decimal-enhancement-3";
/// s390x vector-packed-decimal-enhancement-3 facility
}

View file

@ -932,7 +932,6 @@ impl Step for Rustc {
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// If there is any bug, please comment out the next line.
cargo.rustdocflag("--generate-link-to-definition");
cargo.rustdocflag("--generate-macro-expansion");
compile::rustc_cargo(builder, &mut cargo, target, &build_compiler, &self.crates);
cargo.arg("-Zskip-rustdoc-fingerprint");

View file

@ -1032,10 +1032,7 @@ impl Builder<'_> {
self.build.debuginfo_map_to(GitRepo::Rustc, RemapScheme::Compiler)
{
// When building compiler sources, we want to apply the compiler remap scheme.
cargo.env(
"RUSTC_DEBUGINFO_MAP",
format!("{}={}", self.build.src.display(), map_to),
);
cargo.env("RUSTC_DEBUGINFO_MAP", format!("compiler/={map_to}/compiler"));
cargo.env("CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR", map_to);
}
}
@ -1047,10 +1044,7 @@ impl Builder<'_> {
if let Some(ref map_to) =
self.build.debuginfo_map_to(GitRepo::Rustc, RemapScheme::NonCompiler)
{
cargo.env(
"RUSTC_DEBUGINFO_MAP",
format!("{}={}", self.build.src.display(), map_to),
);
cargo.env("RUSTC_DEBUGINFO_MAP", format!("library/={map_to}/library"));
}
}
}

View file

@ -34,15 +34,8 @@ pub struct Finder {
//
// Targets can be removed from this list once they are present in the stage0 compiler (usually by updating the beta compiler of the bootstrap).
const STAGE0_MISSING_TARGETS: &[&str] = &[
"aarch64-unknown-helenos",
"i686-unknown-helenos",
"x86_64-unknown-helenos",
"powerpc-unknown-helenos",
"sparc64-unknown-helenos",
// just a dummy comment so the list doesn't get onelined
"riscv64gc-unknown-redox",
"riscv64im-unknown-none-elf",
"hexagon-unknown-qurt",
];
/// Minimum version threshold for libstdc++ required when using prebuilt LLVM

View file

@ -1,5 +1,4 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(debug_closure_helpers))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/"

1060
src/stage0

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,6 @@
#![feature(derive_coerce_pointee)]
#![feature(arbitrary_self_types)]
#![feature(iter_advance_by)]
#![cfg_attr(bootstrap, feature(duration_from_nanos_u128))]
// Configure clippy and other lints
#![allow(
clippy::collapsible_else_if,

View file

@ -121,6 +121,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
`frecipe`
`frintts`
`fxsr`
`gc`
`gfni`
`guarded-storage`
`hard-float`

View file

@ -1,107 +1,107 @@
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:7:1
--> $DIR/attribute_targets.rs:7:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:9:1
--> $DIR/attribute_targets.rs:9:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:13:1
--> $DIR/attribute_targets.rs:13:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:15:1
--> $DIR/attribute_targets.rs:15:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:21:1
--> $DIR/attribute_targets.rs:21:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:23:1
--> $DIR/attribute_targets.rs:23:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:27:1
--> $DIR/attribute_targets.rs:27:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:29:1
--> $DIR/attribute_targets.rs:29:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:32:5
--> $DIR/attribute_targets.rs:32:5
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:34:5
--> $DIR/attribute_targets.rs:34:5
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:39:1
--> $DIR/attribute_targets.rs:39:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:41:1
--> $DIR/attribute_targets.rs:41:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:44:5
--> $DIR/attribute_targets.rs:44:5
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:46:5
--> $DIR/attribute_targets.rs:46:5
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:51:1
--> $DIR/attribute_targets.rs:51:1
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:53:1
--> $DIR/attribute_targets.rs:53:1
|
LL | #[eii]
| ^^^^^^
error: `#[foo]` is only valid on functions
--> $DIR/wrong_target.rs:56:5
--> $DIR/attribute_targets.rs:56:5
|
LL | #[foo]
| ^^^^^^
error: `#[eii]` is only valid on functions
--> $DIR/wrong_target.rs:58:5
--> $DIR/attribute_targets.rs:58:5
|
LL | #[eii]
| ^^^^^^

View file

@ -2,6 +2,7 @@
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ ignore-backends: gcc
#![feature(extern_types)]

View file

@ -2,6 +2,7 @@
//@ check-run-results
//@ exec-env:RUST_BACKTRACE=0
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//
// Regression test for issue #70963
// The reported panic location should not be `<::core::macros::panic macros>`.

View file

@ -4,6 +4,7 @@
//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
//@ normalize-stderr: "storage_live\[....\]" -> "storage_live[HASH]"
//@ normalize-stderr: "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - "
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ rustc-env:RUST_BACKTRACE=0
#![feature(custom_mir, core_intrinsics)]

View file

@ -1,12 +1,12 @@
error: internal compiler error: broken MIR in Item(DefId(0:8 ~ storage_live[HASH]::multiple_storage)) (after pass CheckForceInline) at bb0[1]:
StorageLive(_1) which already has storage here
--> $DIR/storage-live.rs:21:13
--> $DIR/storage-live.rs:22:13
|
LL | StorageLive(a);
| ^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_mir_transform/src/lint.rs:LL:CC - disabled backtrace
--> $DIR/storage-live.rs:21:13
--> $DIR/storage-live.rs:22:13
|
LL | StorageLive(a);
| ^^^^^^^^^^^^^^

View file

@ -5,6 +5,7 @@
//@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ needs-unwind
//@ ignore-emscripten "RuntimeError" junk in output
//@ ignore-msvc SEH doesn't do panic-during-cleanup the same way as everyone else

View file

@ -1,9 +1,9 @@
thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:22:5:
thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:23:5:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:16:9:
thread 'main' ($TID) panicked at $DIR/panic-in-cleanup.rs:17:9:
BOOM
stack backtrace:

View file

@ -6,6 +6,7 @@
//@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> ""
//@ normalize-stderr: "\n +at [^\n]+" -> ""
//@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ needs-unwind
//@ ignore-emscripten "RuntimeError" junk in output

View file

@ -1,5 +1,5 @@
thread 'main' ($TID) panicked at $DIR/panic-in-ffi.rs:21:5:
thread 'main' ($TID) panicked at $DIR/panic-in-ffi.rs:22:5:
Test
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Noisy Drop

View file

@ -11,6 +11,7 @@
//@ ignore-visionos no 'head'
//@ ignore-backends: gcc
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ compile-flags: -Zon-broken-pipe=error
// Test what the error message looks like when `println!()` panics because of

View file

@ -7,6 +7,7 @@
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ rustc-env:RUST_BACKTRACE=0
#[repr(packed)]

View file

@ -1,5 +1,5 @@
error[E0428]: the name `Dealigned` is defined multiple times
--> $DIR/multiple_definitions_attribute_merging.rs:17:1
--> $DIR/multiple_definitions_attribute_merging.rs:18:1
|
LL | struct Dealigned<T>(u8, T);
| --------------------------- previous definition of the type `Dealigned` here
@ -8,7 +8,7 @@ LL | struct Dealigned<T>(u8, T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Dealigned` redefined here
|
= error: internal compiler error: compiler/rustc_mir_transform/src/check_packed_ref.rs:LL:CC: builtin derive created an unaligned reference
--> $DIR/multiple_definitions_attribute_merging.rs:17:25
--> $DIR/multiple_definitions_attribute_merging.rs:18:25
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
@ -19,8 +19,8 @@ LL | struct Dealigned<T>(u8, T);
Box<dyn Any>
query stack during panic:
#0 [mir_built] building MIR for `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
#0 [mir_built] building MIR for `<impl at $DIR/multiple_definitions_attribute_merging.rs:16:10: 16:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/multiple_definitions_attribute_merging.rs:16:10: 16:19>::eq`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: aborting due to 2 previous errors

View file

@ -7,6 +7,7 @@
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ rustc-env:RUST_BACKTRACE=0
extern crate proc_macro_generate_packed;

View file

@ -1,5 +1,5 @@
error: internal compiler error: compiler/rustc_mir_transform/src/check_packed_ref.rs:LL:CC: builtin derive created an unaligned reference
--> $DIR/proc_macro_generated_packed.rs:18:25
--> $DIR/proc_macro_generated_packed.rs:19:25
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
@ -10,8 +10,8 @@ LL | struct Dealigned<T>(u8, T);
Box<dyn Any>
query stack during panic:
#0 [mir_built] building MIR for `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
#0 [mir_built] building MIR for `<impl at $DIR/proc_macro_generated_packed.rs:16:10: 16:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/proc_macro_generated_packed.rs:16:10: 16:19>::eq`
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: aborting due to 1 previous error

View file

@ -7,6 +7,7 @@
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "note: rustc .+ running on .+" -> "note: rustc $$VERSION running on $$TARGET"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
// The test becomes too flaky if we care about exact args. If `-Z ui-testing`
// from compiletest and `-Z track-diagnostics` from `// compile-flags` at the

View file

@ -4,6 +4,7 @@
// Normalize the emitted location so this doesn't need
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
fn main() {
let _moved @ _from = String::from("foo");

View file

@ -4,6 +4,7 @@
// Normalize the emitted location so this doesn't need
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
fn main() {
let _unimported = Blah { field: u8 };

View file

@ -4,6 +4,7 @@
// Normalize the emitted location so this doesn't need
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
pub onion {
//~^ ERROR missing `enum` for enum definition

View file

@ -4,6 +4,7 @@
// Normalize the emitted location so this doesn't need
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
}
//~^ ERROR unexpected closing delimiter: `}`

View file

@ -4,13 +4,13 @@
// Normalize the emitted location so this doesn't need
// updating everytime someone adds or removes a line.
//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
pub trait Foo {
fn bar();
}
impl <T> Foo for T {
impl<T> Foo for T {
default fn bar() {}
//~^ ERROR specialization is unstable
//~| NOTE created at

View file

@ -3,6 +3,7 @@
//@ normalize-stderr: "note: .*\n\n" -> ""
//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""
//@ normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> ""
//@ rustc-env:RUST_BACKTRACE=0
#![feature(pattern_types, pattern_type_macro, generic_const_exprs)]

View file

@ -1,12 +1,12 @@
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bad_const_generics_args_on_const_param.rs:8:47
--> $DIR/bad_const_generics_args_on_const_param.rs:9:47
|
LL | #![feature(pattern_types, pattern_type_macro, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
= error: internal compiler error: compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:LL:CC: try_lower_anon_const_lit: received const param which shouldn't be possible
--> $DIR/bad_const_generics_args_on_const_param.rs:12:36
--> $DIR/bad_const_generics_args_on_const_param.rs:13:36
|
LL | std::pat::pattern_type!(u32 is START::<(), i32, 2>..=END::<_, Assoc = ()>);
| ^^^^^^^^^^^^^^^^^^^