1
Fork 0

Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errors

Remove `ffi_returns_twice` feature

The [tracking issue](https://github.com/rust-lang/rust/issues/58314) and [RFC](https://github.com/rust-lang/rfcs/pull/2633) have been closed for a couple of years.

There is also an attribute gate in R-A which should be removed if this lands.
This commit is contained in:
Matthias Krüger 2024-02-06 22:45:42 +01:00 committed by GitHub
commit 59ba8024af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 19 additions and 120 deletions

View file

@ -192,7 +192,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
sym::ffi_pure => self.check_ffi_pure(attr.span, attrs, target),
sym::ffi_const => self.check_ffi_const(attr.span, target),
sym::ffi_returns_twice => self.check_ffi_returns_twice(attr.span, target),
sym::rustc_const_unstable
| sym::rustc_const_stable
| sym::unstable
@ -1309,15 +1308,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
}
fn check_ffi_returns_twice(&self, attr_span: Span, target: Target) -> bool {
if target == Target::ForeignFn {
true
} else {
self.dcx().emit_err(errors::FfiReturnsTwiceInvalidTarget { attr_span });
false
}
}
/// Warns against some misuses of `#[must_use]`
fn check_must_use(&self, hir_id: HirId, attr: &Attribute, target: Target) -> bool {
if !matches!(

View file

@ -390,13 +390,6 @@ pub struct FfiConstInvalidTarget {
pub attr_span: Span,
}
#[derive(Diagnostic)]
#[diag(passes_ffi_returns_twice_invalid_target, code = E0724)]
pub struct FfiReturnsTwiceInvalidTarget {
#[primary_span]
pub attr_span: Span,
}
#[derive(LintDiagnostic)]
#[diag(passes_must_use_async)]
pub struct MustUseAsync {