Skip to content

Commit a85bcb4

Browse files
David Tolnayfacebook-github-bot
David Tolnay
authored andcommitted
Work around Rust error message bug
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
1 parent 9ea1c4a commit a85bcb4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

thrift/compiler/generate/templates/rust/lib.rs.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

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

22+
{{#program:serde?}}
23+
{{! work around https://github.com/rust-lang/rust/issues/46991 }}
24+
extern crate serde;
25+
{{/program:serde?}}
2226
{{#program:constants?}}
2327
pub use self::consts::*;
2428
{{/program:constants?}}

0 commit comments

Comments
 (0)