summaryrefslogtreecommitdiffstats
path: root/tests/ui/never_type/issue-2149.rs
blob: d6426d2cfabfda31785f8dbccf1f5f8696b3daba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
trait VecMonad<A> {
    fn bind<B, F>(&self, f: F) where F: FnMut(A) -> Vec<B>;
}

impl<A> VecMonad<A> for Vec<A> {
    fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
        let mut r = panic!();
        for elt in self { r = r + f(*elt); }
        //~^ ERROR E0277
   }
}
fn main() {
    ["hi"].bind(|x| [x] );
    //~^ ERROR no method named `bind` found
}