-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
decl_macro. no field 0
on type. a field with a similar name exists: 0
#116334
Comments
0
on type. a field with a similar name exists: 0
. 0
on type. a field with a similar name exists: 0
Methods don't work either. |
This works as intended, this is macro hygiene at play. The tuple field Typically if you'd like to make such an identifier accessible, you'd turn it into a parameter like To elaborate, the (implicit) identifier |
If you're fine with changing your tuple struct to a normal struct, then you can fix your code like this: Playground. Alternatively, you can turn the macro 2.0 into a |
Let's leave this open since the diagnostic could be improved. |
…, r=compiler-errors Diagnostics: Be more careful when suggesting struct fields Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function. Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts. Fixes rust-lang#116334.
…, r=compiler-errors Diagnostics: Be more careful when suggesting struct fields Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function. Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts. Fixes rust-lang#116334.
Rollup merge of rust-lang#116429 - fmease:clean-up-struct-field-suggs, r=compiler-errors Diagnostics: Be more careful when suggesting struct fields Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function. Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts. Fixes rust-lang#116334.
I tried this code:
https://github.com/planetoryd/rust_bug_missing_field
The equivalent code without macro works.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: