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
This seems a little odd because `B` just isn't a type at all, but it's certainly better than today!