Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

## [Unreleased]

### Changed

- **`HasMessageView` carries a `#[diagnostic::on_unimplemented]` hint.** When a
type is used where the generated view family is required but its crate was
generated without one (buffa older than 0.7.0, or views disabled) or has it
behind a disabled feature, the compile error now explains the cause and how
to fix it — regenerate the defining crate with buffa ≥ 0.7.0 and views
enabled (`generate_views(true)` / `views=true`), or enable the crate's views
feature — instead of only naming the missing trait bound. Downstream
consumers such as connect-rust rely on this trait for their request
wrappers, so the notes land directly in the consumer's build output.

## [0.7.0] - 2026-05-28

This release is a minor bump under the
Expand Down
9 changes: 9 additions & 0 deletions buffa/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ pub trait ViewReborrow: MessageView<'static> {
/// Implementations are generated alongside the view and owned-view wrapper
/// (and are therefore gated with them). Hand-written implementations are only
/// needed for hand-written view types and must follow the same shape.
#[diagnostic::on_unimplemented(
message = "`{Self}` does not implement `HasMessageView` — its message-view family was not generated or is not enabled",
note = "the `HasMessageView` impl is emitted next to each message's view types: \
regenerate the crate that defines `{Self}` with buffa 0.7.0 or newer and \
views enabled — `generate_views(true)` (on by default) in a buffa-build / \
buffa-codegen config, or `views=true` for protoc-gen-buffa",
note = "if the defining crate feature-gates its generated impls, enabling its views \
feature is enough — no regeneration needed"
)]
pub trait HasMessageView: crate::Message + Sized {
/// The zero-copy view of `Self`, borrowing from a buffer with lifetime
/// `'a`.
Expand Down
Loading