1
Fork 0

Remove ffi_returns_twice feature

This commit is contained in:
clubby789 2024-01-30 20:55:56 +00:00
parent 5ad7454f75
commit 7331315898
20 changed files with 19 additions and 120 deletions

View file

@ -190,7 +190,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
@ -1307,15 +1306,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 {