[rust-dev] Specifying lifetimes in return types of overloaded operators

Artella Coding artella.coding at googlemail.com
Tue Apr 15 06:28:47 PDT 2014


Currently if I try to specify lifetimes in the return types of overloaded
operators like Index ([]), I get an error message :

"method `index` has an incompatible type for trait: expected concrete
lifetime, but found bound lifetime parameter &"

Why has this restriction been placed, given that I can write custom
functions which can have bounded lifetimes specifications in the return
type?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140415/388437c9/attachment.html>


More information about the Rust-dev mailing list