From c64f1f22b3d344676dd15b8b793539922269e21a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Fri, 29 Mar 2024 20:09:06 +0200 Subject: [PATCH] prost-build: document CodeGenerator::boxed --- prost-build/src/code_generator.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prost-build/src/code_generator.rs b/prost-build/src/code_generator.rs index 1ab19ee41..e037d8e47 100644 --- a/prost-build/src/code_generator.rs +++ b/prost-build/src/code_generator.rs @@ -1016,6 +1016,11 @@ impl<'a> CodeGenerator<'a> { } } + /// Returns whether the Rust type for this field needs to be `Box<_>`. + /// + /// This can be explicitly configured with `Config::boxed`, or necessary + /// to prevent an infinitely sized type definition in case when the type of + /// a non-repeated message field transitively contains the message itself. fn boxed( &self, field: &FieldDescriptorProto,