]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/cross-crate.rs
Rollup merge of #105517 - pcc:process-panic-after-fork, r=davidtwco
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / cross-crate.rs
1 // revisions: stock gated stocknc gatednc
2 // [gated] check-pass
3 #![cfg_attr(any(gated, gatednc), feature(const_trait_impl))]
4
5 // aux-build: cross-crate.rs
6 extern crate cross_crate;
7
8 use cross_crate::*;
9
10 fn non_const_context() {
11     NonConst.func();
12     Const.func();
13 }
14
15 const fn const_context() {
16     #[cfg(any(stocknc, gatednc))]
17     NonConst.func();
18     //[stocknc]~^ ERROR: the trait bound
19     //[gatednc]~^^ ERROR: the trait bound
20     Const.func();
21     //[stock]~^ ERROR: cannot call
22 }
23
24 fn main() {}