Rollup merge of #128925 - dingxiangfei2009:smart-ptr-helper-attr, r=compiler-errors

derive(SmartPointer): register helper attributes

Fix #128888

This PR enables built-in macros to register helper attributes, if any, to support correct name resolution in the correct lexical scope under the macros.

Also, `#[pointee]` is moved into the scope under `derive(SmartPointer)`.

cc `@Darksonn` `@davidtwco`
This commit is contained in:
Matthias Krüger 2024-08-15 00:02:25 +02:00 committed by GitHub
commit 9938349c71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 165 additions and 19 deletions

View file

@ -578,12 +578,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
EncodeCrossCrate::No, coroutines, experimental!(coroutines)
),
// `#[pointee]` attribute to designate the pointee type in SmartPointer derive-macro
gated!(
pointee, Normal, template!(Word), ErrorFollowing,
EncodeCrossCrate::No, derive_smart_pointer, experimental!(pointee)
),
// RFC 3543
// `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]`
gated!(