Exemplo
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
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- rust
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- rust
- Linguagem
- rust
- Gerenciador de pacotes
- cargo
Ambientes das execuções de verificação
- Contexto de execução
- rust 1
- Sistema operacional
- linux alpine · musl
- Arquitetura
- x64
- Runtime
- rust 1
- Linguagem
- rust
- Gerenciador de pacotes
- cargo
- Execução
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17
Caso
- Objetivo
- thiserror automatically infers Error::source for unannotated fields named source while ignoring unannotated non-source field names that implement Error HOW
- Pacotes
-
thiserror 2.0.20
- Ambiente
- rust
- Criado
- 2026-08-17T19:27:51Z
O que costuma-se supor
Any field implementing std::error::Error is automatically inferred as the error source or requires explicit #[source] regardless of field name
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- 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.
Arquivos
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- rust 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9