// run-pass #![feature(impl_trait_in_bindings)] //~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash use std::fmt::Debug; const FOO: impl Debug + Clone + PartialEq = 42; static BAR: impl Debug + Clone + PartialEq = 42; fn a(x: T) { let y: impl Clone = x; let _ = y.clone(); } fn b(x: T) { let f = move || { let y: impl Clone = x; let _ = y.clone(); }; f(); } trait Foo { fn a(x: T) { let y: impl Clone = x; let _ = y.clone(); } } impl Foo for i32 { fn a(x: T) { let y: impl Clone = x; let _ = y.clone(); } } fn main() { let foo: impl Debug + Clone + PartialEq = 42; assert_eq!(FOO.clone(), 42); assert_eq!(BAR.clone(), 42); assert_eq!(foo.clone(), 42); a(42); b(42); i32::a(42); }