Skip to content

When building with no_std, alloc imports don't also add extern crate alloc #12978

Open
@Lokathor

Description

@Lokathor

When working on a #![no_std] crate and doing a code complete on Vec, selecting alloc::vec::Vec, the import is added to the top of the file, but an appropriate extern crate alloc; is not added anywhere, causing the project to immediately complain and fail to build.

It would be better if RA could detect this and add the extern crate at the crate root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-completionautocompletionA-no_stdissues related to no_std handlingC-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions