diff --git a/thrift/compiler/generate/templates/rust/lib/errors.mustache b/thrift/compiler/generate/templates/rust/lib/errors.mustache index 9aee9a2b37b..a9f5862838b 100644 --- a/thrift/compiler/generate/templates/rust/lib/errors.mustache +++ b/thrift/compiler/generate/templates/rust/lib/errors.mustache @@ -50,7 +50,7 @@ pub mod {{service:snake}} { {{#function:exceptions}} {{field:rust_name}}({{#field:type}}{{>lib/type}}{{/field:type}}), {{/function:exceptions}} - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -206,7 +206,7 @@ pub mod {{service:snake}} { {{#function:stream_exceptions}} {{field:rust_name}}({{#field:type}}{{>lib/type}}{{/field:type}}), {{/function:stream_exceptions}} - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/basic-annotations/gen-rust/errors.rs b/thrift/compiler/test/fixtures/basic-annotations/gen-rust/errors.rs index 40efb85f270..71d62e94756 100644 --- a/thrift/compiler/test/fixtures/basic-annotations/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/basic-annotations/gen-rust/errors.rs @@ -25,7 +25,7 @@ pub mod my_service { #[derive(Debug)] pub enum PingError { myExcept(crate::types::MyException), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/doctext/gen-rust/errors.rs b/thrift/compiler/test/fixtures/doctext/gen-rust/errors.rs index 09e23f61240..cb1963fef26 100644 --- a/thrift/compiler/test/fixtures/doctext/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/doctext/gen-rust/errors.rs @@ -90,7 +90,7 @@ pub mod c { #[derive(Debug)] pub enum ThingError { bang(crate::types::Bang), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/exceptions/gen-rust/errors.rs b/thrift/compiler/test/fixtures/exceptions/gen-rust/errors.rs index c196eac0e41..82a76504129 100644 --- a/thrift/compiler/test/fixtures/exceptions/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/exceptions/gen-rust/errors.rs @@ -82,7 +82,7 @@ pub mod raiser { b(crate::types::Banal), f(crate::types::Fiery), s(crate::types::Serious), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -255,7 +255,7 @@ pub mod raiser { f(crate::types::Fiery), b(crate::types::Banal), s(crate::types::Serious), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/interactions/gen-rust/errors.rs b/thrift/compiler/test/fixtures/interactions/gen-rust/errors.rs index 7c642259c02..b89a69c7f56 100644 --- a/thrift/compiler/test/fixtures/interactions/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/interactions/gen-rust/errors.rs @@ -25,7 +25,7 @@ pub mod my_interaction { #[derive(Debug)] pub enum FrobnicateError { ex(crate::types::CustomException), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/rust-annotations/gen-rust/errors.rs b/thrift/compiler/test/fixtures/rust-annotations/gen-rust/errors.rs index 833317f6d80..052578e53a7 100644 --- a/thrift/compiler/test/fixtures/rust-annotations/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/rust-annotations/gen-rust/errors.rs @@ -41,7 +41,7 @@ pub mod all_methods { #[derive(Debug)] pub enum BarError { se(crate::types::SomeError), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -178,7 +178,7 @@ pub mod one_method { #[derive(Debug)] pub enum BarError { se(crate::types::SomeError), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -315,7 +315,7 @@ pub mod one_method_opt_out { #[derive(Debug)] pub enum BarError { se(crate::types::SomeError), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/rust-request-context/gen-rust/errors.rs b/thrift/compiler/test/fixtures/rust-request-context/gen-rust/errors.rs index bcf0527e2ad..9feb642c831 100644 --- a/thrift/compiler/test/fixtures/rust-request-context/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/rust-request-context/gen-rust/errors.rs @@ -209,7 +209,7 @@ pub mod my_service { #[derive(Debug)] pub enum StreamByIdWithExceptionStreamError { e(crate::types::MyException), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/compiler/test/fixtures/stream/gen-rust/errors.rs b/thrift/compiler/test/fixtures/stream/gen-rust/errors.rs index 438d4665181..7b293313392 100644 --- a/thrift/compiler/test/fixtures/stream/gen-rust/errors.rs +++ b/thrift/compiler/test/fixtures/stream/gen-rust/errors.rs @@ -134,7 +134,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum StreamthrowsStreamError { e(crate::types::FooStreamEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -226,7 +226,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum ServicethrowsError { e(crate::types::FooEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -363,7 +363,7 @@ pub mod pub_sub_streaming_service { pub enum Servicethrows2Error { e1(crate::types::FooEx), e2(crate::types::FooEx2), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -528,7 +528,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum BoththrowsError { e(crate::types::FooEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -648,7 +648,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum BoththrowsStreamError { e(crate::types::FooStreamEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -773,7 +773,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum ResponseandstreamstreamthrowsStreamError { e(crate::types::FooStreamEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -865,7 +865,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum ResponseandstreamservicethrowsError { e(crate::types::FooEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -1001,7 +1001,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum ResponseandstreamboththrowsError { e(crate::types::FooEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } @@ -1121,7 +1121,7 @@ pub mod pub_sub_streaming_service { #[derive(Debug)] pub enum ResponseandstreamboththrowsStreamError { e(crate::types::FooStreamEx), - ApplicationException(::fbthrift::types::ApplicationException), + ApplicationException(::fbthrift::ApplicationException), ThriftError(::anyhow::Error), } diff --git a/thrift/lib/rust/src/lib.rs b/thrift/lib/rust/src/lib.rs index ebaafe9abde..30f4bac88be 100644 --- a/thrift/lib/rust/src/lib.rs +++ b/thrift/lib/rust/src/lib.rs @@ -67,12 +67,6 @@ mod tests; #[doc(hidden)] pub mod help; -pub mod types { - // Define ApplicationException as if it were a normal generated type to make things simpler - // for codegen. - pub use crate::application_exception::ApplicationException; -} - pub use crate::application_exception::ApplicationException; pub use crate::application_exception::ApplicationExceptionErrorCode; pub use crate::binary_protocol::BinaryProtocol;