0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-22 10:25:09 +01:00
rust/tests/ui/delegation/impl-trait.rs

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

28 lines
356 B
Rust
Raw Permalink Normal View History

//@ check-pass
#![feature(fn_delegation)]
#![allow(incomplete_features)]
mod to_reuse {
pub fn foo() -> impl Clone { 0 }
}
reuse to_reuse::foo;
trait Trait {
fn bar() -> impl Clone { 1 }
}
struct S;
impl Trait for S {}
impl S {
reuse to_reuse::foo;
reuse <S as Trait>::bar;
}
fn main() {
foo().clone();
<S>::bar().clone();
}