Gracefully handle non-UTF-8 string slices when pretty printing Fixes #78520.
For more information about how rustc works, see the rustc dev guide.