Fix sample program to compile in modern rust
Fix subtle error in caching during kind computation that could cause linear
values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.
Merge branch 'master' of https://github.com/mozilla/rust
Fix for issue 2174

The function that formats and prints the squigly line that hilights
errors counted tabs as spaces, which resulted in incorrect error
messages when tabs were used for indentation. This change compares
the highlight line with the previous line and inserts a tab instead
of a space whenever such a tab exists on the previous line. Note
that error messages will still highlight incorrectly when the
previous line include characters that require more than one utf8
code point, as mentioned in issue 3260.
Added related FIXME for 3260
oldmap: get rid of legacy _ref suffixes
rt: remove unused 'rust_compare_and_swap_ptr'. Closes #4836
oldmap: separate out the methods that need Copy
oldmap: rm unneeded unsafe
Remove trailing whitespace
libsyntax/attr.rs: switch from oldmap to LinearSet
librustc/back/rpath.rs: oldmap -> LinearSet
Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768
Issue #4830 fix
auto merge of #4848 : nikomatsakis/rust/issue-4821-bad-kind-computation, r=catamorphism

...ear

values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.

r? @catamorphism
auto merge of #4852 : Caseus/rust/issue-4836, r=brson

Simple removal of rust_compare_and_swap_ptr from rt, as per Issue #4836
fix typos in sample code, add enum to json encoder, add test case
json bugfixes
tidy
json bugfix