diff options
| author | Michael Goulet <michael@errs.io> | 2025-04-06 23:37:30 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-04-07 20:48:40 +0000 |
| commit | effef88ac70f2d12229b77b8e428037df8028b7e (patch) | |
| tree | d120831677ff170df3a2a3538693a070a0bc83d2 /compiler/rustc_middle/src/ty | |
| parent | e643f59f6da3a84f43e75dea99afaa5b041ea6bf (diff) | |
| download | rust-effef88ac70f2d12229b77b8e428037df8028b7e.tar.gz rust-effef88ac70f2d12229b77b8e428037df8028b7e.zip | |
Simplify temp path creation a bit
Diffstat (limited to 'compiler/rustc_middle/src/ty')
| -rw-r--r-- | compiler/rustc_middle/src/ty/error.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/mod.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs index a0e67929c52..5ecf1174def 100644 --- a/compiler/rustc_middle/src/ty/error.rs +++ b/compiler/rustc_middle/src/ty/error.rs @@ -279,7 +279,7 @@ impl<'tcx> TyCtxt<'tcx> { p.hash(&mut s); let hash = s.finish(); *path = Some(path.take().unwrap_or_else(|| { - self.output_filenames(()).temp_path_ext(&format!("long-type-{hash}.txt"), None) + self.output_filenames(()).temp_path_for_diagnostic(&format!("long-type-{hash}.txt")) })); let Ok(mut file) = File::options().create(true).read(true).append(true).open(&path.as_ref().unwrap()) diff --git a/compiler/rustc_middle/src/ty/print/mod.rs b/compiler/rustc_middle/src/ty/print/mod.rs index 5904deaaaad..9172c5d3ab7 100644 --- a/compiler/rustc_middle/src/ty/print/mod.rs +++ b/compiler/rustc_middle/src/ty/print/mod.rs @@ -382,7 +382,7 @@ pub fn shrunk_instance_name<'tcx>( return (s, None); } - let path = tcx.output_filenames(()).temp_path_ext("long-type.txt", None); + let path = tcx.output_filenames(()).temp_path_for_diagnostic("long-type.txt"); let written_to_path = std::fs::write(&path, s).ok().map(|_| path); (shrunk, written_to_path) |
