Skip to content

Commit eda91d9

Browse files
Sad
1 parent 2820bc4 commit eda91d9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

compiler/rustc_typeck/src/check/inherited.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub struct Inherited<'a, 'tcx> {
3737

3838
// Some additional `Sized` obligations badly affect type inference.
3939
// These obligations are added in a later stage of typeck.
40+
// Removing these may also cause additional complications, see #101066.
4041
pub(super) deferred_sized_obligations:
4142
RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>,
4243

src/test/ui/coercion/issue-101066.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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() {}

0 commit comments

Comments
 (0)