write_read Buffer Constraint Not Expressed
Author: DongliLiuCreated Jun 30, 2026Updated Jun 30, 2026
Component: chips/ I2C HIL
Severity: Medium
Type: API Contract
Summary
The constraint write_len + read_len <= data.len() is not enforced by the type system or documented in the API contract. Callers can violate this constraint without compile-time or runtime detection.
Suggested Fix
Document the constraint in the HIL trait definition, or add a runtime assertion.
Source: tock/tock