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.
18 lines
344 B
Rust
18 lines
344 B
Rust
// Ensure we don't ICE when lowering contracts on an associated item.
|
|
|
|
//@ compile-flags: --crate-type=lib
|
|
//@ check-pass
|
|
|
|
#![expect(incomplete_features)]
|
|
#![feature(contracts)]
|
|
|
|
extern crate core;
|
|
|
|
use core::contracts::requires;
|
|
|
|
struct Foo;
|
|
|
|
impl Foo {
|
|
#[requires(align > 0 && (align & (align - 1)) == 0)]
|
|
pub fn foo(align: i32) {}
|
|
}
|