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
warning: unreachable expression
--> src/lib.rs:1:17
|
1 | #[derive(Debug, diesel_derive_enum::DbEnum, diesel::SqlType)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| unreachable expression
| any code following this expression is unreachable
Particularly, if expand the macro issue is clearly seen at ToSql<AMapping, DB>:
impl<DB:Backend>ToSql<AMapping,DB>forA{fnto_sql<W:Write>(&self,out:&mutOutput<W,DB>) -> serialize::Result{match*self{}Ok(IsNull::No)// <- that one is unreachable}}
The text was updated successfully, but these errors were encountered:
Well, I actually found it out by an accident, but probably it can be useful with "never" type, e.g. in postgres: CREATE TYPE NeverType AS ENUM (). Though, I'm not even sure if it works with diesel properly, but probably might be handy, if so.
Yes, I suppose the easiest thing to do it just remove the match block if there are no variants. No idea if that is really useful to anyone but it would remove the warning.
The following code:
will lead to compiler warning:
Particularly, if expand the macro issue is clearly seen at
ToSql<AMapping, DB>
:The text was updated successfully, but these errors were encountered: