SI-7167 implicit macros decide what is divergence

This is a port of https://github.com/scala/scala/commit/8168f118c9 from 2.10.x,
with an additional change to the `enclosingImplicits` and `openImplicits` APIs,
which encapsulates tuples of `pt` and `tree` into `ImplicitCandidate`.
SI-7047 fixes silent for c.inferImplicitXXX

This is a port of https://github.com/scala/scala/commit/b4da864247 from 2.10.x.
removes duplication in inferImplicitValue

This is a port of https://github.com/scala/scala/commit/4e64a2731d from 2.10.x.