1 # `impl_trait_in_bindings`
3 The tracking issue for this feature is: [#34511]
5 [#34511]: https://github.com/rust-lang/rust/issues/34511
7 ------------------------
9 The `impl_trait_in_bindings` feature gate lets you use `impl Trait` syntax in
10 `let`, `static`, and `const` bindings.
15 #![feature(impl_trait_in_bindings)]
20 let a: impl Debug + Clone = 42;
22 println!("{:?}", b); // prints `42`
26 Note however that because the types of `a` and `b` are opaque in the above
27 example, calling inherent methods or methods outside of the specified traits
28 (e.g., `a.abs()` or `b.abs()`) is not allowed, and yields an error.