mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
19 lines
307 B
Rust
19 lines
307 B
Rust
// run-pass
|
|
// Check that the object bound dyn A + 'a: A is preferred over the
|
|
// where clause bound dyn A + 'static: A.
|
|
|
|
#![allow(unused)]
|
|
|
|
trait A {
|
|
fn test(&self);
|
|
}
|
|
|
|
fn foo(x: &dyn A)
|
|
where
|
|
dyn A + 'static: A, // Using this bound would lead to a lifetime error.
|
|
{
|
|
x.test();
|
|
}
|
|
|
|
fn main () {}
|