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

Use PointerMutability inside Type::Ptr #1750

Open
dtolnay opened this issue Oct 19, 2024 · 0 comments
Open

Use PointerMutability inside Type::Ptr #1750

dtolnay opened this issue Oct 19, 2024 · 0 comments

Comments

@dtolnay
Copy link
Owner

dtolnay commented Oct 19, 2024

Currently, Expr::RawAddr is represented using PointerMutability enum:

syn/src/expr.rs

Lines 583 to 589 in da478ac

pub struct ExprRawAddr #full {
pub attrs: Vec<Attribute>,
pub and_token: Token![&],
pub raw: Token![raw],
pub mutability: PointerMutability,
pub expr: Box<Expr>,
}

whereas Type::Ptr is represented using separate Option<Token![const]> and Option<Token![mut]> fields.

syn/src/ty.rs

Lines 183 to 188 in da478ac

pub struct TypePtr {
pub star_token: Token![*],
pub const_token: Option<Token![const]>,
pub mutability: Option<Token![mut]>,
pub elem: Box<Type>,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant