The confusing mixture of byte index and character count meant that every
use of .substr was incorrect; replaced by slice_chars which only uses
character indices. The old behaviour of `.substr(start, n)` can be emulated
via `.slice_from(start).slice_chars(0, n)`.
This was a lot more painful than just changing `x.each` to `x.iter().advance` . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround.
The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic `@mut` failures, so those had to be wrapped in blocks except where the scope ends immediately.
Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to `for x.each |x|` becoming `for x.iter |x|` and making all the iterator adaptors available.
I dropped the run-pass tests for `old_iter` because there's not much point in fixing a module that's on the way out in the next week or so.
This commit fixes#7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
This is a reopening of #6570, and almost fixes#6511.
Note that this doesn't actually enable building a threadsafe LLVM, because that will require an LLVM rebuild which will be bundled with the upgrades in #6713.
What this does do, however, is removes all thread-unsafe usage of LLVM from the compiler.
OS X's terminfo uses the hex representation of the first character of
the terminal name as the directory name.
Ubuntu seems to use /lib/terminfo instead of /usr/share/terminfo, at
least on the one machine I have access to.
Continuation of #7015, and #6995.
Rewrites the character-based `each_split` functions in `str` to use an iterator, removes a few redundant methods, and replaces all uses of `len`, `is_empty` and `slice` functions with the methods (and deletes the the functions).
Update: Ok, this has turned into a major makeover for `str`, turning a lot of functions into methods, and removing redundant ones. Each commit is essentially a single such change.
(Unscientific benchmarks suggest that the external `split_iter` is approximately 10% faster than the internal one. I'm not quite sure why this would be true.)
(@thestinger is probably interested in this.)