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 indices are handled with their shorthand #2695

Open
P-E-P opened this issue Oct 17, 2023 · 0 comments
Open

Tuple indices are handled with their shorthand #2695

P-E-P opened this issue Oct 17, 2023 · 0 comments
Assignees
Labels

Comments

@P-E-P
Copy link
Member

P-E-P commented Oct 17, 2023

Using index 0001 on an tuple should emit an error

I tried this code:

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

I expected to see this happen: Emit an error.

error[E0609]: no field `0001` on type `Toto`
 --> src/main.rs:7:18
  |
7 |     let _ = toto.0001.001;
  |                  ^^^^ unknown field

Instead, this happened: The 0001 is replaced by a single 1, all leading zeroes are discarded and the code compiles correctly.

Meta

This behavior has been highlighted by #2694

@P-E-P P-E-P added the bug label Oct 17, 2023
@P-E-P P-E-P added this to the GCC 14.1 release milestone Oct 17, 2023
@P-E-P P-E-P self-assigned this Oct 17, 2023
@CohenArthur CohenArthur removed this from the GCC 15.1 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants