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

Finish stabilization of result_ffi_guarantees #130628

Merged
merged 5 commits into from
Oct 21, 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
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ declare_features! (
(accepted, repr_packed, "1.33.0", Some(33158)),
/// Allows `#[repr(transparent)]` attribute on newtype structs.
(accepted, repr_transparent, "1.28.0", Some(43036)),
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
/// be used to describe E or vice-versa.
(accepted, result_ffi_guarantees, "CURRENT_RUSTC_VERSION", Some(110503)),
/// Allows return-position `impl Trait` in traits.
(accepted, return_position_impl_trait_in_trait, "1.75.0", Some(91611)),
/// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,6 @@ declare_features! (
(incomplete, repr128, "1.16.0", Some(56071)),
/// Allows `repr(simd)` and importing the various simd intrinsics.
(unstable, repr_simd, "1.4.0", Some(27731)),
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
/// be used to describe E or vise-versa.
(unstable, result_ffi_guarantees, "1.80.0", Some(110503)),
/// Allows bounding the return type of AFIT/RPITIT.
(unstable, return_type_notation, "1.70.0", Some(109417)),
/// Allows `extern "rust-cold"`.
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_lint/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ fn is_niche_optimization_candidate<'tcx>(
/// can, return the type that `ty` can be safely converted to, otherwise return `None`.
/// Currently restricted to function pointers, boxes, references, `core::num::NonZero`,
/// `core::ptr::NonNull`, and `#[repr(transparent)]` newtypes.
/// FIXME: This duplicates code in codegen.
pub(crate) fn repr_nullable_ptr<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ty::ParamEnv<'tcx>,
Expand All @@ -741,10 +740,6 @@ pub(crate) fn repr_nullable_ptr<'tcx>(
[var_one, var_two] => match (&var_one.fields.raw[..], &var_two.fields.raw[..]) {
workingjubilee marked this conversation as resolved.
Show resolved Hide resolved
([], [field]) | ([field], []) => field.ty(tcx, args),
([field1], [field2]) => {
if !tcx.features().result_ffi_guarantees {
return None;
}
workingjubilee marked this conversation as resolved.
Show resolved Hide resolved

let ty1 = field1.ty(tcx, args);
let ty2 = field2.ty(tcx, args);

Expand Down

This file was deleted.

99 changes: 0 additions & 99 deletions tests/ui/feature-gates/feature-gate-result_ffi_guarantees.rs

This file was deleted.

Loading
Loading