With the following code, I am getting a "the trait core::kinds::Sized
is not implemented for the type Object+'a
" error. I've trimmed out all the other code not needed to trigger the error.
fn main() {
}
pub trait Object {
fn select(&mut self);
}
pub struct Ball<'a>;
impl<'a> Object for Ball<'a> {
fn select(&mut self) {
// Do something
}
}
pub struct Foo<'a> {
foo: Vec<Object + 'a>,
}
Playpen: http://is.gd/tjDxWl
The full error is:
<anon>:15:1: 17:2 error: the trait `core::kinds::Sized` is not implemented for the type `Object+'a`
<anon>:15 pub struct Foo<'a> {
<anon>:16 foo: Vec<Object + 'a>,
<anon>:17 }
<anon>:15:1: 17:2 note: the trait `core::kinds::Sized` must be implemented because it is required by `collections::vec::Vec`
<anon>:15 pub struct Foo<'a> {
<anon>:16 foo: Vec<Object + 'a>,
<anon>:17 }
error: aborting due to previous error
playpen: application terminated with error code 101
I'm very new to Rust and don't really know where to go from here. Any suggestions?