2021-06-26 23:28:07 -05:00
|
|
|
// edition:2018
|
|
|
|
// check-pass
|
|
|
|
#![allow(unused)]
|
2021-07-01 06:35:33 -05:00
|
|
|
#![deny(rust_2021_prelude_collisions)]
|
2021-06-26 23:28:07 -05:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
2021-06-29 09:53:44 -05:00
|
|
|
fn try_into(self) -> S {
|
|
|
|
S
|
|
|
|
}
|
2021-06-26 23:28:07 -05:00
|
|
|
}
|
|
|
|
|
2021-07-06 08:51:25 -05:00
|
|
|
struct X;
|
|
|
|
|
|
|
|
trait Hey {
|
|
|
|
fn from_iter(_: i32) -> Self;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Hey for X {
|
|
|
|
fn from_iter(_: i32) -> Self {
|
|
|
|
X
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-26 23:28:07 -05:00
|
|
|
fn main() {
|
2021-07-06 08:51:25 -05:00
|
|
|
// See https://github.com/rust-lang/rust/issues/86633
|
2021-06-26 23:28:07 -05:00
|
|
|
let s = S;
|
|
|
|
let s2 = s.try_into();
|
2021-07-06 08:51:25 -05:00
|
|
|
|
|
|
|
// See https://github.com/rust-lang/rust/issues/86902
|
|
|
|
X::from_iter(1);
|
2021-06-26 23:28:07 -05:00
|
|
|
}
|