blob: 307a67160980db8da67d82f2daa8d9cd6b6ffc6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// run-pass
trait Foo<'a> {
fn bar<'b>(&self, x: &'b u8) -> u8 where 'a: 'b { *x+7 }
}
pub struct FooBar;
impl Foo<'static> for FooBar {}
fn test(foobar: FooBar) -> Box<dyn Foo<'static>> {
Box::new(foobar)
}
fn main() {
assert_eq!(test(FooBar).bar(&4), 11);
}
|