On 16/05/14 12:48 AM, Tommi wrote:
> On 2014-05-16, at 7:35, Steven Fackler <[email protected]> wrote:
> 
>> Type annotations are not there for the compiler; they're there for people 
>> reading the code. If I want to use some function I don't want to be forced 
>> to read the entire implementation to figure out what the lifetime of the 
>> return value is.
> 
> Just to be sure... I take it you are in fact implying that "yes, it is 
> possible for the compiler to figure out those lifetimes without the 
> programmer explicitly specifying them in the function signature"?

Lifetimes are based on subtyping, and AFAIK that presents huge problems
for type inference. You would need to ask Niko how feasible it would be
to infer it globally. I used to run into all sorts of problems with the
*local* inference but it got a lot better.

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to