mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Sad
This commit is contained in:
parent
2820bc4b69
commit
eda91d9291
@ -37,6 +37,7 @@ pub struct Inherited<'a, 'tcx> {
|
||||
|
||||
// Some additional `Sized` obligations badly affect type inference.
|
||||
// These obligations are added in a later stage of typeck.
|
||||
// Removing these may also cause additional complications, see #101066.
|
||||
pub(super) deferred_sized_obligations:
|
||||
RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>,
|
||||
|
||||
|
16
src/test/ui/coercion/issue-101066.rs
Normal file
16
src/test/ui/coercion/issue-101066.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// check-pass
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
pub trait FieldElement {
|
||||
type Integer: TryFrom<usize, Error = std::num::TryFromIntError>;
|
||||
|
||||
fn valid_integer_try_from<N>(i: N) -> Result<Self::Integer, ()>
|
||||
where
|
||||
Self::Integer: TryFrom<N>,
|
||||
{
|
||||
Self::Integer::try_from(i).map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user