]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / type-alias-impl-trait / structural-match-no-leak.rs
1 #![feature(const_impl_trait, 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 todo!() {
14         LEAK_FREE => (),
15         //~^ `impl Send` cannot be used in patterns
16         _ => (),
17     }
18 }
19
20 fn main() {}