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

[glsl-in] Implement swizzle for r-values #213

Merged
merged 4 commits into from
Sep 25, 2020

Conversation

pjoe
Copy link
Collaborator

@pjoe pjoe commented Sep 24, 2020

Related to #210

meta: TokenMetadata,
) -> Result<Handle<Expression>, ErrorKind> {
let type_inner = self.resolve_type(expression)?;
match type_inner {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's match on the value always, i.e. match *self.resolve_type(expression)? {..}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, except borrow checker wouldn't let me deref with * (something about unable to move out of shared ref), so had to settle for match self.resolve_type(expression)? {..}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of borrowing by value is that it lets you see which things are borrowed, and which not.
So, you see that the borrow checker complains about members field being moved out? Mark it as ref members.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh, maybe one day I will learn to actually listen to what the borrow checker tells me :)

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kvark kvark merged commit df98342 into gfx-rs:master Sep 25, 2020
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