Commit eb4b2c6 1 parent 75b7e7a commit eb4b2c6 Copy full SHA for eb4b2c6
File tree 4 files changed +11
-15
lines changed
4 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -132,14 +132,10 @@ fn main() {
132
132
. compile_protos ( & [ src. join ( "proto3_presence.proto" ) ] , includes)
133
133
. unwrap ( ) ;
134
134
135
- {
136
- let mut config = prost_build:: Config :: new ( ) ;
137
- config. disable_comments ( [ "." ] ) ;
138
-
139
- config
140
- . compile_protos ( & [ src. join ( "invalid_doctest.proto" ) ] , includes)
141
- . unwrap ( ) ;
142
- }
135
+ prost_build:: Config :: new ( )
136
+ . disable_comments ( [ "." ] )
137
+ . compile_protos ( & [ src. join ( "disable_comments.proto" ) ] , includes)
138
+ . unwrap ( ) ;
143
139
144
140
config
145
141
. bytes ( [ "." ] )
Original file line number Diff line number Diff line change 1
1
syntax = "proto3" ;
2
2
3
- package invalid.doctest ;
3
+ package disable_comments ;
4
4
5
5
// ```
6
6
// invalid
Original file line number Diff line number Diff line change
1
+ //! MessageWithInvalidDoctest would generate a invalid doc test if
2
+ //! `Config::disable_comments` doesn't work correctly.
3
+ include ! ( concat!( env!( "OUT_DIR" ) , "/disable_comments.rs" ) ) ;
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ mod boxed_field;
59
59
#[ cfg( test) ]
60
60
mod custom_debug;
61
61
62
+ // Must be `pub` as doc tests are only executed on public types.
63
+ pub mod disable_comments;
64
+
62
65
mod test_enum_named_option_value {
63
66
include ! ( concat!( env!( "OUT_DIR" ) , "/myenum.optionn.rs" ) ) ;
64
67
}
@@ -126,12 +129,6 @@ pub mod proto3 {
126
129
}
127
130
}
128
131
129
- pub mod invalid {
130
- pub mod doctest {
131
- include ! ( concat!( env!( "OUT_DIR" ) , "/invalid.doctest.rs" ) ) ;
132
- }
133
- }
134
-
135
132
pub mod default_string_escape {
136
133
include ! ( concat!( env!( "OUT_DIR" ) , "/default_string_escape.rs" ) ) ;
137
134
}
You can’t perform that action at this time.
0 commit comments