Improve errors for recursive type aliases Fixes #17539.
For more information about how rustc works, see the rustc dev guide.