[backport] the scanner is now less eager about deprecations

Backport of https://github.com/scala/scala/pull/1807