Merge remote-tracking branch 'origin/2.10.2' into merge/2.10.2-to-2.10.x

Better late than never.

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
SI-7486 More tests for cycles triggered by implicit search

Moved an existing test from `pending` to `pos`. Not sure why
it was moved to `pending` in the first place.

Adds a new test distilled from building Scalaz with 2.10.3-RC1.
SI-7407 fixed in GenBCode but beware, it remains a bug in GenASM

GenBCode runs only under a flag, and moreover only if -optimise
is not present (see ScalaSettings for details).

Therefore during a nightly, when tests are run under -optimise,
we need -Ynooptimise to deactivate the optimizer.
With that, GenBCode can run and tackle the test case successfuly.
GenBCode: decouple ClassNode building from classfile writing

This commit and two follow-up commits (recognizable because
of the starting words "decouple this from that" in the commit message)
are baby steps towards pipelining of class building and class writing,
ie allowing class building (which requires typer) and "the rest"
which doesn't) to run in parallel.

The commits have been broken up following a previous review comment.
GenBCode: decouple ClassNode building from encoding as byte array

To recap from the previous commit, another baby step towards
pipelining of class building and class writing.

Implementing similar functionality in GenASM is up for grabs,
see https://issues.scala-lang.org/browse/SI-6164
GenBCode: decouple ClassDef traversing from ClassNode building

In keeping with the baby steps towards pipelining of
class building and class writing, this commit gets one step closer
to that. Only thing missing: the actual thread-pool.
That will be the focus of an upcoming commit.
Use scala-partest 1.0-RC4

RC3 had a binary incompatibility that led to a crash in parsing options,
due to:
- https://github.com/scala/scala-partest/commit/9ff138ab4b
- https://github.com/scala/scala/commit/2b1563fa74

Also added sonatype as a repo for resolving partest,
so we don't have to wait for artifacts to synch to maven central.
Merge pull request #2862 from adriaanm/partest-1.0-RC4

Use scala-partest 1.0-RC4
SI-7622 Phase assembly is testable

Fixing hash on nodes makes fault detection deterministic,
which aids testing.

Error messages are shortened and .dot files are dumped
automatically on faults to guard against future flakiness.
SI-7622 -Xgenerate-phase-graph is an info option

-Xgenerate-phase-graph is comparable to -Xshow-phases.

The knowledge about what is an info-only option is refactored
to Settings, which also knows which group of options comprise
the optimiser set.
SI-7622 Phases are enabled or not

Refactor the calculation of the "phase chain" a bit.
In particular, initial and terminal phases are not special
except that they must be head and last.

When done, filter for enabled phases. At this commit,
nobody claims to be disabled.

Additional sanity support of phases settings.
SI-7622 -Xshow-phases can show disabled phases

With -Ydebug, -Xshow-phases will show phases that are skipped
or not enabled.

The code is slightly refactored, so the flags table will also benefit.
SI-7622 Plugins can be not enabled

Plugins can interrogate options and declare themselves not
enabled.  The plugin itself can return false from its init
if the options do not compute.  A plugin phase component
can declare itself not enabled, same as an internal phase.

No one exploits this facility at this commit.
SI-7622 Clean Up Phase Assembly

Let optimiser components and continuations plugin opt-out
when required flags are not set.

Wasted time on a whitespace error in check file, so let
--debug dump the processed check file and its diff.
SI-7622 Scaladoc and error message polish

Restores the verbiage "run right after".
Merge pull request #2810 from xeno-by/topic/compile-time-only

@compileTimeOnly: moved to scala-library.jar, got some fixes
Merge pull request #2852 from retronym/ticket/1980-warning

SI-1980 A lint warning for by-name parameters in right assoc methods
SI-6240 Synchronizes Names

Previously we didn't have all possible name creation facilities covered
with locks, so some of them silently misbehaved and caused much grief:
http://groups.google.com/group/scala-internals/browse_thread/thread/ec1d3e2c4bcb000a.

This patch gets all the name factories under control.

Rather than relying on subclasses to override mutating methods
and add synchronization, they should instead override `synchronizeNames`
to return true and leave the placement of the locks up to
`reflect.internal.Names`.

These locks are placed around sections that mutate `typeHashtable`
and `termHashtable`.

This is done in the reflection universe, and in the interactive
compiler. The latter change will obviate an incomplete attempt
do to the same in `ScalaPresentationCompiler` in the scala-ide
project.
Fix typo in sample code in scaladoc for package scala.sys.process
SI-942 A test case, five years adrift.

I'm looking at the changes made in 47f35b587, which
prevented cyclic errors in class file parsing. That fix
is insufficient for, or otherwise complicit in, SI-7778, for
which I've enclosed a pending test.