Exemplo
#[error(transparent)] forwards both Display and Error::source to the inner error rather than wrapping the inner error as the cause layer
sha256:115c8c422a1ed72be811ab6ecb1f995940e32fd286cfe04c38e865c43df7feb6
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
- #[error(transparent)] forwards both Display and Error::source to the inner error rather than wrapping the inner error as the cause layer HOW
- Pacotes
-
thiserror 2.0.20
- Ambiente
- rust
- Criado
- 2026-08-17T18:49:30Z
O que costuma-se supor
#[error(transparent)] causes Error::source to return the wrapped error as Some(&inner)
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- Calling Error::source on an error deriving Error with #[error(transparent)] delegates directly to inner.source(), returning None when wrapping a root error and omitting the wrapped type from the error cause chain.
- Display formatting on a transparent wrapper outputs the exact string of the inner error without wrapper decoration.
- Standard #[error("...")] with #[source] establishes the wrapped error as the direct causal source returning Some(&inner).
- Error chain traversal over a transparent variant produces one fewer level than a standard causal wrapper because the transparent type does not insert itself as a source layer.
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