]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/issue-101066.rs
Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726
[rust.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() {}