Repository: rust-lang/rust
File: library/core/src/lib.rs (Rust)

Code before:
#![feature(rtm_target_feature)]
#![feature(s390x_target_feature)]
#![feature(wasm_target_feature)]
#![feature(x86_amx_intrinsics)]
// tidy-alphabetical-end

// allow using `core::` in intra-doc links
#[allow(unused_extern_crates)]
extern crate self as core;

/* The core prelude, not as all-encompassing as the std prelude */
// The compiler expects the prelude definition to be defined before it's use statement.
pub mod prelude;

#[prelude_import]
#[allow(unused)]
use prelude::rust_2024::*;

#[macro_use]
mod macros;

// These macros are explicitly exported here and not in the preludes - for now - to require manual
// import by users to avoid compatibility issues such as with the third-party assert_matches macro.
// See https://github.com/rust-lang/rust/pull/137487 and
// https://github.com/rust-lang/rust/issues/82913
#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
pub use crate::macros::{assert_matches, debug_assert_matches};

#[unstable(feature = "derive_from", issue = "144889")]
/// Unstable module containing the unstable `From` derive macro.
pub mod from {
    #[unstable(feature = "derive_from", issue = "144889")]
    pub use crate::macros::builtin::From;
}

// We don't export this through #[macro_export] for now, to avoid breakage.
#[unstable(feature = "autodiff", issue = "124509")]
/// Unstable module containing the unstable `autodiff` macro.
pub mod autodiff {
    #[unstable(feature = "autodiff", issue = "124509")]
    pub use crate::macros::builtin::{autodiff_forward, autodiff_reverse};
}

#[unstable(feature = "contracts", issue = "128044")]
pub mod contracts;

#[unstable(feature = "cfg_select", issue = "115585")]
pub use crate::macros::cfg_select;

#[macro_use]
mod internal_macros;

Review comment (suggestion):
This does 2 things at once, when typically we prefer to do them separately: the stabilization PR should only change the stability of a feature, not change how it works.

Put differently, all code that worked before a stabilization PR should keep working, with the only difference being that there are new warnings about using `feature` on an already-stable feature.

I said this from the start:

> So any moving around of the definition should ideally be done first in a separate PR.

Your replies were always about something unrelated. I can't figure out why.

Code after:
#![feature(nvptx_target_feature)]
#![feature(powerpc_target_feature)]
#![feature(riscv_target_feature)]
#![feature(rtm_target_feature)]
#![feature(s390x_target_feature)]
#![feature(wasm_target_feature)]
#![feature(x86_amx_intrinsics)]
// tidy-alphabetical-end

// allow using `core::` in intra-doc links
#[allow(unused_extern_crates)]
extern crate self as core;

/* The core prelude, not as all-encompassing as the std prelude */
// The compiler expects the prelude definition to be defined before it's use statement.
pub mod prelude;

#[prelude_import]
#[allow(unused)]
use prelude::rust_2024::*;

#[macro_use]
mod macros;

#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
pub use crate::macros::{assert_matches, debug_assert_matches};

#[unstable(feature = "derive_from", issue = "144889")]
/// Unstable module containing the unstable `From` derive macro.
pub mod from {
    #[unstable(feature = "derive_from", issue = "144889")]
    pub use crate::macros::builtin::From;
}

// We don't export this through #[macro_export] for now, to avoid breakage.
#[unstable(feature = "autodiff", issue = "124509")]
/// Unstable module containing the unstable `autodiff` macro.
pub mod autodiff {
    #[unstable(feature = "autodiff", issue = "124509")]
    pub use crate::macros::builtin::{autodiff_forward, autodiff_reverse};
}

#[unstable(feature = "contracts", issue = "128044")]
pub mod contracts;

#[unstable(feature = "cfg_select", issue = "115585")]
pub use crate::macros::cfg_select;

#[macro_use]
mod internal_macros;