mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-26 04:15:48 +00:00
18 lines
266 B
Rust
18 lines
266 B
Rust
#![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() {}
|