testsuite: Add the alloc crate to the testsuite - #4693
Merged
Conversation
Collaborator
|
Could you stick a copy of the 1.49 alloc crate in |
nsvke
force-pushed
the
alloc-testsuite
branch
3 times, most recently
from
August 10, 2026 09:38
ffadbe6 to
c49ab80
Compare
This commit imports liballoc 1.49.0. libgrust/ChangeLog: * rustc-lib/version-info: * rustc-lib/alloc/Cargo.toml: New file. * rustc-lib/alloc/benches/binary_heap.rs: New file. * rustc-lib/alloc/benches/btree/map.rs: New file. * rustc-lib/alloc/benches/btree/mod.rs: New file. * rustc-lib/alloc/benches/btree/set.rs: New file. * rustc-lib/alloc/benches/lib.rs: New file. * rustc-lib/alloc/benches/linked_list.rs: New file. * rustc-lib/alloc/benches/slice.rs: New file. * rustc-lib/alloc/benches/str.rs: New file. * rustc-lib/alloc/benches/string.rs: New file. * rustc-lib/alloc/benches/vec.rs: New file. * rustc-lib/alloc/benches/vec_deque.rs: New file. * rustc-lib/alloc/benches/vec_deque_append.rs: New file. * rustc-lib/alloc/src/alloc.rs: New file. * rustc-lib/alloc/src/alloc/tests.rs: New file. * rustc-lib/alloc/src/borrow.rs: New file. * rustc-lib/alloc/src/boxed.rs: New file. * rustc-lib/alloc/src/collections/binary_heap.rs: New file. * rustc-lib/alloc/src/collections/btree/append.rs: New file. * rustc-lib/alloc/src/collections/btree/borrow.rs: New file. * rustc-lib/alloc/src/collections/btree/borrow/tests.rs: New file. * rustc-lib/alloc/src/collections/btree/map.rs: New file. * rustc-lib/alloc/src/collections/btree/map/entry.rs: New file. * rustc-lib/alloc/src/collections/btree/map/tests.rs: New file. * rustc-lib/alloc/src/collections/btree/mem.rs: New file. * rustc-lib/alloc/src/collections/btree/merge_iter.rs: New file. * rustc-lib/alloc/src/collections/btree/mod.rs: New file. * rustc-lib/alloc/src/collections/btree/navigate.rs: New file. * rustc-lib/alloc/src/collections/btree/node.rs: New file. * rustc-lib/alloc/src/collections/btree/node/tests.rs: New file. * rustc-lib/alloc/src/collections/btree/remove.rs: New file. * rustc-lib/alloc/src/collections/btree/search.rs: New file. * rustc-lib/alloc/src/collections/btree/set.rs: New file. * rustc-lib/alloc/src/collections/btree/set/tests.rs: New file. * rustc-lib/alloc/src/collections/btree/split.rs: New file. * rustc-lib/alloc/src/collections/linked_list.rs: New file. * rustc-lib/alloc/src/collections/linked_list/tests.rs: New file. * rustc-lib/alloc/src/collections/mod.rs: New file. * rustc-lib/alloc/src/collections/vec_deque.rs: New file. * rustc-lib/alloc/src/collections/vec_deque/drain.rs: New file. * rustc-lib/alloc/src/collections/vec_deque/tests.rs: New file. * rustc-lib/alloc/src/fmt.rs: New file. * rustc-lib/alloc/src/lib.rs: New file. * rustc-lib/alloc/src/macros.rs: New file. * rustc-lib/alloc/src/prelude/mod.rs: New file. * rustc-lib/alloc/src/prelude/v1.rs: New file. * rustc-lib/alloc/src/raw_vec.rs: New file. * rustc-lib/alloc/src/raw_vec/tests.rs: New file. * rustc-lib/alloc/src/rc.rs: New file. * rustc-lib/alloc/src/rc/tests.rs: New file. * rustc-lib/alloc/src/slice.rs: New file. * rustc-lib/alloc/src/str.rs: New file. * rustc-lib/alloc/src/string.rs: New file. * rustc-lib/alloc/src/sync.rs: New file. * rustc-lib/alloc/src/sync/tests.rs: New file. * rustc-lib/alloc/src/task.rs: New file. * rustc-lib/alloc/src/tests.rs: New file. * rustc-lib/alloc/src/vec.rs: New file. * rustc-lib/alloc/tests/arc.rs: New file. * rustc-lib/alloc/tests/binary_heap.rs: New file. * rustc-lib/alloc/tests/borrow.rs: New file. * rustc-lib/alloc/tests/boxed.rs: New file. * rustc-lib/alloc/tests/btree_set_hash.rs: New file. * rustc-lib/alloc/tests/cow_str.rs: New file. * rustc-lib/alloc/tests/fmt.rs: New file. * rustc-lib/alloc/tests/heap.rs: New file. * rustc-lib/alloc/tests/lib.rs: New file. * rustc-lib/alloc/tests/linked_list.rs: New file. * rustc-lib/alloc/tests/rc.rs: New file. * rustc-lib/alloc/tests/slice.rs: New file. * rustc-lib/alloc/tests/str.rs: New file. * rustc-lib/alloc/tests/string.rs: New file. * rustc-lib/alloc/tests/vec.rs: New file. * rustc-lib/alloc/tests/vec_deque.rs: New file. Signed-off-by: Enes Cevik <enes@nsvke.com>
This patch adds the alloc to the testsuite with some temporary modifications: - Comment out unsupported features in lib.rs. - Comment out the `ForceResult` enum due to issue Rust-GCC#4687 in collections/btree/node.rs. gcc/testsuite/ChangeLog: * rust/alloc/alloc.exp: New test. * rust/alloc/alloc/src/alloc.rs: New test. * rust/alloc/alloc/src/alloc/tests.rs: New test. * rust/alloc/alloc/src/borrow.rs: New test. * rust/alloc/alloc/src/boxed.rs: New test. * rust/alloc/alloc/src/collections/binary_heap.rs: New test. * rust/alloc/alloc/src/collections/btree/append.rs: New test. * rust/alloc/alloc/src/collections/btree/borrow.rs: New test. * rust/alloc/alloc/src/collections/btree/borrow/tests.rs: New test. * rust/alloc/alloc/src/collections/btree/map.rs: New test. * rust/alloc/alloc/src/collections/btree/map/entry.rs: New test. * rust/alloc/alloc/src/collections/btree/map/tests.rs: New test. * rust/alloc/alloc/src/collections/btree/mem.rs: New test. * rust/alloc/alloc/src/collections/btree/merge_iter.rs: New test. * rust/alloc/alloc/src/collections/btree/mod.rs: New test. * rust/alloc/alloc/src/collections/btree/navigate.rs: New test. * rust/alloc/alloc/src/collections/btree/node.rs: New test. * rust/alloc/alloc/src/collections/btree/node/tests.rs: New test. * rust/alloc/alloc/src/collections/btree/remove.rs: New test. * rust/alloc/alloc/src/collections/btree/search.rs: New test. * rust/alloc/alloc/src/collections/btree/set.rs: New test. * rust/alloc/alloc/src/collections/btree/set/tests.rs: New test. * rust/alloc/alloc/src/collections/btree/split.rs: New test. * rust/alloc/alloc/src/collections/linked_list.rs: New test. * rust/alloc/alloc/src/collections/linked_list/tests.rs: New test. * rust/alloc/alloc/src/collections/mod.rs: New test. * rust/alloc/alloc/src/collections/vec_deque.rs: New test. * rust/alloc/alloc/src/collections/vec_deque/drain.rs: New test. * rust/alloc/alloc/src/collections/vec_deque/tests.rs: New test. * rust/alloc/alloc/src/fmt.rs: New test. * rust/alloc/alloc/src/lib.rs: New test. * rust/alloc/alloc/src/macros.rs: New test. * rust/alloc/alloc/src/prelude/mod.rs: New test. * rust/alloc/alloc/src/prelude/v1.rs: New test. * rust/alloc/alloc/src/raw_vec.rs: New test. * rust/alloc/alloc/src/raw_vec/tests.rs: New test. * rust/alloc/alloc/src/rc.rs: New test. * rust/alloc/alloc/src/rc/tests.rs: New test. * rust/alloc/alloc/src/slice.rs: New test. * rust/alloc/alloc/src/str.rs: New test. * rust/alloc/alloc/src/string.rs: New test. * rust/alloc/alloc/src/sync.rs: New test. * rust/alloc/alloc/src/sync/tests.rs: New test. * rust/alloc/alloc/src/task.rs: New test. * rust/alloc/alloc/src/tests.rs: New test. * rust/alloc/alloc/src/vec.rs: New test. * rust/alloc/core.rs: New test. * rust/alloc/prelude.rs: New test. Signed-off-by: Enes Cevik <enes@nsvke.com>
nsvke
marked this pull request as ready for review
August 16, 2026 08:13
Contributor
Author
P-E-P
reviewed
Aug 21, 2026
| $srcdir/$subdir/alloc/* \ | ||
| ]] | ||
|
|
||
| dg-runtest $srcdir/$subdir/alloc/src/lib.rs "-frust-edition=2015 -frust-crate=alloc -frust-compile-until=nameresolution -frust-cfg=target_has_atomic=\"ptr\" -w" "" |
Member
There was a problem hiding this comment.
Shouldn't we compile this using edition 2018 ?
Contributor
Author
There was a problem hiding this comment.
yes but the 2018 edition causes unexpected errors. I'll handle this, but I don't have time right now. I am temporarily using 2015 to protect it from regressions.
P-E-P
approved these changes
Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds the
alloccrate to the testsuite. A few temporary source-level workarounds were required to bypass current compiler limitations.Currently, the entire crate successfully compiles until the name resolution phase