You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know how to describe what the problem is, but here's a test case:
fnmain(){let s = "a b c d e f g";letmut split = ~[];
str::each_split_char_nonempty(s,' ', |bit| {
split.push(str::from_slice(bit));true});match vec::shift(&mut split){
x => io::println(fmt!("first bit: %s", x)),}}
Changing the _x to a _ stops the double free, as does changing the match to a let (or just calling vec::shift with no let or match), or the ~str to a &'static str.
Also, removing the element of the vector (so that it is let mut split = ~[]) causes:
issue-5885.rs:4:21: 4:31 error: internal compiler error: 0'th deref is of a non-deref'able type `[type error]`
issue-5885.rs:4 match vec::shift(&mut split) {
^~~~~~~~~~
I don't know how to describe what the problem is, but here's a test case:
On run, we get:
The text was updated successfully, but these errors were encountered: