Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aDotInTheVoid opened this issue Oct 21, 2021 · 0 comments · Fixed by #90507
Closed

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

aDotInTheVoid opened this issue Oct 21, 2021 · 0 comments · Fixed by #90507
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

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
@aDotInTheVoid aDotInTheVoid added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 21, 2021
@jyn514 jyn514 added the E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. label Oct 28, 2021
@TaKO8Ki TaKO8Ki self-assigned this Oct 31, 2021
@bors bors closed this as completed in 987797b Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants