rust/tests/ui/issues/issue-26802.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
274 B
Rust
Raw Normal View History

// 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 {}
2019-05-28 18:47:21 +00:00
fn test(foobar: FooBar) -> Box<dyn Foo<'static>> {
Box::new(foobar)
}
fn main() {
assert_eq!(test(FooBar).bar(&4), 11);
}