]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0657.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / error-codes / E0657.rs
1 #![allow(warnings)]
2
3 trait Id<T> {}
4 trait Lt<'a> {}
5
6 impl<'a> Lt<'a> for () {}
7 impl<T> Id<T> for T {}
8
9 fn free_fn_capture_hrtb_in_impl_trait()
10     -> Box<for<'a> Id<impl Lt<'a>>>
11         //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level [E0657]
12 {
13     Box::new(())
14 }
15
16 struct Foo;
17 impl Foo {
18     fn impl_fn_capture_hrtb_in_impl_trait()
19         -> Box<for<'a> Id<impl Lt<'a>>>
20             //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level
21     {
22         Box::new(())
23     }
24 }
25
26 fn main() {}