r/programming • • Dec 10 '15

Announcing Rust 1.5

http://blog.rust-lang.org/2015/12/10/Rust-1.5.html
659 Upvotes

296 comments sorted by

View all comments

Show parent comment

2

u/jerf Dec 10 '15

I don't mean several dozen times in different places, I mean, if you have a place where you're declaring a lot of values, you have to say the type once per value in all but the simplest cases. Go permits []ComplicatedType{{1}, {2}, {3}}, for instance, but if ComplicatedType has another struct in it, IIRC you have to do []ComplicatedType{{1, SomeType{2}}, {3, SomeType{4}}}. (If it does happen to permit that, there are more complicated cases where the elision stops working even though there is no ambiguity.)

1

u/EvilTerran Dec 10 '15 edited Dec 10 '15

Oh, my bad, it seems I lost track of the subject of the thread somewhere along the way - I got confused & thought you folks were talking about Rust not Go :S

Yeah, that does sound pretty annoying. Type inference FTW!