Add #[rustc_as_ptr] attribute
This commit is contained in:
parent
145f9cf95d
commit
5f443df404
3 changed files with 9 additions and 0 deletions
|
@ -875,6 +875,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, EncodeCrossCrate::No, lang_items,
|
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, EncodeCrossCrate::No, lang_items,
|
||||||
"lang items are subject to change",
|
"lang items are subject to change",
|
||||||
),
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_as_ptr, Normal, template!(Word), ErrorFollowing,
|
||||||
|
EncodeCrossCrate::Yes,
|
||||||
|
"#[rustc_as_ptr] is used to mark functions returning pointers to their inner allocations."
|
||||||
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_pass_by_value, Normal, template!(Word), ErrorFollowing,
|
rustc_pass_by_value, Normal, template!(Word), ErrorFollowing,
|
||||||
EncodeCrossCrate::Yes,
|
EncodeCrossCrate::Yes,
|
||||||
|
|
|
@ -162,6 +162,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||||
self.check_rustc_std_internal_symbol(attr, span, target)
|
self.check_rustc_std_internal_symbol(attr, span, target)
|
||||||
}
|
}
|
||||||
[sym::naked, ..] => self.check_naked(hir_id, attr, span, target, attrs),
|
[sym::naked, ..] => self.check_naked(hir_id, attr, span, target, attrs),
|
||||||
|
[sym::rustc_as_ptr, ..] => {
|
||||||
|
self.check_applied_to_fn_or_method(hir_id, attr, span, target)
|
||||||
|
}
|
||||||
[sym::rustc_never_returns_null_ptr, ..] => {
|
[sym::rustc_never_returns_null_ptr, ..] => {
|
||||||
self.check_applied_to_fn_or_method(hir_id, attr, span, target)
|
self.check_applied_to_fn_or_method(hir_id, attr, span, target)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1652,6 +1652,7 @@ symbols! {
|
||||||
rustc_allow_const_fn_unstable,
|
rustc_allow_const_fn_unstable,
|
||||||
rustc_allow_incoherent_impl,
|
rustc_allow_incoherent_impl,
|
||||||
rustc_allowed_through_unstable_modules,
|
rustc_allowed_through_unstable_modules,
|
||||||
|
rustc_as_ptr,
|
||||||
rustc_attrs,
|
rustc_attrs,
|
||||||
rustc_autodiff,
|
rustc_autodiff,
|
||||||
rustc_box,
|
rustc_box,
|
||||||
|
|
Loading…
Add table
Reference in a new issue