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

Make Expr::MethodCall available in non-"full" mode #1564

Merged
merged 1 commit into from
Dec 31, 2023
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Dec 31, 2023

This appears in derive input in the case of const associated functions.

#[derive(Derive)]
pub enum E {
    V = CONFIG.compute_thing(),
}

struct Config { ... }

const CONFIG: Config = Config { ... };

impl Config {
    const fn compute_thing(&self) -> isize { ... }
}

Previously with syn in non-"full" mode, a method call expression such as CONFIG.compute_thing() would parse incorrectly as Expr::Call containing Expr::Field as the called function, rather than Expr::MethodCall containing Expr::Path as the receiver.

@dtolnay dtolnay merged commit 6c115ed into master Dec 31, 2023
28 checks passed
@dtolnay dtolnay deleted the methodcall branch December 31, 2023 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant