rust/tests/ui/traits/const-traits/ice-121536-const-method.rs
Michael Goulet e91267f3f0 Move tests
2024-10-22 00:03:09 +00:00

18 lines
320 B
Rust

#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
pub struct Vec3;
#[const_trait]
pub trait Add {
fn add(self) -> Vec3;
}
impl Add for Vec3 {
const fn add(self) -> Vec3 {
//~^ ERROR functions in trait impls cannot be declared const
self
}
}
fn main() {}