Skip to content

derive(SmartPointer): register helper attributes #128925

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

dingxiangfei2009
Copy link
Contributor

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

@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2024
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test

@dingxiangfei2009
Copy link
Contributor Author

Yeah working on a test now

@Darksonn
Copy link
Contributor

This may also implicitly fix #128485

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test showing what happens when you have #[pointee] without #[derive(SmartPointer)]?

@nbdd0121
Copy link
Contributor

How does the derive(Default) register the #[default] attribute?

@dingxiangfei2009
Copy link
Contributor Author

How does the derive(Default) register the #[default] attribute?

Ah it registered that with #[rustc_builtin_macro(..)] attribute. Now it is much cleaner.

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 12, 2024

📌 Commit f254ee6 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2024
@compiler-errors compiler-errors added beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 12, 2024
@dingxiangfei2009
Copy link
Contributor Author

Another test was added but I think it is optional. I just found that the test was convered by the Default macro test suite.

@traviscross
Copy link
Contributor

@bors r=compiler-errors 5534cb0 rollup

@Darksonn
Copy link
Contributor

@rustbot label F-derive_smart_pointer

@rustbot rustbot added the F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation label Aug 14, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#125970 (CommandExt::before_exec: deprecate safety in edition 2024)
 - rust-lang#127905 (Add powerpc-unknown-linux-muslspe compile target)
 - rust-lang#128925 (derive(SmartPointer): register helper attributes)
 - rust-lang#128946 (Hash Ipv*Addr as an integer)
 - rust-lang#128963 (Add possibility to generate rustdoc JSON output to stdout)
 - rust-lang#129015 (Update books)
 - rust-lang#129067 (Use `append` instead of `extend(drain(..))`)
 - rust-lang#129100 (Fix dependencies cron job)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#125970 (CommandExt::before_exec: deprecate safety in edition 2024)
 - rust-lang#127905 (Add powerpc-unknown-linux-muslspe compile target)
 - rust-lang#128925 (derive(SmartPointer): register helper attributes)
 - rust-lang#128946 (Hash Ipv*Addr as an integer)
 - rust-lang#128963 (Add possibility to generate rustdoc JSON output to stdout)
 - rust-lang#129015 (Update books)
 - rust-lang#129067 (Use `append` instead of `extend(drain(..))`)
 - rust-lang#129100 (Fix dependencies cron job)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9938349 into rust-lang:master Aug 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
Rollup merge of rust-lang#128925 - dingxiangfei2009:smart-ptr-helper-attr, r=compiler-errors

derive(SmartPointer): register helper attributes

Fix rust-lang#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`
@apiraino
Copy link
Contributor

Beta backport accepted as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Aug 15, 2024
@cuviper cuviper modified the milestones: 1.82.0, 1.81.0 Aug 15, 2024
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
[beta] backports and bump stage0

- Disable jump threading of float equality rust-lang#128271
- Normalize when equating `dyn` tails in MIR borrowck rust-lang#128694
- Improve `Ord` violation help rust-lang#128273
- bump stage0 to stable 1.80.1
- Revert rust-lang#125915 on beta rust-lang#128760
- derive(SmartPointer): register helper attributes rust-lang#128925
- Fix bug in `Parser::look_ahead`. rust-lang#128994

r? cuviper
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regression: pointee is ambiguous