rust/tests/ui/traits/const-traits/ice-121536-const-method.rs

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

18 lines
320 B
Rust
Raw Normal View History

2024-06-21 12:22:29 +00:00
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
2024-06-21 11:57:24 +00:00
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() {}