rust/tests/ui/traits/const-traits/cross-crate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
575 B
Rust
Raw Normal View History

2022-07-25 08:17:00 +00:00
//@ revisions: stock gated stocknc gatednc
//@ [gated] check-pass
2024-06-30 17:08:45 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00:00
#![cfg_attr(any(gated, gatednc), feature(const_trait_impl))]
2024-06-30 17:08:45 +00:00
#![allow(incomplete_features)]
//@ aux-build: cross-crate.rs
extern crate cross_crate;
use cross_crate::*;
fn non_const_context() {
NonConst.func();
Const.func();
}
const fn const_context() {
2022-07-25 08:17:00 +00:00
#[cfg(any(stocknc, gatednc))]
NonConst.func();
2023-07-27 15:51:02 +00:00
//[stocknc]~^ ERROR: cannot call
//[gatednc]~^^ ERROR: the trait bound
Const.func();
//[stock,stocknc]~^ ERROR: cannot call
}
fn main() {}