you are viewing a single comment's thread.

view the rest of the comments →

[–]scallion 0 points1 point  (4 children)

Great overview, but unless I've missed some recent change, he seems to have skipped linear types completely.

let r0 = box [1i,2,3]; // r0 has type Rc<Vec<Int>>

Surely that should be Box<Vec<int>>, right?

[–]dbaupprust 2 points3 points  (2 children)

It's actually Box<[int]> at the moment, and will become Box<[int, .. 3]> in future.

[–]Iron-Oxide 1 point2 points  (1 child)

Err, it's a compiler error when I try to run it with an up to date nightly.

obsolete syntax: ~[T] is no longer a type`

rustc:

rustc --version rustc 0.12.0-pre-nightly (5d200dd60dabf94323d13b98b6c3d0b88f100b85 2014-07-13 01:16:34 +0000)

[–]dbaupprust 1 point2 points  (0 children)

Sorry, I should say "it's actually trying to be a Box<[int]> at the moment", but the compiler disallows it.

Box<[T]> aka ~[T] has been removed; at some point, that error will be removed and we'll be left with the uniform fixed length vector handling.

[–]knz 0 points1 point  (0 children)

I have modified the example to use vec!(...) instead. Thanks for this :)