rust/tests/ui/contracts/associated-item.rs

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

19 lines
387 B
Rust
Raw Permalink Normal View History

// Ensure we don't ICE when lowering contracts on an associated item.
//@ compile-flags: --crate-type=lib
//@ check-pass
#![feature(contracts)]
//~^ WARN the feature `contracts` is incomplete and may not be safe to use
extern crate core;
use core::contracts::requires;
struct Foo;
impl Foo {
#[requires(align > 0 && (align & (align - 1)) == 0)]
pub fn foo(align: i32) {}
}