rename extern item to foreign item
This commit is contained in:
parent
322bbdfaaf
commit
6d0f23adad
9 changed files with 14 additions and 14 deletions
|
|
@ -709,11 +709,11 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcPassIndirectlyInNonRusticAbisPa
|
|||
const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPassIndirectlyInNonRusticAbis;
|
||||
}
|
||||
|
||||
pub(crate) struct EiiExternItemParser;
|
||||
pub(crate) struct EiiForeignItemParser;
|
||||
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for EiiExternItemParser {
|
||||
const PATH: &[Symbol] = &[sym::rustc_eii_extern_item];
|
||||
impl<S: Stage> NoArgsAttributeParser<S> for EiiForeignItemParser {
|
||||
const PATH: &[Symbol] = &[sym::rustc_eii_foreign_item];
|
||||
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
|
||||
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]);
|
||||
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::EiiExternItem;
|
||||
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::EiiForeignItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use crate::attributes::allow_unstable::{
|
|||
use crate::attributes::body::CoroutineParser;
|
||||
use crate::attributes::cfi_encoding::CfiEncodingParser;
|
||||
use crate::attributes::codegen_attrs::{
|
||||
ColdParser, CoverageParser, EiiExternItemParser, ExportNameParser, ForceTargetFeatureParser,
|
||||
ColdParser, CoverageParser, EiiForeignItemParser, ExportNameParser, ForceTargetFeatureParser,
|
||||
NakedParser, NoMangleParser, ObjcClassParser, ObjcSelectorParser, OptimizeParser,
|
||||
RustcPassIndirectlyInNonRusticAbisParser, SanitizeParser, TargetFeatureParser,
|
||||
ThreadLocalParser, TrackCallerParser, UsedParser,
|
||||
|
|
@ -243,7 +243,7 @@ attribute_parsers!(
|
|||
Single<WithoutArgs<CoroutineParser>>,
|
||||
Single<WithoutArgs<DenyExplicitImplParser>>,
|
||||
Single<WithoutArgs<DoNotImplementViaObjectParser>>,
|
||||
Single<WithoutArgs<EiiExternItemParser>>,
|
||||
Single<WithoutArgs<EiiForeignItemParser>>,
|
||||
Single<WithoutArgs<ExportStableParser>>,
|
||||
Single<WithoutArgs<FfiConstParser>>,
|
||||
Single<WithoutArgs<FfiPureParser>>,
|
||||
|
|
|
|||
|
|
@ -295,9 +295,9 @@ fn generate_foreign_item(
|
|||
let mut foreign_item_attrs = ThinVec::new();
|
||||
foreign_item_attrs.extend_from_slice(attrs_from_decl);
|
||||
|
||||
// Add the rustc_eii_extern_item on the foreign item. Usually, foreign items are mangled.
|
||||
// Add the rustc_eii_foreign_item on the foreign item. Usually, foreign items are mangled.
|
||||
// This attribute makes sure that we later know that this foreign item's symbol should not be.
|
||||
foreign_item_attrs.push(ecx.attr_word(sym::rustc_eii_extern_item, eii_attr_span));
|
||||
foreign_item_attrs.push(ecx.attr_word(sym::rustc_eii_foreign_item, eii_attr_span));
|
||||
|
||||
let abi = match func.sig.header.ext {
|
||||
// extern "X" fn => extern "X" {}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ fn process_builtin_attrs(
|
|||
AttributeKind::ObjcSelector { methname, .. } => {
|
||||
codegen_fn_attrs.objc_selector = Some(*methname);
|
||||
}
|
||||
AttributeKind::EiiExternItem => {
|
||||
AttributeKind::EiiForeignItem => {
|
||||
codegen_fn_attrs.flags |= CodegenFnAttrFlags::EXTERNALLY_IMPLEMENTABLE_ITEM;
|
||||
}
|
||||
AttributeKind::EiiImpls(impls) => {
|
||||
|
|
|
|||
|
|
@ -962,7 +962,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
|||
EncodeCrossCrate::No, "allow_internal_unsafe side-steps the unsafe_code lint",
|
||||
),
|
||||
gated!(
|
||||
rustc_eii_extern_item, Normal, template!(Word),
|
||||
rustc_eii_foreign_item, Normal, template!(Word),
|
||||
ErrorFollowing, EncodeCrossCrate::Yes, eii_internals,
|
||||
"used internally to mark types with a `transparent` representation when it is guaranteed by the documentation",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ pub enum AttributeKind {
|
|||
EiiDeclaration(EiiDecl),
|
||||
|
||||
/// Implementation detail of `#[eii]`
|
||||
EiiExternItem,
|
||||
EiiForeignItem,
|
||||
|
||||
/// Implementation detail of `#[eii]`
|
||||
EiiImpls(ThinVec<EiiImpl>),
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ impl AttributeKind {
|
|||
DocComment { .. } => Yes,
|
||||
Dummy => No,
|
||||
EiiDeclaration(_) => Yes,
|
||||
EiiExternItem => No,
|
||||
EiiForeignItem => No,
|
||||
EiiImpls(..) => No,
|
||||
ExportName { .. } => Yes,
|
||||
ExportStable => No,
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
},
|
||||
Attribute::Parsed(
|
||||
AttributeKind::EiiDeclaration { .. }
|
||||
| AttributeKind::EiiExternItem
|
||||
| AttributeKind::EiiForeignItem
|
||||
| AttributeKind::BodyStability { .. }
|
||||
| AttributeKind::ConstStabilityIndirect
|
||||
| AttributeKind::MacroTransparency(_)
|
||||
|
|
|
|||
|
|
@ -1951,7 +1951,7 @@ symbols! {
|
|||
rustc_dump_user_args,
|
||||
rustc_dump_vtable,
|
||||
rustc_effective_visibility,
|
||||
rustc_eii_extern_item,
|
||||
rustc_eii_foreign_item,
|
||||
rustc_evaluate_where_clauses,
|
||||
rustc_expected_cgu_reuse,
|
||||
rustc_force_inline,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue