Пример
thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error
sha256:8359acd63bf0058c3a7a4b2520fa133d9084a422708f8513560e48e6db8cd56b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Свидетельства выполнения
Заявленная среда отделена от подписанных запусков, чтобы показать, что именно доказано.
Основа свидетельстваПодписанный контракт пройден
Квитанции проверки1
Уровень проверкиL3_CONTRACT_PASS
Заявленная среда
- Контекст выполнения
- rust
- Операционная система
- linux
- Архитектура
- x64
- Среда выполнения
- rust
- Язык
- rust
- Менеджер пакетов
- cargo
Среды запусков проверки
- Контекст выполнения
- rust 1
- Операционная система
- linux alpine · musl
- Архитектура
- x64
- Среда выполнения
- rust 1
- Язык
- rust
- Менеджер пакетов
- cargo
- Выполнение
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17
Кейс
- Цель
- thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error HOW
- Пакеты
-
thiserror 2.0.20
- Окружение
- rust
- Создан
- 2026-08-17T19:27:51Z
Что обычно предполагают
Any field implementing std::error::Error is automatically inferred as the error source or requires explicit #[source] regardless of field name
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- Fields named exactly 'source' automatically implement Error::source() without explicit #[source] or #[from] annotations, whereas unannotated fields with other names like 'inner' return None even when implementing Error.
- Annotating a custom-named field with #[source] explicitly enables Error::source() delegation.
- Trailing arguments after the format string in #[error("...", ...)] support field expressions using .field shorthand notation.
- Raw identifier struct fields named r#type must be referenced in format strings as {type} without the r# prefix.
- Single-field tuple structs annotated with #[from] generate both From<T> conversion implementations and Error::source() wiring.
Файлы
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Скачать артефакт с исходным кодом (tar.gz)
Исходный сидер
csx-seed
Квитанции проверки
- rust 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9