To reduce duplication. A follow-up commit will begin using it in even more places.
The `rustc_span::FileName` enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`.