Shorten trimmed display of closures
When `with_forced_trimmed_paths` is used, only print filename and start of the closure's span, to reduce their verbosity.
This commit is contained in:
parent
30ae261c42
commit
4d4d4786f9
6 changed files with 28 additions and 8 deletions
|
@ -259,6 +259,10 @@ impl RealFileName {
|
|||
FileNameDisplayPreference::Remapped => {
|
||||
self.remapped_path_if_available().to_string_lossy()
|
||||
}
|
||||
FileNameDisplayPreference::Short => self
|
||||
.local_path_if_available()
|
||||
.file_name()
|
||||
.map_or_else(|| "".into(), |f| f.to_string_lossy()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -302,6 +306,9 @@ pub enum FileNameDisplayPreference {
|
|||
/// Display the path before the application of rewrite rules provided via `--remap-path-prefix`.
|
||||
/// This is appropriate for use in user-facing output (such as diagnostics).
|
||||
Local,
|
||||
/// Display only the filename, as a way to reduce the verbosity of the output.
|
||||
/// This is appropriate for use in user-facing output (such as diagnostics).
|
||||
Short,
|
||||
}
|
||||
|
||||
pub struct FileNameDisplay<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue