Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2d09365

Browse files
committedFeb 5, 2025
Auto merge of #136572 - jieyouxu:rollup-mtyaisw, r=jieyouxu
Rollup of 12 pull requests Successful merges: - #132547 (cg_gcc: Directly use rustc_abi instead of reexports) - #135572 (tests: Port `split-debuginfo` to rmake.rs) - #135964 (Make cenum_impl_drop_cast a hard error) - #136154 (Use +secure-plt for powerpc-unknown-linux-gnu{,spe}) - #136304 (Reject negative literals for unsigned or char types in pattern ranges and literals) - #136418 (uefi: process: Add support for command environment variables) - #136449 (std: move network code into `sys`) - #136517 (implement inherent str constructors) - #136536 (Rename and Move some UI tests to more suitable subdirs) - #136537 (Update `compiler-builtins` to 0.1.145) - #136555 (Rename `slice::take...` methods to `split_off...`) - #136567 (Arbitrary self types v2: recursion test) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 820bfff + eeef079 commit 2d09365

File tree

114 files changed

+2359
-1785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2359
-1785
lines changed
 

‎compiler/rustc_lint/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@ fn register_builtins(store: &mut LintStore) {
595595
<https://github.com/rust-lang/rust/pull/125380> for more information",
596596
);
597597
store.register_removed("unsupported_calling_conventions", "converted into hard error");
598+
store.register_removed(
599+
"cenum_impl_drop_cast",
600+
"converted into hard error, \
601+
see <https://github.com/rust-lang/rust/issues/73333> for more information",
602+
);
598603
}
599604

600605
fn register_internals(store: &mut LintStore) {

‎compiler/rustc_lint_defs/src/builtin.rs

-53
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ declare_lint_pass! {
2727
BARE_TRAIT_OBJECTS,
2828
BINDINGS_WITH_VARIANT_NAME,
2929
BREAK_WITH_LABEL_AND_LOOP,
30-
CENUM_IMPL_DROP_CAST,
3130
COHERENCE_LEAK_CHECK,
3231
CONFLICTING_REPR_HINTS,
3332
CONST_EVALUATABLE_UNCHECKED,
@@ -2612,58 +2611,6 @@ declare_lint! {
26122611
@edition Edition2024 => Warn;
26132612
}
26142613

2615-
declare_lint! {
2616-
/// The `cenum_impl_drop_cast` lint detects an `as` cast of a field-less
2617-
/// `enum` that implements [`Drop`].
2618-
///
2619-
/// [`Drop`]: https://doc.rust-lang.org/std/ops/trait.Drop.html
2620-
///
2621-
/// ### Example
2622-
///
2623-
/// ```rust,compile_fail
2624-
/// # #![allow(unused)]
2625-
/// enum E {
2626-
/// A,
2627-
/// }
2628-
///
2629-
/// impl Drop for E {
2630-
/// fn drop(&mut self) {
2631-
/// println!("Drop");
2632-
/// }
2633-
/// }
2634-
///
2635-
/// fn main() {
2636-
/// let e = E::A;
2637-
/// let i = e as u32;
2638-
/// }
2639-
/// ```
2640-
///
2641-
/// {{produces}}
2642-
///
2643-
/// ### Explanation
2644-
///
2645-
/// Casting a field-less `enum` that does not implement [`Copy`] to an
2646-
/// integer moves the value without calling `drop`. This can result in
2647-
/// surprising behavior if it was expected that `drop` should be called.
2648-
/// Calling `drop` automatically would be inconsistent with other move
2649-
/// operations. Since neither behavior is clear or consistent, it was
2650-
/// decided that a cast of this nature will no longer be allowed.
2651-
///
2652-
/// This is a [future-incompatible] lint to transition this to a hard error
2653-
/// in the future. See [issue #73333] for more details.
2654-
///
2655-
/// [future-incompatible]: ../index.md#future-incompatible-lints
2656-
/// [issue #73333]: https://github.com/rust-lang/rust/issues/73333
2657-
/// [`Copy`]: https://doc.rust-lang.org/std/marker/trait.Copy.html
2658-
pub CENUM_IMPL_DROP_CAST,
2659-
Deny,
2660-
"a C-like enum implementing Drop is cast",
2661-
@future_incompatible = FutureIncompatibleInfo {
2662-
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
2663-
reference: "issue #73333 <https://github.com/rust-lang/rust/issues/73333>",
2664-
};
2665-
}
2666-
26672614
declare_lint! {
26682615
/// The `fuzzy_provenance_casts` lint detects an `as` cast between an integer
26692616
/// and a pointer.

‎compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ pub(crate) fn target() -> Target {
1818
pointer_width: 32,
1919
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
2020
arch: "powerpc".into(),
21-
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
21+
options: TargetOptions {
22+
endian: Endian::Big,
23+
features: "+secure-plt".into(),
24+
mcount: "_mcount".into(),
25+
..base
26+
},
2227
}
2328
}

‎compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub(crate) fn target() -> Target {
2121
options: TargetOptions {
2222
abi: "spe".into(),
2323
endian: Endian::Big,
24+
features: "+secure-plt".into(),
2425
mcount: "_mcount".into(),
2526
..base
2627
},
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.