From: Arthur Cohen <[email protected]>
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Push extra
parentheses
when dumping AttrInputMetaItemContainer.
gcc/testsuite/ChangeLog:
* rust/minicore/cfg_nested.rs: New test.
* rust/minicore/cfg_nested_core/lib.rs: New test.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/b2a111f885ca84653ee567e4ca02e47d1bfb381f
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/5121
gcc/rust/ast/rust-ast-collector.cc | 6 +++---
gcc/testsuite/rust/minicore/cfg_nested.rs | 4 ++++
gcc/testsuite/rust/minicore/cfg_nested_core/lib.rs | 7 +++++++
3 files changed, 14 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/rust/minicore/cfg_nested.rs
create mode 100644 gcc/testsuite/rust/minicore/cfg_nested_core/lib.rs
diff --git a/gcc/rust/ast/rust-ast-collector.cc
b/gcc/rust/ast/rust-ast-collector.cc
index 9ee48b27d..cada1fc78 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -464,10 +464,10 @@ TokenCollector::visit (AttrInputMetaItemContainer
&container)
{
describe_node (std::string ("AttrInputMetaItemContainer"),
[this, &container] () {
+ push (Rust::Token::make (LEFT_PAREN, UNDEF_LOCATION));
for (auto &item : container.get_items ())
- {
- visit (item);
- }
+ visit (item);
+ push (Rust::Token::make (RIGHT_PAREN, UNDEF_LOCATION));
});
}
diff --git a/gcc/testsuite/rust/minicore/cfg_nested.rs
b/gcc/testsuite/rust/minicore/cfg_nested.rs
new file mode 100644
index 000000000..22c715d79
--- /dev/null
+++ b/gcc/testsuite/rust/minicore/cfg_nested.rs
@@ -0,0 +1,4 @@
+#![feature(no_std)]
+#![no_std]
+
+use core::{ifoo, ufoo};
diff --git a/gcc/testsuite/rust/minicore/cfg_nested_core/lib.rs
b/gcc/testsuite/rust/minicore/cfg_nested_core/lib.rs
new file mode 100644
index 000000000..06538b18a
--- /dev/null
+++ b/gcc/testsuite/rust/minicore/cfg_nested_core/lib.rs
@@ -0,0 +1,7 @@
+#![feature(no_core)]
+#![no_core]
+
+#[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))]
+pub type ifoo = i64;
+#[cfg(any(target_pointer_width = "64", target_pointer_width = "32"))]
+pub type ufoo = u64;
base-commit: 0d49300b4c78653250aa49fd00cee47e5ac285d3
--
2.56.1