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.
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.
11 // This test was derived from the wasm and parsell crates. They
12 // stopped compiling when #32330 is fixed.
14 #![allow(dead_code, unused_variables)]
15 #![deny(hr_lifetime_in_assoc_type)]
19 pub trait HasOutput<Ch, Str> {
23 #[derive(Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Debug)]
28 fn mk_unexpected_char_err<'a>() -> Option<&'a i32> {
32 fn foo<'a>(data: &mut Chars<'a>) {
33 bar(mk_unexpected_char_err)
34 //~^ ERROR lifetime parameter `'a` declared on fn `mk_unexpected_char_err`
35 //~| WARNING hard error in a future release
39 // No type can satisfy this requirement, since `'a` does not
40 // appear in any of the input types:
41 where F: for<'a> Fn() -> Option<&'a i32>
42 //~^ ERROR associated type `Output` references lifetime `'a`, which does not
43 //~| WARNING hard error in a future release