]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-codes/E0582.rs
Rollup merge of #106940 - oli-obk:tait_error, r=compiler-errors
[rust.git] / tests / ui / error-codes / E0582.rs
1 // This test was derived from the wasm and parsell crates.  They
2 // stopped compiling when #32330 is fixed.
3
4 #![allow(dead_code, unused_variables)]
5
6 use std::str::Chars;
7
8 pub trait HasOutput<Ch, Str> {
9     type Output;
10 }
11
12 #[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Debug)]
13 pub enum Token<'a> {
14     Begin(&'a str)
15 }
16
17 fn mk_unexpected_char_err<'a>() -> Option<&'a i32> {
18     unimplemented!()
19 }
20
21 fn foo<'a>(data: &mut Chars<'a>) {
22     bar(mk_unexpected_char_err)
23 }
24
25 fn bar<F>(t: F)
26     // No type can satisfy this requirement, since `'a` does not
27     // appear in any of the input types:
28     where F: for<'a> Fn() -> Option<&'a i32>
29     //~^ ERROR E0582
30 {
31 }
32
33 fn baz<F>(t: F)
34     // No type can satisfy this requirement, since `'a` does not
35     // appear in any of the input types:
36     where F: for<'a> Iterator<Item=&'a i32>
37     //~^ ERROR E0582
38 {
39 }
40
41 fn main() {
42 }