Add error message for anonymous impl for types not declared in the current module

Followup to RFC 57.

Fixes #7607
Fixes #8767
Fixes #12729
Fixes #15060
Can you suggest a better wording? As I recall the problem is that imports are not yet resolved, so we cannot distinguish the case when the user has `use mymod::B` and `B` actually is a type.