]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a regression test for decimal lexing
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 3 Aug 2023 13:52:51 +0000 (15:52 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:32 +0000 (19:00 +0100)
Issue #2514 fixed by the previous commit highlight a behavior we want to
avoid in the future, hence this regression test.

gcc/testsuite/ChangeLog:

* rust/compile/issue-2514.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/issue-2514.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-2514.rs b/gcc/testsuite/rust/compile/issue-2514.rs
new file mode 100644 (file)
index 0000000..05e106c
--- /dev/null
@@ -0,0 +1,14 @@
+struct First {
+    i: usize,
+}
+
+impl First {
+    pub fn e_function(mut self) {
+        self.i += 1;
+    }
+}
+
+pub fn main() {
+    let a = (First { i: 10 }, 2);
+    a.0.e_function();
+}