#[non_exhaustive]pub enum CodeGenWarning {
#[non_exhaustive] IdiomaticAliasesSuppressed {
enum_name: String,
conflicts: Vec<AliasConflict>,
invalid: Vec<String>,
},
#[non_exhaustive] OwnedViewAccessorSuppressed {
wrapper_name: String,
field_name: String,
},
#[non_exhaustive] LazyViewsRequireViews,
#[non_exhaustive] IdiomaticFieldNamesAdjusted {
message_name: String,
assignments: Vec<(String, String)>,
},
#[non_exhaustive] FeatureOverrideMatchedNothing {
rule: String,
feature: &'static str,
value: &'static str,
},
}Expand description
A non-fatal diagnostic produced during code generation.
Returned by generate_with_diagnostics. Render the human-readable form via
the Display impl (e.g. cargo:warning={warning}), or
match on the variant for programmatic handling. The enum and its variants are
#[non_exhaustive] so new diagnostic kinds and fields can be added without a
breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]IdiomaticAliasesSuppressed
Idiomatic CamelCase aliases were suppressed for an enum because two or
more proto values collide after conversion, or a value would convert to
an invalid identifier. The enum’s SHOUTY_SNAKE_CASE variants are
unaffected.
Fields
This variant is marked as non-exhaustive
conflicts: Vec<AliasConflict>Each collision, by target identifier. Empty if the only problem was invalid identifiers.
#[non_exhaustive]OwnedViewAccessorSuppressed
A field or oneof accessor on a generated FooOwnedView wrapper was
suppressed because the proto name collides with one of the wrapper’s
reserved method names (decode, view, bytes, …). The field stays
fully accessible through view() on the wrapper (or
OwnedView::reborrow).
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]LazyViewsRequireViews
lazy_views was requested with generate_views disabled; the lazy
family reuses the eager view-oneof enums and eager sub-view types, so
no lazy views were generated. Emitted once per generation run.
#[non_exhaustive]IdiomaticFieldNamesAdjusted
idiomatic_field_names found two or more members of one message whose
snake_case conversions collide, and adjusted the affected Rust names
deterministically (_f<number> suffix for fields, verbatim fallback
for oneofs — see CodeGenConfig::idiomatic_field_names). Wire,
JSON, and text-format names are unaffected.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]FeatureOverrideMatchedNothing
A feature_overrides rule matched
nothing the override targets in the compiled descriptor set, so it
changed nothing. Usually a typo, a missing nested-message segment, or
a stale path after a proto rename — the affected paths silently keep
their default semantics.
Fields
This variant is marked as non-exhaustive
Trait Implementations§
Source§impl Clone for CodeGenWarning
impl Clone for CodeGenWarning
Source§fn clone(&self) -> CodeGenWarning
fn clone(&self) -> CodeGenWarning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more