4 // rust-lang/rust#32382: Borrow checker used to complain about
5 // `foobar_3` in the `impl` below, presumably due to some interaction
6 // between the use of a lifetime in the associated type and the use of
7 // the overloaded operator[]. This regression test ensures that we do
8 // not resume complaining about it in the future.
11 use std::marker::PhantomData;
14 pub trait Context: Clone {
15 type Container: ?Sized;
16 fn foobar_1( container: &Self::Container ) -> &str;
17 fn foobar_2( container: &Self::Container ) -> &str;
18 fn foobar_3( container: &Self::Container ) -> &str;
23 phantom: PhantomData<&'a ()>
26 impl<'a> Context for Foobar<'a> {
27 type Container = [&'a str];
29 fn foobar_1<'r>( container: &'r [&'a str] ) -> &'r str {
33 fn foobar_2<'r>( container: &'r Self::Container ) -> &'r str {
37 fn foobar_3<'r>( container: &'r Self::Container ) -> &'r str {