-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
BTreeMap uses Global allocator in it's PhantomData even when instantiated with custom Allocator #121797
Labels
A-allocators
Area: Custom and system allocators
A-collections
Area: `std::collection`
C-bug
Category: This is a bug.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Feb 29, 2024
jieyouxu
added
the
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
label
Feb 29, 2024
Does this matter? It holds it directly:
|
My issue is the opposite - it should be
in the PhantomData too, but not implicit
|
I understand, but it already includes |
To avoid inclusion of Global that has no logical relation to the BTreeMap instance with custom allocator |
If it's accepted as a bug I can quickly fix it, at least it passes tests |
fmease
added
A-allocators
Area: Custom and system allocators
A-collections
Area: `std::collection`
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Mar 1, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 2, 2024
…=cuviper Remove hidden use of Global Fixes rust-lang#121797
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Mar 2, 2024
…=cuviper Remove hidden use of Global Fixes rust-lang#121797
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 2, 2024
…=cuviper Remove hidden use of Global Fixes rust-lang#121797
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 2, 2024
Rollup merge of rust-lang#121847 - shamatar:btreemap_fix_implicits, r=cuviper Remove hidden use of Global Fixes rust-lang#121797
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-allocators
Area: Custom and system allocators
A-collections
Area: `std::collection`
C-bug
Category: This is a bug.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
I'm referring to this particular line
rust/library/alloc/src/collections/btree/map.rs
Line 183 in d3d145e
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.The text was updated successfully, but these errors were encountered: