This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
rust
/
src
/
test
/
run-pass
/
vec-push.rs
6 lines
99 B
Rust
Raw
Normal View
History
Unescape
Escape
rustc: Add a testcase for vector push (mutable aliases with *, really)
2011-04-28 16:22:13 -07:00
Update stdlib, compiler, and tests to new kind system This involved adding 'copy' to more generics than I hoped, but an experiment with making it implicit showed that that way lies madness -- unless enforced, you will not remember to mark functions that don't copy as not requiring copyable kind. Issue #1177
2011-11-18 12:39:20 +01:00
fn
push
<
copy
T
>
(
&
v
:
[
const
T
]
,
t
:
T
)
{
v
+
=
[
t
]
;
}
Reformat source tree (minus a couple tests that are still grumpy).
2011-06-15 11:19:50 -07:00
Reformat This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-19 15:16:48 -07:00
fn
main
(
)
{
let
v
=
[
1
,
2
,
3
]
;
push
(
v
,
1
)
;
}
Reference in New Issue
Copy Permalink