1 #![deny(identity_conversion)]
3 fn test_generic<T: Copy>(val: T) -> T {
8 fn test_generic2<T: Copy + Into<i32> + Into<U>, U: From<T>>(val: T) {
10 let _: i32 = val.into();
11 let _: U = val.into();
15 fn test_questionmark() -> Result<(), ()> {
17 let _: i32 = 0i32.into();
25 test_generic2::<i32, i32>(10i32);
26 test_questionmark().unwrap();
28 let _: String = "foo".into();
29 let _: String = From::from("foo");
30 let _ = String::from("foo");
31 #[allow(identity_conversion)]
33 let _: String = "foo".into();
34 let _ = String::from("foo");
35 let _ = "".lines().into_iter();
38 let _: String = "foo".to_string().into();
39 let _: String = From::from("foo".to_string());
40 let _ = String::from("foo".to_string());
41 let _ = "".lines().into_iter();
42 let _ = vec![1, 2, 3].into_iter().into_iter();