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

Support assignment to FieldExpr for extract_assignment assist #7138

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

Jesse-Bakker
Copy link
Contributor

No description provided.

@Jesse-Bakker
Copy link
Contributor Author

@matklad I was thinking that it may be nicer to compare the paths with path.segment()?.name_ref()?.as_name(), but I'm not sure if that does what I want.

@Jesse-Bakker Jesse-Bakker force-pushed the extract-assignment-fields branch from e5f76f6 to 38d914a Compare January 3, 2021 13:38
@matklad
Copy link
Member

matklad commented Jan 3, 2021

@Jesse-Bakker I think that the right solution might be comparing sema.resolve_fields perhaps? But this will also have edge cases....

I think we need to extract

fn is_equivalent(sema: &Semantics, e1: &ast::Expr, e2: &ast::Expr) -> bool

and then tweak the impl as we go forward

@Jesse-Bakker Jesse-Bakker force-pushed the extract-assignment-fields branch 2 times, most recently from 79f26bb to 0477de9 Compare January 3, 2021 14:11
@Jesse-Bakker Jesse-Bakker force-pushed the extract-assignment-fields branch from 0477de9 to ba4c42a Compare January 3, 2021 14:47
@Jesse-Bakker Jesse-Bakker requested a review from matklad January 3, 2021 14:54
@matklad
Copy link
Member

matklad commented Jan 3, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 3, 2021

@bors bors bot merged commit 96ab76c into rust-lang:master Jan 3, 2021
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.

2 participants