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
{{ message }}
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
When attempting to add a new variant to an existing error_chainError, I found the following problem. I wanted to add an error that has no fields, and so I added a new error that looked similar to the following:
error_chain!{
errors {Foo(){}}}
Note the addition of the OutOfMemory variant. This causes the following error:
error: no rules expected the token `=>`
--> src/main.rs:4:1
|
4 | / error_chain! {
5 | | errors {
6 | | Foo() {}
7 | | }
8 | | }
| |_^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
Of course, the => token isn't even in my invocation! The correct way to do this is the following:
error_chain!{
errors {Foo{}}}
In theory this should be simple to at least add a compilation error for, if not just simply allow.
The text was updated successfully, but these errors were encountered:
eira-fransham
changed the title
Incomprehensible error message with uncertain source when adding new error variant
Incomprehensible error message when adding error without arguments
Jun 19, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When attempting to add a new variant to an existing
error_chain
Error
, I found the following problem. I wanted to add an error that has no fields, and so I added a new error that looked similar to the following:Note the addition of the
OutOfMemory
variant. This causes the following error:Of course, the
=>
token isn't even in my invocation! The correct way to do this is the following:In theory this should be simple to at least add a compilation error for, if not just simply allow.
The text was updated successfully, but these errors were encountered: