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

Properly implement builtin#offset_of #16872

Open
Veykril opened this issue Mar 18, 2024 · 2 comments
Open

Properly implement builtin#offset_of #16872

Veykril opened this issue Mar 18, 2024 · 2 comments
Labels
A-ide general IDE features A-parser parser issues C-feature Category: feature request

Comments

@Veykril
Copy link
Member

Veykril commented Mar 18, 2024

We already have the rough parts implemented, but our parse seems to be wrong and the IDE layer needs some help figuring out the syntax as stuff like std::mem::offset_of!(Option<&u8>, Some.0);/builtin#offset_of(Option<&u8>, Some.0); currently errors with parse errors and Some being unresolved.

The macro for this stabilizes in 3 days so

@Veykril Veykril added A-parser parser issues C-feature Category: feature request A-ide general IDE features labels Mar 18, 2024
@DropDemBits
Copy link
Contributor

I believe only single-field offset_of is being stabilized and not nested fields (rust-lang/rust#120140
) nor for enum variants (rust-lang/rust#120141), so I don't think we need to worry as much for those cases.

I don't know about the parsing & resolution situation for the single-field offset_of, but I'm hoping it's in a better place than the other two?

@Veykril
Copy link
Member Author

Veykril commented Mar 20, 2024

The field in builtin #offset_of(Struct, field) also doesn't resolve on the IDE layer since we need to special case the handling for such a syntax node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features A-parser parser issues C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants