Skip to content

Commit 640af4c

Browse files
emersonfordfacebook-github-bot
authored andcommitted
make the module containing mock fields pub so it shows up in rustdocs
Summary: the rustdocs for mocks can be a bit confusing because there's no documentation for any of the individual mock fields. this is because the module in which the mock field objects are defined is private. to expose them in rustdoc, just `pub` that module. each of the mock field objects have private fields, so downstream crates will still be unable to instantiate these mock fields on their own (and this makes `unimplemented` `pub(crate)` to ensure that as well). the link to some mock fields is still broken, e.g. `FacebookService`, but that's because of rust-lang/docs.rs#1588 (comment). Reviewed By: thepacketgeek Differential Revision: D45406779 fbshipit-source-id: 91f14ef2e022857969540c82d2482e81bda1421c
1 parent 9ece35c commit 640af4c

File tree

18 files changed

+104
-104
lines changed
  • third-party/thrift/src/thrift/compiler

18 files changed

+104
-104
lines changed

third-party/thrift/src/thrift/compiler/generate/templates/rust/lib/mod.mock.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111

112112
{{/service:extendedServices}}{{!
113113
}}{{/program:services}}
114-
mod r#impl {{>lib/block}}{{!
114+
pub mod r#impl {{>lib/block}}{{!
115115
}}{{#program:services}}
116116
pub mod {{service:snake}} {{>lib/block}}{{!
117117
@@ -134,7 +134,7 @@
134134

135135
#[allow(clippy::redundant_closure)]
136136
impl<'mock> {{function:rust_name}}<'mock> {
137-
pub fn unimplemented() -> Self {
137+
pub(crate) fn unimplemented() -> Self {
138138
Self {
139139
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|{{!
140140
}}{{#function:args}}{{!

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/gen-rust/lib.rs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/gen-rust/lib.rs

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/thrift/src/thrift/compiler/test/fixtures/basic/gen-rust/lib.rs

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/thrift/src/thrift/compiler/test/fixtures/doctext/gen-rust/lib.rs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/thrift/src/thrift/compiler/test/fixtures/exceptions/gen-rust/lib.rs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)