Rollup merge of #80859 - jsgf:fix-pretty-remap, r=davidtwco
Fix --pretty=expanded with --remap-path-prefix Per https://github.com/rust-lang/rust/issues/80832, using --pretty=expanded and --remap-path-prefix results in an ICE. This is becasue the session source files table is stored in remapped form, whereas --pretty-expanded looks up unremapped files. This remaps the path prefixes before lookup. ~~There don't appear to be any existing tests for --pretty=expanded; I'll look into adding some.~~ Never mind, found the pretty tests. Fixes #80832
This commit is contained in:
commit
7ce8246a23
4 changed files with 43 additions and 3 deletions
|
@ -363,8 +363,15 @@ impl<'tcx> pprust_hir::PpAnn for TypedAnnotation<'tcx> {
|
|||
|
||||
fn get_source(input: &Input, sess: &Session) -> (String, FileName) {
|
||||
let src_name = input.source_name();
|
||||
let src =
|
||||
String::clone(&sess.source_map().get_source_file(&src_name).unwrap().src.as_ref().unwrap());
|
||||
let src = String::clone(
|
||||
&sess
|
||||
.source_map()
|
||||
.get_source_file(&src_name)
|
||||
.expect("get_source_file")
|
||||
.src
|
||||
.as_ref()
|
||||
.expect("src"),
|
||||
);
|
||||
(src, src_name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue