We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#[derive(Deserialize)] #[serde(deny_unknown_fields)] pub struct Config { }
The generated code (cleaned up) looks like:
impl Deserialize for Config { fn deserialize<D>(deserializer: &mut D) -> Result<Config, D::Error> where D: Deserializer { enum Field {} impl Deserialize for Field { /* ... */ } struct Visitor<D: Deserializer>(PhantomData<D>); impl<D: Deserializer> Visitor for Visitor<D> { type Value = Config; fn visit_seq<V>(&mut self, mut visitor: V) -> Result<Config, V::Error> where V: SeqVisitor { try!(visitor.end()); Ok(Config{}) } fn visit_map<V>(&mut self, mut visitor: V) -> Result<Config, V::Error> where V: MapVisitor { // ERROR: irrefutable while-let pattern while let Some(key) = try!(visitor.visit_key::<Field>()) { match key {} } try!(visitor.end()); Ok(Config{}) } } const FIELDS: &'static [&'static str] = &[]; deserializer.deserialize_struct("Config", FIELDS, Visitor::<D>(PhantomData)) } }
This is an error on Rust 1.16. We need to omit the Field enum and the while loop in the empty braced struct case.
The text was updated successfully, but these errors were encountered:
dtolnay
No branches or pull requests
The generated code (cleaned up) looks like:
This is an error on Rust 1.16. We need to omit the Field enum and the while loop in the empty braced struct case.
The text was updated successfully, but these errors were encountered: