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

Handle remote type written without turbofish #2328

Merged
merged 3 commits into from
Nov 28, 2022
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 28, 2022

The following already works, almost certainly by accident, but in any case we can't break it:

struct Generic<T> {
    value: T,
}

#[derive(Serialize, Deserialize)]
#[serde(remote = "Generic::<u8>")]
struct Concrete {
    value: u8,
}

However the turbofish in the remote attribute should not be necessary, since conceptually the attribute is being used to refer to a type, not an expression. This PR makes the attribute work as serde(remote = "Generic<u8>").

Related to #2327.

@dtolnay dtolnay merged commit 4ea403c into serde-rs:master Nov 28, 2022
@dtolnay dtolnay deleted the remote branch November 28, 2022 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant