Use local and remapped paths where appropriate

This commit is contained in:
Andy Wang 2021-04-19 23:27:02 +01:00
parent fb4f6439f6
commit 5417b45c26
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374
28 changed files with 85 additions and 74 deletions

View file

@ -188,8 +188,10 @@ pub fn maybe_file_to_stream(
override_span: Option<Span>,
) -> Result<(TokenStream, Vec<lexer::UnmatchedBrace>), Vec<Diagnostic>> {
let src = source_file.src.as_ref().unwrap_or_else(|| {
sess.span_diagnostic
.bug(&format!("cannot lex `source_file` without source: {}", source_file.name));
sess.span_diagnostic.bug(&format!(
"cannot lex `source_file` without source: {}",
source_file.name.prefer_local()
));
});
let (token_trees, unmatched_braces) =