Use assert_eq! in copy_from_slice
This will print both lengths when the assertion fails instead of just saying that they're different.
Output of current stable and nightly (modulo the exact line number):
```
thread 'main' panicked at 'destination and source slices have different lengths', libcore/slice/mod.rs:1645:9
```
Output after this PR:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `123`,
right: `456`: destination and source slices have different lengths', libcore/slice/mod.rs:1645:9
```
Note that I have not run the tests locally.
PR #47252 switched stack inspection functions of dbghelp.dll
to their newer alternatives that also capture inlined context.
Unfortunately, said new alternatives are not present in older
dbghelp.dll versions.
In particular Windows 7 at the time of writing has dbghelp.dll
version 6.1.7601 from 2010, that lacks StackWalkEx and friends.
Fixes#50138
Optimize RefCell refcount tracking
Address the performance concern raised in https://github.com/rust-lang/rust/pull/51466#issuecomment-398255276
cc @dtolnay @nnethercote @rust-lang/wg-compiler-performance
cc @RalfJung @jhjourdan for soundness concerns
Can somebody kick off a perf run on this? I'm not sure how that's done, but I understand it has to be started manually.
The idea of this change is to switch to representing mutable refcount as values below 0 to eliminate some branching that was required with the old algorithm.
Emscripten changed the default behavior recently:
bd050e64bb/ChangeLog.markdown (v1381-05172018)
It now defaults to WebAssembly and requires an explicit flag to generate asm.js.
WASM=0 is also valid for older emcc and thus doesn't break it.
Closes#51856
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.
This PR removes most of the interior mutability from `FileMap`, which should be beneficial, especially in a multithreaded setting. This is achieved by initializing the state in question when the filemap is constructed instead of during lexing. Hopefully this doesn't degrade performance.
cc @wesleywiser
The method relied on the FileMap still being under construction in
order for it to do what the name promises. It's now independent of
the current state.