diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-12-09 01:22:02 -0500 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-30 12:36:49 +0100 |
commit | bdbc24c36cad3dc26324c4d5ea38f8bd0f02c9a8 (patch) | |
tree | e146c2d382a684f6eaac96273f52a1ffe656dd97 | |
parent | d7b2d6704f3350917b16f454163927e4c823802b (diff) | |
download | gcc-bdbc24c36cad3dc26324c4d5ea38f8bd0f02c9a8.zip gcc-bdbc24c36cad3dc26324c4d5ea38f8bd0f02c9a8.tar.gz gcc-bdbc24c36cad3dc26324c4d5ea38f8bd0f02c9a8.tar.bz2 |
gccrs: Allow enabling lang_items and no_core features
gcc/rust/ChangeLog:
* checks/errors/rust-feature.cc
(Feature::name_hash_map):
Add entries for Name::LANG_ITEMS and Name::NO_CORE.
* checks/errors/rust-feature.h
(Feature::Name::LANG_ITEMS): New.
(Feature::Name::NO_CORE): New.
gcc/testsuite/ChangeLog:
* rust/compile/sized-stub.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
-rw-r--r-- | gcc/rust/checks/errors/rust-feature.cc | 2 | ||||
-rw-r--r-- | gcc/rust/checks/errors/rust-feature.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/sized-stub.rs | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/checks/errors/rust-feature.cc b/gcc/rust/checks/errors/rust-feature.cc index 88649f1..c12710a 100644 --- a/gcc/rust/checks/errors/rust-feature.cc +++ b/gcc/rust/checks/errors/rust-feature.cc @@ -56,6 +56,8 @@ const std::map<std::string, Feature::Name> Feature::name_hash_map = { // later Rust versions {"optin_builtin_traits", Feature::Name::AUTO_TRAITS}, {"extern_types", Feature::Name::EXTERN_TYPES}, + {"lang_items", Feature::Name::LANG_ITEMS}, + {"no_core", Feature::Name::NO_CORE}, }; // namespace Rust tl::optional<Feature::Name> diff --git a/gcc/rust/checks/errors/rust-feature.h b/gcc/rust/checks/errors/rust-feature.h index 4ff059c..e6bc236 100644 --- a/gcc/rust/checks/errors/rust-feature.h +++ b/gcc/rust/checks/errors/rust-feature.h @@ -43,6 +43,8 @@ public: DECL_MACRO, AUTO_TRAITS, EXTERN_TYPES, + LANG_ITEMS, + NO_CORE, }; const std::string &as_string () { return m_name_str; } diff --git a/gcc/testsuite/rust/compile/sized-stub.rs b/gcc/testsuite/rust/compile/sized-stub.rs new file mode 100644 index 0000000..4e89b1f --- /dev/null +++ b/gcc/testsuite/rust/compile/sized-stub.rs @@ -0,0 +1,6 @@ +#![feature(lang_items)] +#![feature(no_core)] +#![no_core] + +#[lang = "sized"] +trait Sized {} |