-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.F-raw_dylib`#![feature(raw_dylib)]``#![feature(raw_dylib)]`
Description
The link_ordinal
attribute currently does not appear to have any restrictions on where it is located.
The following code compiles without warning or error:
#[link_ordinal(123)]
struct Foo{}
I expected to see this happen: An error when link_ordinal
is placed in the wrong position.
Instead, this happened: link_ordinal
is ignored in wrong positions.
The code in CheckAttrVisitor
can be used to enforce this. Just add a check_link_ordinal
method that validates its location (see the other methods for how to do that).
Meta
rustc 1.64.0-nightly (2643b1646 2022-07-27)
binary: rustc
commit-hash: 2643b16468fda787470340890212591d8bc832b7
commit-date: 2022-07-27
host: x86_64-apple-darwin
release: 1.64.0-nightly
LLVM version: 14.0.6
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.F-raw_dylib`#![feature(raw_dylib)]``#![feature(raw_dylib)]`