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

#[pointee] attribute can be applied to anything #128485

Closed
oli-obk opened this issue Aug 1, 2024 · 3 comments · Fixed by #128721
Closed

#[pointee] attribute can be applied to anything #128485

oli-obk opened this issue Aug 1, 2024 · 3 comments · Fixed by #128721
Assignees
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Aug 1, 2024

I tried this code:

#![feature(derive_smart_pointer)]

#[pointee]
fn main() {}

I expected to see this happen: compilation failure

Instead, this happened: compilation succeeded

Meta

rustc --version --verbose:

1.82.0-nightly

2024-07-31 28a58f2fa7f0c46b8fab

cc #123430

see #128444 for where to fix this issue

@oli-obk oli-obk added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-bug Category: This is a bug. F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation labels Aug 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 1, 2024
@fmease fmease added A-attributes Area: Attributes (`#[…]`, `#![…]`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 1, 2024
@Brezak
Copy link
Contributor

Brezak commented Aug 5, 2024

@rustbot claim

@dingxiangfei2009
Copy link
Contributor

@rustbot claim

@rustbot rustbot assigned dingxiangfei2009 and unassigned Brezak Aug 6, 2024
@dingxiangfei2009
Copy link
Contributor

@Brezak Oops sorry. You can continue with your PR.

@dingxiangfei2009 dingxiangfei2009 removed their assignment Aug 6, 2024
@bors bors closed this as completed in bd2e7ee Oct 7, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 7, 2024
Rollup merge of rust-lang#128721 - Brezak:pointee-in-strange-places, r=pnkfelix

Don't allow the `#[pointee]` attribute where it doesn't belong

Error if the `#[pointee]` attribute is applied to anything but generic type parameters.

Closes rust-lang#128485
Related to rust-lang#123430
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. F-derive_coerce_pointee Feature: RFC 3621's oft-renamed implementation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants