The snippet is extracted from std::str:

pub enum MaybeOwned<'a> {
    /// A borrowed string
    Slice(&'a str),
    /// An owned string
    Owned(~str)
}

impl<'a> Eq for MaybeOwned<'a> {
    #[inline]
    fn eq(&self, _other: &MaybeOwned) -> bool {
        true
    }
}

fn main() {}

Note the Eq implementation for MaybeOwned, a lifetime parameter is missing.
Isn't it ought to be:

impl<'a, 'b> Eq for MaybeOwned<'a> {
    #[inline]
    fn eq(&self, _other: &MaybeOwned<'b>) -> bool {
        true
    }
}

If so, then I'll file a bug report.

-Ed
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to