Don't unwrap the result of span_to_snippet
It can return `Err` due to macros being expanded across crates or files.
This commit is contained in:
parent
478464570e
commit
365ff62fca
5 changed files with 90 additions and 43 deletions
15
src/test/ui/borrowck/move-error-snippets.stderr
Normal file
15
src/test/ui/borrowck/move-error-snippets.stderr
Normal file
|
@ -0,0 +1,15 @@
|
|||
error[E0507]: cannot move out of static item `D`
|
||||
--> $DIR/move-error-snippets.rs:16:18
|
||||
|
|
||||
LL | | #[macro_use]
|
||||
| |__________________^ move occurs because `D` has type `A`, which does not implement the `Copy` trait
|
||||
...
|
||||
LL | aaa!(D);
|
||||
| __________________^
|
||||
...
|
||||
LL | sss!();
|
||||
| ------- in this macro invocation
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0507`.
|
Loading…
Add table
Add a link
Reference in a new issue