testsuite: Add the alloc crate to the testsuite#4693
Draft
nsvke wants to merge 2 commits into
Draft
Conversation
These lang items and an attribute are currently registered as stubs only. This is a temporary patch. gcc/rust/ChangeLog: * checks/errors/rust-builtin-attribute-checker.cc (attribute_checking_handlers): Add rustc_conversion_suggestion attribute. * util/rust-attribute-values.h (class Attributes): Add RUSTC_CONVERSION_SUGGESTION constexpr. * util/rust-attributes.cc (__definitions): Add new BuiltinAttrDefinition for rustc_conversion_suggestion. * util/rust-lang-item.cc (Rust::LangItems::lang_items): Add missing lang items to BiMap. * util/rust-lang-item.h (class LangItem): Add missing lang items to enum class Kind. 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 unsupported #[rustfmt::skip] attribute in boxed.rs. - Comment out the `ForceResult` enum due to issue Rust-GCC#4687 in collections/btree/node.rs. - Add temporary `use` statements due to issue Rust-GCC#4689 in collections/btree/append.rs and collections/btree/map.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>
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. To achieve a clean compilation baseline, several lang items and an attribute had to be registered as temporary stubs. Additionally, a few temporary source-level workarounds were required to bypass current compiler limitations.Currently, the entire crate successfully compiles up to the name resolution phase using the
-frust-compile-until=nameresolutionflag.Please note that this is a Draft PR intended for review and feedback only. We will address the stubbed items and transition to proper implementations in subsequent iterations.