Skip to content

Commit

Permalink
Work around Rust error message bug
Browse files Browse the repository at this point in the history
Summary: Without this line, Rust error messages involving types from Serde get associated with a somewhat surprising/misleading trait path. This is a compiler bug (rust-lang/rust#46991) but it's easy to work around here.

Reviewed By: yfeldblum

Differential Revision: D23326186

fbshipit-source-id: 0bb2c3e905a6545dd8abc8f0746c7bce838272c1
  • Loading branch information
David Tolnay authored and facebook-github-bot committed Aug 25, 2020
1 parent 9ea1c4a commit a85bcb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thrift/compiler/generate/templates/rust/lib.rs.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies)]

{{#program:serde?}}
{{! work around https://github.com/rust-lang/rust/issues/46991 }}
extern crate serde;
{{/program:serde?}}
{{#program:constants?}}
pub use self::consts::*;
{{/program:constants?}}
Expand Down

0 comments on commit a85bcb4

Please sign in to comment.