]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/async-block.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / ui / consts / async-block.rs
1 // gate-test-const_async_blocks
2
3 // edition:2018
4 // revisions: with_feature without_feature
5
6 #![feature(rustc_attrs)]
7 #![cfg_attr(with_feature, feature(const_async_blocks))]
8
9 use std::future::Future;
10
11 // From <https://github.com/rust-lang/rust/issues/77361>
12 const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
13 //[without_feature]~^ `async` block
14
15 static _FUT: &(dyn Future<Output = ()> + Sync) = &async {};
16 //[without_feature]~^ `async` block
17
18 #[rustc_error]
19 fn main() {} //[with_feature]~ fatal error triggered by #[rustc_error]