about summary refs log tree commit diff
path: root/tests/ui/contracts/associated-item.rs
blob: 4a2d05abbc53cd37e0514e69fb58fbed3c7bbc07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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) {}
}