SI-6642 Adds iteratorFrom, keysIteratorFrom, and valuesIteratorFrom

Adds the ability to efficiently create an iterator that starts at a
given key or element of a sorted set or map. Similar work is done for
key and value only iterators on maps.

The bulk of the work is in RedBlackTree. Most of the rest is pushing
the new api methods throughout the appropriate spots in the collection
API.

This commit leaves undone some similar work possible on mutable TreeSets
SI-6642 Refactor mutable.TreeSet to use RedBlackTree instead of AVL

There was no reason to have mutable.TreeSet use AVLTree while
immutable.TreeSet and immutable.HashSet used RedBlackTree. In
particular that would have meant duplicating the iteratorFrom logic
unnecessarily. So this commit refactors mutable.TreeSet to use
RedBlackTree for everything, including iteratorFrom. It also adds
a test to make sure TreeSet works as expected.

AVLTree should be dead code since it's private[scala.collection.mutable]
and only used by mutable.TreeSet, but to be safe it's only deprecated
in this commit.
SI-6642 Code cleanup from review of iteratorFrom

This commit is code cleanup from the review on
https://github.com/scala/scala/pull/2119

* Changes several instances of
    def f[A, ]… to
    def f[A]…
* Changes several instances of
    def f[A](…)(implicit ordering : Ordering[A])… to
    def f[A: Ordering](…)…
* Changes one instance of
    x == null to
    x eq null
* Changes two instances of
    id + bottomid to
    bottomid + id
SI-7120 Erasure must honor typeref prefixes

Erasure was discarding these, which led to unnecessarily
wide types in quite particular circumstances. This showed
up as a double definition error in the reported bug when the
bridge method clashed with the erased signature.
SI-7128 Fix regression in copyToArray for empty arrays
Fix SI-7130: Memory leaked caused by Statistics

As described in the ticket, we were leaking memory by holding reference
to Global through by-name argument that was captured by an instance of
a class stored in global HashMap `qs`.

The fix is simple: do not register quantities in HashMap unless statistics
is enabled. This way, if Statistics is disabled we do not store any
references.

We still leak memory in case of statistics being enabled.
SI-7134: don't require doc.Settings in base api of scaladoc.
make Future scaladoc examples up-to-date and compilable
remove unused imports
SI-5744 evidence params are now SYNTHETIC

The macro def <-> macro impl correspondence check compares names of the
corresponding parameters in def and impl and reports an error if they
don't match. This was originally designed to avoid confusion w.r.t named
arguments (which ended up being never implemented as described in SI-5920).

Sometimes parameter names are generated by the compiler, which puts the
user in a tough position. Luckily, there's an escape hatch built it, which
omits the name correspondence check if one of the parameters is SYNTHETIC.
Everything went well until we realized that evidences generated by
context bounds aren't SYNTHETIC, which led to the bug at hand.

Marking auto-generated evidence parameters SYNTHETIC was only the first
step, as the correspondence checker uses parameter symbols, not parameter
trees. Why's that a problem? Because SYNTHETIC doesn't get propagated from def
trees to their underlying symbols (see ValueParameterFlags).

Unfortunately one cannot just change ValueParameterFlags, because that
would break printouts generated in TypeDiagnostics, which is designed to not
print synthetic symbols. Thus we modify methodTypeErrorString in
TypeDiagnostics to always print synthetic symbols.

Therefore now we propagate all paramSym.flags when doing correspondent sweeps
to keep them in sync between def trees and their underlying symbols. This
fixes the problem.
Shadowed Implict typo (fixes no issue)
resetAttrs now always erases This.tpe

The symbol of This, if it points to a package class, isn't touched, just
as usual, so that our Select(Select(Select(...))) => This(...) optimization
works fine with attr reset.

However the tpe is now erased, so that subsequent reflective compilation
doesn't spuriously fail when seeing that some subtrees of a tree being
compiled are typed.

Erasing the tpe doesn't pose even a tiniest problem, because, as it can
be seen in typedThis, type is trivially reconstructed from the symbol.
Merge pull request #2132 from u-abramchuk/SI5744

SI-5744 evidence params are now SYNTHETIC
Removing disabled, unneeded futures tests
Additional test case for Lukas' fix to annotated originals.

This was inspired by the regression that Mark encountered
when upgrading SBT from 2.10.0 to 2.10.1-RC1.
Merge pull request #1 from retronym/topic/annotatedRetyping-test

Additional test case for Lukas' fix to annotated originals.
unit test ide-t1000567 exercises SI-5063, aka #1000567.
SI-7143 Fix scanner docComment: docBuffer and docPos are initialized
in different places and as a result can get out of sync and as a result
the invariant that docComment has a position is broken.
SI-6576 Workaround / diagnostic for IDE NPE.

Seems like this was too optimistic:

> // later by lukas: disabled when fixing SI-5975
> // i think it cannot happen anymore

 - restored the null check
 - added logging when we set the namer in this attachment,
   in the hope of spotting a pattern in the wild.

We don't have a test case yet; if we did we could most likely
have a more principled fix. But this should suffice for 2.10.1.
Merge pull request #2131 from jozic/scaladoc-cleanup

make Future scaladoc examples up-to-date and compilable