Closed
Description
I have tested this on both 1.13 and on nightly-2016-12-28. This this is the script to reproduce: https://is.gd/PWV89w
The code is invalid due to missing constraint Col::SqlType: IntoNullable
on line 26. The expected error is:
error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
--> foo.rs:25:1
|
25 | pub enum ColumnInsertValue<Col, Expr> where
| _^ starting here...
26 | | Col: Column,
27 | | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
28 | | {
29 | | Expression(Col, Expr),
30 | | Default(Col),
31 | | }
| |_^ ...ending here: the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
= help: consider adding a `where <Col as Expression>::SqlType: NotNull` bound
= note: required because of the requirements on the impl of `IntoNullable` for `<Col as Expression>::SqlType`
But the compiler instead ICEs. If #[derive(Copy)]
is removed, the compiler gives the error message as expected. If the blanket impl<T: NotNull> IntoNullable for T
(lines 10-12 in the script) is removed, the compiler gives the error message as expected.