Skip to content

Commit 3e33bda

Browse files
committed
Auto merge of #130628 - workingjubilee:clean-up-result-ffi-guarantees, r=RalfJung
Finish stabilization of `result_ffi_guarantees` The internal linting has been changed, so all that is left is making sure we stabilize what we want to stabilize.
2 parents 93742bd + 7baf066 commit 3e33bda

9 files changed

Lines changed: 165 additions & 500 deletions

File tree

‎compiler/rustc_feature/src/accepted.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ declare_features! (
353353
(accepted, repr_packed,"1.33.0",Some(33158)),
354354
/// Allows `#[repr(transparent)]` attribute on newtype structs.
355355
(accepted, repr_transparent,"1.28.0",Some(43036)),
356+
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
357+
/// be used to describe E or vice-versa.
358+
(accepted, result_ffi_guarantees,"CURRENT_RUSTC_VERSION",Some(110503)),
356359
/// Allows return-position `impl Trait` in traits.
357360
(accepted, return_position_impl_trait_in_trait,"1.75.0",Some(91611)),
358361
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).

‎compiler/rustc_feature/src/unstable.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,6 @@ declare_features! (
580580
(incomplete, repr128,"1.16.0",Some(56071)),
581581
/// Allows `repr(simd)` and importing the various simd intrinsics.
582582
(unstable, repr_simd,"1.4.0",Some(27731)),
583-
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
584-
/// be used to describe E or vise-versa.
585-
(unstable, result_ffi_guarantees,"1.80.0",Some(110503)),
586583
/// Allows bounding the return type of AFIT/RPITIT.
587584
(unstable, return_type_notation,"1.70.0",Some(109417)),
588585
/// Allows `extern "rust-cold"`.

‎compiler/rustc_lint/src/types.rs‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ fn is_niche_optimization_candidate<'tcx>(
730730
/// can, return the type that `ty` can be safely converted to, otherwise return `None`.
731731
/// Currently restricted to function pointers, boxes, references, `core::num::NonZero`,
732732
/// `core::ptr::NonNull`, and `#[repr(transparent)]` newtypes.
733-
/// FIXME: This duplicates code in codegen.
734733
pub(crate)fnrepr_nullable_ptr<'tcx>(
735734
tcx:TyCtxt<'tcx>,
736735
param_env: ty::ParamEnv<'tcx>,
@@ -743,10 +742,6 @@ pub(crate) fn repr_nullable_ptr<'tcx>(
743742
[var_one, var_two] => match(&var_one.fields.raw[..],&var_two.fields.raw[..]){
744743
([],[field]) | ([field],[]) => field.ty(tcx, args),
745744
([field1],[field2]) => {
746-
if !tcx.features().result_ffi_guarantees{
747-
returnNone;
748-
}
749-
750745
let ty1 = field1.ty(tcx, args);
751746
let ty2 = field2.ty(tcx, args);
752747

‎src/doc/unstable-book/src/language-features/result-ffi-guarantees.md‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎tests/ui/feature-gates/feature-gate-result_ffi_guarantees.rs‎

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)