You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing strange behaviour when my SourceSpan has length 0 and the byte before the offset is a newline 🤔
Minimal reproducible example:
use miette::{Diagnostic,NamedSource,Result,SourceSpan};use thiserror::Error;#[derive(Error,Debug,Diagnostic)]#[error("oops!")]#[diagnostic(severity(Error))]structMyBad{#[source_code]src:NamedSource,#[label("This bit here")]bad_bit:SourceSpan,}fnmain() -> Result<()>{Err(MyBad{src:NamedSource::new("issue","this is the first line\nthis is the second line"),bad_bit:(23,0).into(),}.into())}
Gives:
Error:
× oops!
╭─[issue:1:1]
1 │ this is the first line
· ▲
· ╰── This bit here
2 │ this is the second line
· ▲
· ╰── This bit here
╰────
The text was updated successfully, but these errors were encountered:
I'm seeing strange behaviour when my
SourceSpan
has length 0 and the byte before the offset is a newline 🤔Minimal reproducible example:
Gives:
The text was updated successfully, but these errors were encountered: