]> git.proxmox.com Git - rustc.git/blob - tests/ui/associated-types/issue-38821.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / associated-types / 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() {}