File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
crates/formality-types/src Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 43
43
let ( t, remainder) = match T :: parse ( & scope, text) {
44
44
Ok ( v) => v,
45
45
Err ( errors) => {
46
- anyhow:: bail!( "failed to parse {text:?}: {errors:#?}" ) ;
46
+ let mut err = anyhow:: anyhow!( "failed to parse {text}" ) ;
47
+ for error in errors {
48
+ err = err. context ( error. text . to_owned ( ) ) . context ( error. message ) ;
49
+ }
50
+ return Err ( err) ;
47
51
}
48
52
} ;
49
53
if !skip_whitespace ( remainder) . is_empty ( ) {
Original file line number Diff line number Diff line change 1
- Error: failed to parse "[\n crate Foo { \n trait Baz<> where [ cake ] {}\n }\n]\n": {
2
- ParseError {
3
- text: " ] {}\n }\n]\n",
4
- message: "expected `:`",
5
- },
6
- }
1
+ Error: expected `:`
2
+
3
+ Caused by:
4
+ 0: ] {}
5
+ }
6
+ ]
7
+
8
+ 1: failed to parse [
9
+ crate Foo {
10
+ trait Baz<> where [ cake ] {}
11
+ }
12
+ ]
13
+
You can’t perform that action at this time.
0 commit comments