]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / structural-match-no-leak.rs
CommitLineData
6a06907d 1#![feature(const_impl_trait)]
94222f64 2#![feature(type_alias_impl_trait)]
f9f354fc
XL
3
4type Bar = impl Send;
5
6// While i32 is structural-match, we do not want to leak this information.
7// (See https://github.com/rust-lang/rust/issues/72156)
8const fn leak_free() -> Bar {
9 7i32
10}
136023e0 11const LEAK_FREE: Bar = leak_free();
f9f354fc
XL
12
13fn leak_free_test() {
14 match todo!() {
15 LEAK_FREE => (),
136023e0 16 //~^ `impl Send` cannot be used in patterns
f9f354fc
XL
17 _ => (),
18 }
19}
20
1b1a35ee 21fn main() {}