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

linkage attribute can be applied to any item #128486

Closed
oli-obk opened this issue Aug 1, 2024 · 1 comment · Fixed by #128989
Closed

linkage attribute can be applied to any item #128486

oli-obk opened this issue Aug 1, 2024 · 1 comment · Fixed by #128989
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. 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(linkage)]
#[linkage = "external"]
type Foo = ();

I expected to see this happen: compilation failure because of attribute on an item where it makes no sense

Instead, this happened: compiled successfully

Meta

rustc --version --verbose:

1.82.0-nightly

2024-07-31 28a58f2fa7f0c46b8fab

cc #29603

see #128444 for where to fix this issue

@oli-obk oli-obk added the C-bug Category: This is a bug. label 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
@oli-obk oli-obk added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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
@s7tya
Copy link
Contributor

s7tya commented Aug 8, 2024

@rustbot claim

tgross35 added a commit to tgross35/rust that referenced this issue Aug 17, 2024
… r=petrochenkov

Emit an error for invalid use of the linkage attribute

fixes rust-lang#128486

Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.

Related: rust-lang#128552.
@bors bors closed this as completed in cfeded4 Aug 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 17, 2024
Rollup merge of rust-lang#128989 - s7tya:check-linkage-attribute-pos, r=petrochenkov

Emit an error for invalid use of the linkage attribute

fixes rust-lang#128486

Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.

Related: rust-lang#128552.
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. 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.

4 participants