]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisa
[rust.git] / src / test / ui / type-alias-impl-trait / structural-match-no-leak.rs
1 #![feature(const_impl_trait)]
2 // revisions: min_tait full_tait
3 #![feature(min_type_alias_impl_trait)]
4 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
5 //[full_tait]~^ WARN incomplete
6
7 type Bar = impl Send;
8
9 // While i32 is structural-match, we do not want to leak this information.
10 // (See https://github.com/rust-lang/rust/issues/72156)
11 const fn leak_free() -> Bar {
12     7i32
13 }
14 const LEAK_FREE: Bar = leak_free();
15
16 fn leak_free_test() {
17     match todo!() {
18         LEAK_FREE => (),
19         //~^ `impl Send` cannot be used in patterns
20         _ => (),
21     }
22 }
23
24 fn main() {}