about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/ice-121536-const-method.rs
blob: b89786bfd933f259f3870392065e63248485b13d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(const_trait_impl)]

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() {}