"Cannot find declaration to go to" in Clion


#1

It’s my first rust project. This is my project-index in Clion:
rust%20index
“card”,“card_ana” are many related “class”(OOP class). I separate them into several .rs files, and use include! macro to get them work together(just like c++).
But I find “go to xx” of Clion only work in main.rs. If I use “ctrl + left mouse” on Vec::new, it jump to “vec.rs” in main.rs but doesn’t work in other .rs file…


#2

Don’t use include!, but rather properly declare the modules and use them.

Please see https://doc.rust-lang.org/book/ch07-02-modules-and-use-to-control-scope-and-privacy.html to learn more.


#4

You definitely need to read the book because you are missing keyparts of rust, e.g. how to include other files.