1
Fork 0
rust/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs

17 lines
286 B
Rust
Raw Normal View History

2020-03-02 10:53:58 -08:00
// Regression test for #69615.
#![feature(const_trait_impl, const_fn)]
#![allow(incomplete_features)]
pub trait MyTrait {
fn method(&self);
}
impl const MyTrait for () {
fn method(&self) {
2020-05-21 12:49:38 -07:00
loop {} //~ ERROR `loop` is not allowed in a `const fn`
2020-03-02 10:53:58 -08:00
}
}
fn main() {}