Skip to content

Edition 3 rust-analyzer issue no std issue #1460

@Souvlaki42

Description

@Souvlaki42

I decided to use the drafts for edition 3 of this project as the base for my own OS in Rust.

I noticed an issue after finishing part 3.

With these dependencies for the kernel:

[dependencies]
bootloader_api = "0.11.15"
bootloader-x86_64-common = "0.11.15"
embedded-graphics = "0.8.1"
log = { version = "0.4.29", default-features = false }
conquer-once = { version = "0.4.0", default-features = false }

I'm getting errors like this:

found duplicate lang item panic_impl
the lang item is first defined in crate std (which bitflags depends on)
first definition in std loaded from /home/souvlaki42/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d21d73a0ded86791.rmeta
second definition in the local crate (kernel) (rustc E0152)

It seems like a dependency of that post, links std by default but even after I disabled default features for all of them, I still got it.

The project ran just fine though, seemed just the lsp had issues.

For now, I fixed it by setting rust analyzer's target to x86_64-unknown-none in my editor's settings for this project.

Curious what you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions