Opened 5 months ago

Last modified 11 days ago

#25628 new enhancement

Document our Rust coding standards for error/failure types

Reported by: isis Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: rust, tor-doc, 034-triage-20180328, 034-removed-20180328
Cc: chelseakomlo Actual Points:
Parent ID: Points:
Reviewer: Sponsor: Sponsor8-can

Description (last modified by chelseakomlo)

Every crate which returns Result<T, E>s or Option<T> anywhere in its public interface should have an errors.rs module containing error types which implement either Display or Debug. See the errors.rs addition to the protover crate from #24031 for an example.

In the future, when failure is 1.0.0, we should also require ::failure::Fail for making errors easier to work with between crates.

Child Tickets

Change History (5)

comment:1 Changed 5 months ago by nickm

Keywords: 034-triage-20180328 added

comment:2 Changed 5 months ago by nickm

Keywords: 034-removed-20180328 added

Per our triage process, these tickets are pending removal from 0.3.4.

comment:3 Changed 4 months ago by nickm

Milestone: Tor: 0.3.4.x-finalTor: unspecified

These tickets, tagged with 034-removed-*, are no longer in-scope for 0.3.4. We can reconsider any of them, if time permits.

comment:4 in reply to:  description Changed 11 days ago by cypherpunks3

Replying to isis:

(doesn't have the ::failure::Fail impl yet, because the failure crate is about to become 1.0.0 any day now).

Not anymore it's not. See also #26337.

comment:5 Changed 11 days ago by chelseakomlo

Description: modified (diff)

Edited ticket description to note that documenting the requirement of ::failure::Fail for failure types will be a separate task once the failure crate reaches stability. See #26337 for more information.

Note: See TracTickets for help on using tickets.