Skip to content

Suggest extern crate alloc; when using undeclared module alloc #90136

Closed
@aDotInTheVoid

Description

@aDotInTheVoid

Given the following code: link

use alloc::rc::Rc;

The current output is:

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> src/lib.rs:2:5
  |
2 | use alloc::rc::Rc;
  |     ^^^^^ use of undeclared crate or module `alloc`

Ideally the output should look like:

error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
 --> src/lib.rs:2:5
  |
2 | use alloc::rc::Rc;
  |     ^^^^^ use of undeclared crate or module `alloc`
help: add `extern crate alloc` to use the buildin `alloc` module

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions