2014-12-15 20:11:09 -06:00
|
|
|
// Check that we correctly prevent users from making trait objects
|
|
|
|
// from traits with static methods.
|
2014-11-01 22:21:55 -05:00
|
|
|
|
2015-04-18 00:12:20 -05:00
|
|
|
trait Foo {
|
2014-12-15 20:11:09 -06:00
|
|
|
fn foo();
|
2014-11-01 22:21:55 -05:00
|
|
|
}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
fn foo_implicit<T:Foo+'static>(b: Box<T>) -> Box<dyn Foo + 'static> {
|
2015-12-15 03:31:58 -06:00
|
|
|
//~^ ERROR E0038
|
|
|
|
loop { }
|
2014-11-01 22:21:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|