commit | e790073b3053e0ac6f39cedba721001df37ac1f1 | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Sun Nov 11 10:25:47 2018 -0800 |
committer | David Tolnay <dtolnay@gmail.com> | Sun Nov 11 10:25:47 2018 -0800 |
tree | eac80ea471d863d25490989059ccf395e38b9204 | |
parent | 8865861e5f91ee98a09aa6874926b8f60141ee0c [diff] [blame] |
Document thread behavior of error spans
diff --git a/src/error.rs b/src/error.rs index 12be03e..32adb44 100644 --- a/src/error.rs +++ b/src/error.rs
@@ -84,6 +84,11 @@ } } + /// The source location of the error. + /// + /// Spans are not thread-safe so this function returns `Span::call_site()` + /// if called from a different thread than the one on which the `Error` was + /// originally created. pub fn span(&self) -> Span { match self.span.get() { Some(span) => *span,