File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ pub trait Can {
66 type Frame : crate :: Frame ;
77
88 /// Associated error type.
9+ #[ cfg( feature = "defmt" ) ]
10+ type Error : crate :: Error + defmt:: Format ;
11+ /// Associated error type.
12+ #[ cfg( not( feature = "defmt" ) ) ]
913 type Error : crate :: Error ;
1014
1115 /// Puts a frame in the transmit buffer. Blocks until space is available in
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ pub trait Can {
66 type Frame : crate :: Frame ;
77
88 /// Associated error type.
9+ #[ cfg( feature = "defmt" ) ]
10+ type Error : crate :: Error + defmt:: Format ;
11+ /// Associated error type.
12+ #[ cfg( not( feature = "defmt" ) ) ]
913 type Error : crate :: Error ;
1014
1115 /// Puts a frame in the transmit buffer to be sent on the bus.
Original file line number Diff line number Diff line change @@ -59,7 +59,11 @@ impl core::fmt::Display for ErrorKind {
5959///
6060/// This just defines the error type, to be used by the other traits.
6161pub trait ErrorType {
62- /// Error type
62+ /// Error type.
63+ #[ cfg( feature = "defmt-03" ) ]
64+ type Error : Error + defmt:: Format ;
65+ /// Error type.
66+ #[ cfg( not( feature = "defmt-03" ) ) ]
6367 type Error : Error ;
6468}
6569
Original file line number Diff line number Diff line change @@ -265,7 +265,11 @@ impl core::fmt::Display for NoAcknowledgeSource {
265265///
266266/// This just defines the error type, to be used by the other traits.
267267pub trait ErrorType {
268- /// Error type
268+ /// Error type.
269+ #[ cfg( feature = "defmt-03" ) ]
270+ type Error : Error + defmt:: Format ;
271+ /// Error type.
272+ #[ cfg( not( feature = "defmt-03" ) ) ]
269273 type Error : Error ;
270274}
271275
Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ impl core::fmt::Display for ErrorKind {
5858///
5959/// This just defines the error type, to be used by the other traits.
6060pub trait ErrorType {
61- /// Error type
61+ /// Error type.
62+ #[ cfg( feature = "defmt-03" ) ]
63+ type Error : Error + defmt:: Format ;
64+ /// Error type.
65+ #[ cfg( not( feature = "defmt-03" ) ) ]
6266 type Error : Error ;
6367}
6468
Original file line number Diff line number Diff line change @@ -307,6 +307,10 @@ impl core::fmt::Display for ErrorKind {
307307/// This just defines the error type, to be used by the other SPI traits.
308308pub trait ErrorType {
309309 /// Error type.
310+ #[ cfg( feature = "defmt-03" ) ]
311+ type Error : Error + defmt:: Format ;
312+ /// Error type.
313+ #[ cfg( not( feature = "defmt-03" ) ) ]
310314 type Error : Error ;
311315}
312316
Original file line number Diff line number Diff line change @@ -218,6 +218,10 @@ impl Error for std::io::Error {
218218/// which might be different types.
219219pub trait ErrorType {
220220 /// Error type of all the IO operations on this type.
221+ #[ cfg( feature = "defmt" ) ]
222+ type Error : Error + defmt:: Format ;
223+ /// Error type of all the IO operations on this type.
224+ #[ cfg( not( feature = "defmt" ) ) ]
221225 type Error : Error ;
222226}
223227
You can’t perform that action at this time.
0 commit comments