]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/E0582.rs
Rollup merge of #39604 - est31:i128_tests, r=alexcrichton
[rust.git] / src / test / compile-fail / E0582.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // This test was derived from the wasm and parsell crates.  They
12 // stopped compiling when #32330 is fixed.
13
14 #![allow(dead_code, unused_variables)]
15
16 use std::str::Chars;
17
18 pub trait HasOutput<Ch, Str> {
19     type Output;
20 }
21
22 #[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Debug)]
23 pub enum Token<'a> {
24     Begin(&'a str)
25 }
26
27 fn mk_unexpected_char_err<'a>() -> Option<&'a i32> {
28     unimplemented!()
29 }
30
31 fn foo<'a>(data: &mut Chars<'a>) {
32     bar(mk_unexpected_char_err)
33 }
34
35 fn bar<F>(t: F)
36     // No type can satisfy this requirement, since `'a` does not
37     // appear in any of the input types:
38     where F: for<'a> Fn() -> Option<&'a i32>
39     //~^ ERROR E0582
40 {
41 }
42
43 fn baz<F>(t: F)
44     // No type can satisfy this requirement, since `'a` does not
45     // appear in any of the input types:
46     where F: for<'a> Iterator<Item=&'a i32>
47     //~^ ERROR E0582
48 {
49 }
50
51 fn main() {
52 }