]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/structural-match-no-leak.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / type-alias-impl-trait / structural-match-no-leak.rs
1 #![feature(type_alias_impl_trait)]
2
3 type Bar = impl Send;
4
5 // While i32 is structural-match, we do not want to leak this information.
6 // (See https://github.com/rust-lang/rust/issues/72156)
7 const fn leak_free() -> Bar {
8     7i32
9 }
10 const LEAK_FREE: Bar = leak_free();
11
12 fn leak_free_test() {
13     match LEAK_FREE {
14         LEAK_FREE => (),
15         //~^ `Bar` cannot be used in patterns
16         _ => (),
17     }
18 }
19
20 fn main() {}