1
Fork 0

remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead

This commit is contained in:
Ralf Jung 2024-11-07 08:59:43 +01:00
parent 78bb5ee79e
commit e3010e84db
42 changed files with 380 additions and 348 deletions

View file

@ -210,9 +210,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| [sym::rustc_promotable, ..] => self.check_stability_promotable(attr, target),
[sym::link_ordinal, ..] => self.check_link_ordinal(attr, span, target),
[sym::rustc_confusables, ..] => self.check_confusables(attr, target),
[sym::rustc_safe_intrinsic, ..] => {
self.check_rustc_safe_intrinsic(hir_id, attr, span, target)
}
[sym::cold, ..] => self.check_cold(hir_id, attr, span, target),
[sym::link, ..] => self.check_link(hir_id, attr, span, target),
[sym::link_name, ..] => self.check_link_name(hir_id, attr, span, target),
@ -2055,25 +2052,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
}
fn check_rustc_safe_intrinsic(
&self,
hir_id: HirId,
attr: &Attribute,
span: Span,
target: Target,
) {
if let Target::ForeignFn = target
&& let hir::Node::Item(Item {
kind: ItemKind::ForeignMod { abi: Abi::RustIntrinsic, .. },
..
}) = self.tcx.parent_hir_node(hir_id)
{
return;
}
self.dcx().emit_err(errors::RustcSafeIntrinsic { attr_span: attr.span, span });
}
fn check_rustc_std_internal_symbol(&self, attr: &Attribute, span: Span, target: Target) {
match target {
Target::Fn | Target::Static => {}

View file

@ -641,15 +641,6 @@ pub(crate) struct RustcAllowConstFnUnstable {
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(passes_rustc_safe_intrinsic)]
pub(crate) struct RustcSafeIntrinsic {
#[primary_span]
pub attr_span: Span,
#[label]
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(passes_rustc_std_internal_symbol)]
pub(crate) struct RustcStdInternalSymbol {