Skip to content

False positive error when using bilge #17873

@showier-drastic

Description

@showier-drastic

rust-analyzer version: rust-analyzer version: 0.3.2070-standalone (0daeb5c0b 2024-08-10) [/Users/user/.vscode/extensions/rust-lang.rust-analyzer-0.3.2070-darwin-arm64/server/rust-analyzer]

rustc version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)

editor or extension: VSCode v0.3.2070

relevant settings: No special settings

repository link (if public, optional): https://github.com/showier-drastic/bilge-test

I'm using bilge. This library provides the #[bitsize(3)] macro. The code in the repo above compiles successfully without errors, but rust analyzer complains about it, every time #[bitsize] is used:

add #[bitsize] attribute above your derive attribute rust-analyzer[macro-error](https://rust-analyzer.github.io/manual.html#macro-error)

Upstream issue: hecatia-elegua/bilge#92

code snippet to reproduce:

#[bitsize(14)]
#[derive(FromBits)]
struct Register {
    header: u4,
    body: u7,
    footer: Footer,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions