-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I'm referring to this particular line
_marker: PhantomData<crate::boxed::Box<(K, V)>>, |
Even though in no_std
environments Global as a structure exists and is defined, and it only shows up in PhantomData, the use of the structure is most likely undefined if #[global_allocator]
attribute is never used. Yes, there will be no calls to Global as it's only a phantom, and execution will not be affected, but just seems ill-defined at least.
For completeness: compilation of code that uses alloc::collection::BTreeMap
with custom allocator under #![feature(btreemap_alloc)]
is not affected, and there is no sign of runtime bugs.
Metadata
Metadata
Assignees
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-collectionsArea: `std::collections`Area: `std::collections`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.