]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const_fn_trait_bound.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / ui / consts / const_fn_trait_bound.rs
1 // gate-test-const_fn_trait_bound
2
3 // revisions: stock gated
4
5 #![feature(rustc_attrs)]
6 #![cfg_attr(gated, feature(const_fn_trait_bound))]
7
8 const fn test1<T: std::ops::Add>() {}
9 //[stock]~^ trait bounds
10 const fn test2(_x: &dyn Send) {}
11 //[stock]~^ trait bounds
12 const fn test3() -> &'static dyn Send { loop {} }
13 //[stock]~^ trait bounds
14
15
16 #[rustc_error]
17 fn main() {} //[gated]~ fatal error triggered by #[rustc_error]