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 #90507

Merged
merged 2 commits into from
Nov 5, 2021

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Nov 2, 2021

closes #90136

@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 2, 2021
@joshtriplett
Copy link
Member

This seems reasonable and helpful, as an improvement to the error message. 👍 for making this change.

But also, I wonder if we could arrange to always make alloc available, the way that std and core are always available, so that this error doesn't arise in the first place?

@jackh726
Copy link
Member

jackh726 commented Nov 4, 2021

@bors r+ rollup

I think making alloc available like std or core would be nice, but should be a followup.

@bors
Copy link
Contributor

bors commented Nov 4, 2021

📌 Commit 6c1e194 has been approved by jackh726

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2021
Rollup of 9 pull requests

Successful merges:

 - rust-lang#90507 (Suggest `extern crate alloc` when using undeclared module `alloc`)
 - rust-lang#90530 (Simplify js tester a bit)
 - rust-lang#90533 (Add note about x86 instruction prefixes in asm! to unstable book)
 - rust-lang#90537 (Update aarch64 `target_feature` list for LLVM 12.)
 - rust-lang#90544 (Demote metadata load warning to "info".)
 - rust-lang#90554 (Clean up some `-Z unstable-options` in tests.)
 - rust-lang#90556 (Add more text and examples to `carrying_{add|mul}`)
 - rust-lang#90563 (rustbot allow labels)
 - rust-lang#90571 (Fix missing bottom border for headings in sidebar)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Nov 5, 2021

@jackh726
Is there any particular reason why alloc is not available like std or core? If not, should you add a new issue about making core available?

@bors bors merged commit 987797b into rust-lang:master Nov 5, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 5, 2021
@jackh726
Copy link
Member

jackh726 commented Nov 5, 2021

@TaKO8Ki I'm not sure :)

@PatchMixolydic
Copy link
Contributor

PatchMixolydic commented Nov 5, 2021

Pulling in alloc in a no_std binary seems like it requires a global memory allocator to be provided (example), which might be impossible in memory-constrained environments.

@TaKO8Ki TaKO8Ki deleted the suggest-extern-crate-alloc branch November 5, 2021 12:34
@jackh726
Copy link
Member

jackh726 commented Nov 5, 2021

In no_std, yes. But when std is available, alloc should be, probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest extern crate alloc; when using undeclared module alloc
7 participants