rust/tests/ui/delegation/duplicate-definition-inside-trait-impl.rs
2024-03-27 15:51:48 +03:00

24 lines
344 B
Rust

#![feature(fn_delegation)]
#![allow(incomplete_features)]
trait Trait {
fn foo(&self) -> u32 { 0 }
}
struct F;
struct S;
mod to_reuse {
use crate::S;
pub fn foo(_: &S) -> u32 { 0 }
}
impl Trait for S {
reuse to_reuse::foo { self }
reuse Trait::foo;
//~^ ERROR duplicate definitions with name `foo`
}
fn main() {}