Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7331315

Browse files
committed
Remove ffi_returns_twice feature
1 parent 5ad7454 commit 7331315

File tree

20 files changed

+19
-120
lines changed

20 files changed

+19
-120
lines changed

compiler/rustc_codegen_gcc/src/attributes.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ pub fn from_fn_attrs<'gcc, 'tcx>(
6262
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) {
6363
func.add_attribute(FnAttribute::Cold);
6464
}
65-
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_RETURNS_TWICE) {
66-
func.add_attribute(FnAttribute::ReturnsTwice);
67-
}
6865
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) {
6966
func.add_attribute(FnAttribute::Pure);
7067
}

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ pub fn from_fn_attrs<'ll, 'tcx>(
356356
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) {
357357
to_add.push(AttributeKind::Cold.create_attr(cx.llcx));
358358
}
359-
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_RETURNS_TWICE) {
360-
to_add.push(AttributeKind::ReturnsTwice.create_attr(cx.llcx));
361-
}
362359
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) {
363360
to_add.push(MemoryEffects::ReadOnly.create_attr(cx.llcx));
364361
}

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ pub enum AttributeKind {
185185
SanitizeMemory = 22,
186186
NonLazyBind = 23,
187187
OptimizeNone = 24,
188-
ReturnsTwice = 25,
189188
ReadNone = 26,
190189
SanitizeHWAddress = 28,
191190
WillReturn = 29,

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
103103
match name {
104104
sym::cold => codegen_fn_attrs.flags |= CodegenFnAttrFlags::COLD,
105105
sym::rustc_allocator => codegen_fn_attrs.flags |= CodegenFnAttrFlags::ALLOCATOR,
106-
sym::ffi_returns_twice => {
107-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::FFI_RETURNS_TWICE
108-
}
109106
sym::ffi_pure => codegen_fn_attrs.flags |= CodegenFnAttrFlags::FFI_PURE,
110107
sym::ffi_const => codegen_fn_attrs.flags |= CodegenFnAttrFlags::FFI_CONST,
111108
sym::rustc_nounwind => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NEVER_UNWIND,

compiler/rustc_error_codes/src/error_codes/E0724.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
3+
14
`#[ffi_returns_twice]` was used on something other than a foreign function
25
declaration.
36

47
Erroneous code example:
58

6-
```compile_fail,E0724
9+
```compile_fail
710
#![feature(ffi_returns_twice)]
811
#![crate_type = "lib"]
912
@@ -15,7 +18,7 @@ pub fn foo() {}
1518
For example, we might correct the previous example by declaring
1619
the function inside of an `extern` block.
1720

18-
```
21+
```compile_fail
1922
#![feature(ffi_returns_twice)]
2023
2124
extern "C" {

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
440440
experimental!(optimize),
441441
),
442442

443-
gated!(
444-
ffi_returns_twice, Normal, template!(Word), WarnFollowing, experimental!(ffi_returns_twice)
445-
),
446443
gated!(ffi_pure, Normal, template!(Word), WarnFollowing, experimental!(ffi_pure)),
447444
gated!(ffi_const, Normal, template!(Word), WarnFollowing, experimental!(ffi_const)),
448445
gated!(

compiler/rustc_feature/src/removed.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ declare_features! (
9595
/// Allows `#[doc(include = "some-file")]`.
9696
(removed, external_doc, "1.54.0", Some(44732),
9797
Some("use #[doc = include_str!(\"filename\")] instead, which handles macro invocations")),
98+
/// Allows using `#[ffi_returns_twice]` on foreign functions.
99+
(removed, ffi_returns_twice, "CURRENT_RUSTC_VERSION", Some(58314),
100+
Some("being investigated by the ffi-unwind project group")),
98101
/// Allows generators to be cloned.
99102
(removed, generator_clone, "1.65.0", Some(95360), Some("renamed to `coroutine_clone`")),
100103
/// Allows defining generators.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ declare_features! (
467467
(unstable, ffi_const, "1.45.0", Some(58328)),
468468
/// Allows the use of `#[ffi_pure]` on foreign functions.
469469
(unstable, ffi_pure, "1.45.0", Some(58329)),
470-
/// Allows using `#[ffi_returns_twice]` on foreign functions.
471-
(unstable, ffi_returns_twice, "1.34.0", Some(58314)),
472470
/// Allows using `#[repr(align(...))]` on function items
473471
(unstable, fn_align, "1.53.0", Some(82232)),
474472
/// Support delegating implementation of functions to other already implemented functions.

compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ enum LLVMRustAttribute {
7676
SanitizeMemory = 22,
7777
NonLazyBind = 23,
7878
OptimizeNone = 24,
79-
ReturnsTwice = 25,
8079
ReadNone = 26,
8180
SanitizeHWAddress = 28,
8281
WillReturn = 29,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
250250
return Attribute::NonLazyBind;
251251
case OptimizeNone:
252252
return Attribute::OptimizeNone;
253-
case ReturnsTwice:
254-
return Attribute::ReturnsTwice;
255253
case ReadNone:
256254
return Attribute::ReadNone;
257255
case SanitizeHWAddress:

0 commit comments

Comments
 (0)