]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-38821.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-38821.rs
1 pub struct Nullable<T: NotNull>(T);
2
3 pub trait NotNull {}
4
5 pub trait IntoNullable {
6     type Nullable;
7 }
8
9 impl<T: NotNull> IntoNullable for T {
10     type Nullable = Nullable<T>;
11 }
12
13 impl<T: NotNull> IntoNullable for Nullable<T> {
14     type Nullable = Nullable<T>;
15 }
16
17 pub trait Expression {
18     type SqlType;
19 }
20
21 pub trait Column: Expression {}
22
23 #[derive(Debug, Copy, Clone)]
24 //~^ ERROR the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
25 pub enum ColumnInsertValue<Col, Expr> where
26     Col: Column,
27     Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
28 {
29     Expression(Col, Expr),
30     Default(Col),
31 }
32
33 fn main() {}