Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuple index not parsed correctly #2659

Closed
P-E-P opened this issue Oct 6, 2023 · 2 comments · Fixed by #2694
Closed

Tuple index not parsed correctly #2659

P-E-P opened this issue Oct 6, 2023 · 2 comments · Fixed by #2694
Assignees

Comments

@P-E-P
Copy link
Member

P-E-P commented Oct 6, 2023

GCCRS finds a float literal instead of a tuple index

I tried this code:

fn main () {
    (1, (2, 3)).1.1;
}

I expected to see this happen: Code compiles

Instead, this happened:

./test.rs:2:16: error: failed to parse path expr segment of method call expr
    2 |     (1, (2, 3)).1.1;
      |                ^
./test.rs:2:5: error: failed to parse statement or expression in block expression
    2 |     (1, (2, 3)).1.1;
      |     ^
./test.rs:2:17: error: unrecognised token ‘float literal’ for start of item
    2 |     (1, (2, 3)).1.1;
      |                 ^~~
./test.rs:2:17: error: failed to parse item in crate

Meta

@P-E-P P-E-P added the bug label Oct 6, 2023
@P-E-P P-E-P added this to the GCC 14.1 release milestone Oct 6, 2023
@P-E-P P-E-P added the parser label Oct 6, 2023
@powerboat9
Copy link
Contributor

It looks like this produced a similar error with rustc before 1.46

@P-E-P P-E-P self-assigned this Oct 16, 2023
@P-E-P
Copy link
Member Author

P-E-P commented Oct 16, 2023

It looks like this produced a similar error with rustc before 1.46

This was fixed in rust-lang/rust#71322. Thanks for telling me @powerboat9
Like the rustc team before me I was wondering whether we should split it like with << tokens or handle it in the lexer. You saved me a lot of time.

P-E-P added a commit to P-E-P/gccrs that referenced this issue Oct 17, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
P-E-P added a commit to P-E-P/gccrs that referenced this issue Oct 17, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
P-E-P added a commit to P-E-P/gccrs that referenced this issue Oct 17, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
P-E-P added a commit to P-E-P/gccrs that referenced this issue Oct 23, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
github-merge-queue bot pushed a commit that referenced this issue Nov 6, 2023
Add a new regression test in order to highlight the fix for #2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Nov 15, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Nov 21, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Nov 21, 2023
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 5, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 8, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 9, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 11, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 11, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 12, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 16, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 16, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Jan 17, 2024
Add a new regression test in order to highlight the fix for Rust-GCC#2659.

gcc/testsuite/ChangeLog:

	* rust/compile/not_a_float_literal_tuple_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants