]> git.proxmox.com Git - rustc.git/blob - src/test/ui/coercion/issue-101066.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / coercion / issue-101066.rs
1 // check-pass
2
3 use std::convert::TryFrom;
4
5 pub trait FieldElement {
6 type Integer: TryFrom<usize, Error = std::num::TryFromIntError>;
7
8 fn valid_integer_try_from<N>(i: N) -> Result<Self::Integer, ()>
9 where
10 Self::Integer: TryFrom<N>,
11 {
12 Self::Integer::try_from(i).map_err(|_| ())
13 }
14 }
15
16 fn main() {}