-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
global_allocator can not not be defined inside module #44113
Copy link
Copy link
Closed
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsC-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsC-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When trying define a global allocator inside a module, you get a weird error message:
[E0432]: unresolved import super. The global_allocator is expanded to code containinguse super::<varname>but I don't know why rustc fails to resolve that in this case. Happens with both inline and file modules.Looks like the module that is created by expanding global_allocator thinks its parent is the root crate despite being in the
breaksmodule.Example:
causes: