[RustRover] Println!() and function call()

Continuing the discussion from Trying understand functions lifetimes:
In Rustrover

fn main() {
   let x= 6;
   println!(" first call foo() = {:?}", foo(x));
   println!(" Second call foo() = {:?}", foo(x));
}
fn foo(r:i32)-> i32 { r }

output:

 first call foo() = 6
 Second call foo() = 6
fn main() {
   let x= 6;
   println!(" first call foo() = {:?}", foo(x));
  // println!(" Second call foo() = {:?}", foo(x));
}
fn foo(r:i32)-> i32 { r }

output error message

/*
error: could not execute process `target\debug\fn0.exe` (never executed)
*/

Sorry, it’s not clear what your question is, or how it’s related to that previous post.

Both of these programs compile and run successfully. If you’re getting an error, can you describe exactly what you did that led to the error (including which commands you ran, and what the inputs and source files were)?

1 Like

Thanks sir. I use RustRover. I checked a few times. I get the same behaviour. I did not try on command line. I will do it, Sir, and report

Thank you Sir, Both work fine on command line Cargo. But fail for single println!() in Rustrover. Can you kindly check in Rustrover, Sir if you do not mind.

Rustrover is a commercial product, so to get help you may have better luck filing an issue with Jetbrains, or searching for an existing issue.

Note that Rustrover does not use RustAnalyzer in their IDE. Many other editors (Vim, Emacs, Helix, VSCode) can be configured to use RustAnalyzer, and this is what many people here are doing. So the code (bugs, behavior, etc) is different in Rustrover than what many people here are using.

1 Like

Thank you, Sir.

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.