[Bug] Hardcoded Rust analyzer target directory ignores cargo config target-dir setting
Resolved 💬 2 comments Opened Jan 19, 2026 by 40tude Closed Feb 27, 2026
Bug Description
In a Rust project. It seems claude code generates target\rust-analyzer\flycheck0\stderr and target\rust-analyzer\flycheck0\stdout. I believe the paths are hardcoded. Indeed in the .cargo/config.toml file I use target-dir = <PATH> so I expect stderr et stdout to be created in <PATH>/target\rust-analyzer\flycheck0\stderr and <PATH>/target\rust-analyzer\flycheck0\stdout
Environment Info
- Platform: win32
- Terminal: vscode
- Version: 2.1.12
- Feedback ID: 884629df-0cf7-4e69-bb6c-5ec6b9b60cdb
Errors
[{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\Cargo.toml, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\cargo.toml/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1652:624)\n at async It5 (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2700:19680)","timestamp":"2026-01-19T16:34:58.075Z"},{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\test00\\Cargo.toml, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\test00\\cargo.toml/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1652:624)\n at async It5 (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2700:19680)","timestamp":"2026-01-19T16:35:06.936Z"},{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\demo\\src\\lib.rs, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\demo\\src\\lib.rs/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1658:2641)\n at async It5 (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2700:19680)","timestamp":"2026-01-19T16:35:23.512Z"},{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\Cargo.toml, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\cargo.toml/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1652:624)\n at async It5 (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2700:19680)","timestamp":"2026-01-19T16:36:46.003Z"},{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\src\\lib.rs, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\src\\lib.rs/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1652:624)\n at async It5 (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2700:19680)","timestamp":"2026-01-19T16:36:55.429Z"},{"error":"U42: Diagnostics file path mismatch: expected C:\\Users\\phili\\OneDrive\\Documents\\Programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\src\\lib.rs, got file://c:\\users\\phili\\onedrive\\documents\\programmation\\rust\\01_xp\\038_dip_101\\test00\\order\\src\\lib.rs/)\n at rj.beforeFileEdited (file:///C:/Users/phili/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1268:33702)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///C:/Users
Note: Error logs were truncated.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗