]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-26802.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.git] / src / test / ui / issues / issue-26802.rs
1 // run-pass
2 trait Foo<'a> {
3     fn bar<'b>(&self, x: &'b u8) -> u8 where 'a: 'b { *x+7 }
4 }
5
6 pub struct FooBar;
7 impl Foo<'static> for FooBar {}
8 fn test(foobar: FooBar) -> Box<dyn Foo<'static>> {
9     Box::new(foobar)
10 }
11
12 fn main() {
13     assert_eq!(test(FooBar).bar(&4), 11);
14 }