rust/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs

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

15 lines
295 B
Rust
Raw Normal View History

2023-03-20 11:20:28 -05:00
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
2022-09-22 19:56:55 -05:00
#![feature(return_position_impl_trait_in_trait)]
use std::ops::Deref;
2022-09-22 19:56:55 -05:00
pub trait Foo {
2023-04-30 16:52:35 -05:00
fn bar(self) -> impl Deref<Target = impl Sized>;
2022-09-22 19:56:55 -05:00
}
pub struct Foreign;
impl Foo for Foreign {
2023-04-30 16:52:35 -05:00
fn bar(self) -> &'static () { &() }
2022-09-22 19:56:55 -05:00
}