Any way to fix these popups when debugging in Visual Studio Code?

VisualStudioError

When stepping into a function, these popups often appear.

Ideally I want to tell Visual Studio Code "Don't try to step into anything other than my code". I don't understand why it is looking in "c:\rustc...." ( the folder doesn't exist, and I don't think it ever existed, on my computer at least ).

Or at least, if it insists on stepping into library code, don't pop up these errors messages.

3 Likes

When compiling rustc the path to the source code is remapped to /rustc/<commit hash> for reproducible builds. I think you can set ""rust-analyzer.debug.sourceFileMap": "auto" to remap it to the local standard library source. feat: Automatically detect rust library source file map by vsrs · Pull Request #8624 · rust-lang/rust-analyzer · GitHub

1 Like

Thanks. I wasn't able to get that to work yet, what does seem to work is to put this in my launch.json file:

            "sourceFileMap": 
               { "/rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library" : 
                 "/Users/pc/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/library"
               },

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.