Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Error format
- ```
- error: mismatched types [--explain E0308]
- --> array-not-vector.rs:20:20
- 20 |> let _y: &i32 = x;
- |> ^ expected i32, found slice
- note: expected type `&i32`
- note: found type `&[i32]`
- ```
- ## JSON
- - Diagnostic
- - Logical:
- - message ("mismatched types")
- - labels (vec<(Span, Option<String>, is_primary: bool)>)
- - span: foo
- - span: bar
- - suggestions (vec<(Span, String)>)?
- - the string is alternative source code, not a label
- - error code ("E0123", explanation)
- - Subdiagnostics: Vec<Logical>
- - presentation: vec<PresentationLine>
- - Span:
- - Start Point
- - End Point
- - plain text: Vec<String>
- - but: maybe crosses files?
- - Point:
- - filename byte / line / column
- - PresentationLine
- - Option<Point>
- - Bare text (String)
- - Vec<StyleSpan>
- - StyleSpan:
- - column start
- - column end
- - style: choice of
- - filename
- - line-number
- - primary carrot
- - secondary dash
- - elision
- - primary-label
- - second-label
- - etc.
- RenderedLineKind:
- - source text
- - highlights
- - elision
- Examples:
- - One primary span, two labels, one of which is the primary span
- error: use of moved value
- --> filename:130:33 <-- primary span shows up here
- 123 |> match x {
- 124 |> Some(y) => ...
- |> - move occurs here
- |> ...
- 130 |> foo(x);
- |> ^ use occurs here later <-- labeled primary span
- suggestion: maybe a ref binding?
- Some(ref y) => ...
- - Multiple primary spans, no labels
- error: unused imports
- --> filename:line:col
- 123 |> use foo::{a, b, c};
- |> ^ ^
- - Multiple primary spans, one of which is labeled
- error: undefined variable
- --> filename:line:col
- 123 |> println(x);
- |> ^ did you mean `y`?
- 124 |> println(x);
- |> ^
- 125 |> println(x);
- |> ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement