]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-2149.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-2149.rs
1 trait VecMonad<A> {
2     fn bind<B, F>(&self, f: F) where F: FnMut(A) -> Vec<B>;
3 }
4
5 impl<A> VecMonad<A> for Vec<A> {
6     fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
7         let mut r = panic!();
8         for elt in self { r = r + f(*elt); }
9         //~^ ERROR E0277
10    }
11 }
12 fn main() {
13     ["hi"].bind(|x| [x] );
14     //~^ ERROR no method named `bind` found for type `[&str; 1]` in the current scope
15 }