rust/tests/ui/associated-type-bounds/no-gat-position.rs

17 lines
387 B
Rust

// Test for <https://github.com/rust-lang/rust/issues/119857>.
pub trait Iter {
type Item<'a>: 'a where Self: 'a;
fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>;
//~^ ERROR associated type bindings are not allowed here
}
impl Iter for () {
type Item<'a> = &'a mut [()];
fn next<'a>(&'a mut self) -> Option<Self::Item<'a>> { None }
}
fn main() {}