mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-12 20:00:31 +00:00
fix: Clarify error messages when proc-macro-srv changes working directory
I'm investigating issues where users see a load of logs of the form:
```
Failed to set the current working dir to /redacted/path. Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
```
This is tricky to debug because there's two different code paths that
write exactly the same error message. Ensure they're unique.
This commit is contained in:
parent
8ed3cca4d3
commit
535783c2c5
@ -328,7 +328,7 @@ impl<'snap> EnvChange<'snap> {
|
||||
let prev_working_dir = std::env::current_dir().ok();
|
||||
if let Err(err) = std::env::set_current_dir(dir) {
|
||||
eprintln!(
|
||||
"Failed to set the current working dir to {}. Error: {err:?}",
|
||||
"Failed to change the current working dir to {}. Error: {err:?}",
|
||||
dir.display()
|
||||
)
|
||||
}
|
||||
@ -370,7 +370,7 @@ impl Drop for EnvChange<'_> {
|
||||
&& let Err(err) = std::env::set_current_dir(dir)
|
||||
{
|
||||
eprintln!(
|
||||
"Failed to set the current working dir to {}. Error: {:?}",
|
||||
"Failed to change the current working dir back to {}. Error: {:?}",
|
||||
dir.display(),
|
||||
err
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user