This commit is contained in:
Robin Appelman 2020-12-02 00:39:41 +01:00
commit 6975a89b63

View file

@ -15,13 +15,16 @@ use thiserror::Error;
/// An error and related source span, will print out the problematic code fragment and error on `Display` /// An error and related source span, will print out the problematic code fragment and error on `Display`
/// ///
/// ## Example /// ## Example
/// . | ///
/// 2 | [ /// ```text
/// 3 | "broken" /// . |
/// 4 | "array" /// 2 | [
/// | ^^^^^^^^ Unexpected token, found LiteralString expected one of [SquareClose, Comma, Arrow] /// 3 | "broken"
/// 5 | ] /// 4 | "array"
/// 6 | /// | ^^^^^^^^ Unexpected token, found LiteralString expected one of [SquareClose, Comma, Arrow]
/// 5 | ]
/// 6 |
/// ```
/// ///
#[derive(Debug)] #[derive(Debug)]
pub struct SpannedError<'a, T: Error + Debug> { pub struct SpannedError<'a, T: Error + Debug> {