Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

SmartPointer derive-macro #125575

Merged
merged 1 commit into from
Jun 24, 2024
Merged

Conversation

dingxiangfei2009
Copy link
Contributor

Possibly replacing #123472 for continued upkeep of the proposal rust-lang/rfcs#3621 and implementation of the tracking issue #123430.

cc @Darksonn @wedsonaf

@rustbot
Copy link
Collaborator

rustbot commented May 26, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 26, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Nadrieril
Copy link
Member

I don't feel competent reviewing this

r? compiler

@cjgillot
Copy link
Contributor

r? compiler

@rustbot rustbot assigned davidtwco and unassigned cjgillot Jun 16, 2024
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Obviously this derive is still undergoing lots of discussion in the RFC, but this seems like a decent start at an implementation that will allow experimentation and can evolve once the RFC settles.

r=me with comments addressed

compiler/rustc_builtin_macros/src/deriving/smart_ptr.rs Outdated Show resolved Hide resolved
compiler/rustc_builtin_macros/src/deriving/smart_ptr.rs Outdated Show resolved Hide resolved
Co-authored-by: Wedson Almeida Filho <walmeida@microsoft.com>
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 24, 2024

📌 Commit f1be59f has been approved by davidtwco

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 Jun 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 24, 2024
…mpiler-errors

Rollup of 11 pull requests

Successful merges:

 - rust-lang#124460 (Show notice about  "never used" of Debug for enum)
 - rust-lang#124712 (Deprecate no-op codegen option `-Cinline-threshold=...`)
 - rust-lang#125082 (Remove `MaybeUninit::uninit_array()` and replace it with inline const blocks.)
 - rust-lang#125575 (SmartPointer derive-macro)
 - rust-lang#126413 (compiletest: make the crash test error message abit more informative)
 - rust-lang#126673 (Ensure we don't accidentally succeed when we want to report an error)
 - rust-lang#126682 (coverage: Overhaul validation of the `#[coverage(..)]` attribute)
 - rust-lang#126899 (Suggest inline const blocks for array initialization)
 - rust-lang#126904 (Small fixme in core now that NonZero is generic)
 - rust-lang#126909 (add `@kobzol` to bootstrap team for triagebot)
 - rust-lang#126911 (Split the lifetimes of `MirBorrowckCtxt`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ed460d2 into rust-lang:master Jun 24, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 24, 2024
Rollup merge of rust-lang#125575 - dingxiangfei2009:derive-smart-ptr, r=davidtwco

SmartPointer derive-macro

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

Possibly replacing rust-lang#123472 for continued upkeep of the proposal rust-lang/rfcs#3621 and implementation of the tracking issue rust-lang#123430.

cc `@Darksonn` `@wedsonaf`
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2024

Assignment is not allowed on a closed PR.

let s_ty = cx.ty_ident(span, Ident::new(sym::__S, span));
let mut alt_self_params = self_params;
alt_self_params[pointee_param_idx] = GenericArg::Type(s_ty.clone());
let alt_self_type = cx.ty_path(cx.path_all(span, false, vec![name_ident], alt_self_params));
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the trait bounds on pointee need to be copied for __S somewhere here. See #127647

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants