After completing Ruby and F# koans, I’ve begun on Rust koans since I’ve been away from Rust for a while. However, immediately after beginning, I experienced rampant “This rust file does not belong to a loaded cargo project” errors in VS Code, basically each time I typed something.

After looking into the issue, I came across a rust analyzer GitHub issue that contains a simple workaround, which I’ll summarize below, adapted for the Rust koans repository:

  1. Add mod koans to main.rs
  2. Create a new file in the src directory named koans.rs

This was sufficient to resolve the issue for me.


<
Previous Post
F# Koans
>
Next Post
Bookmarklet: Toggle GitHub PR comment visibility