Skip to content
Myr

Add must_use to Error constructors

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 06826d1 · Browse files · 1 file+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:src/error.rs+3 added
24 unmodified lines
25 /// created here to ensure that a backtrace exists.26 #[cfg(feature = "std")]27 #[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]28 #[cold]29 #[must_use]30 pub fn new<E>(error: E) -> Self31 where32 E: StdError + Send + Sync + 'static,33 {
38 unmodified lines
72 /// .await73 /// }74 /// ```75 #[cold]76 #[must_use]77 pub fn msg<M>(message: M) -> Self78 where79 M: Display + Debug + Send + Sync + 'static,80 {
213 unmodified lines
294 /// })295 /// }296 /// ```297 #[cold]298 #[must_use]299 pub fn context<C>(self, context: C) -> Self300 where301 C: Display + Send + Sync + 'static,302 {
668 unmodified lines