rust/tests/ui/contracts/incomplete-feature.rs
Dawid Lachowicz 0bd9a2fafc
contracts: clean up feature flag warning duplicated across tests
There is no need for every contracts test to assert the same warning
for using the `contracts` feature flag, as such use
`#![expect(incomplete_features)]` in the tests, and add one test
to specifically check for the warning.
2025-12-07 17:29:30 +00:00

17 lines
532 B
Rust

//@ run-pass
//@ compile-flags: -Zcontract-checks=yes
// This test specifically checks that the [incomplete_features] warning is
// emitted when the `contracts` feature gate is enabled, so that it can be
// marked as `expect`ed in other tests in order to reduce duplication.
#![feature(contracts)]
//~^ WARN the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
extern crate core;
use core::contracts::requires;
#[requires(true)]
fn foo() {}
fn main() {
foo()
}