File not being compiled without error

I am very new to rust and am trying to setup the environment, but rustc ./main.rs followed by ./main.rs doesn't show the new code, I have to run it manually and can't run with terminal. My code is a simple "hello world" code: fn main() { println!("Hello, wo!"); }

I use a mac if that helps

Are you saying you're trying to run the compile program by executing ./main.rs in a command shell?

yes, anything I change in the code doesnt change in the output

sorry no i meant ./main

cargo build then cargo run doesn't work either, but if I run without debugging in vscode I can run it.

When you try to run, are any errors output?

Please provide complete reproducible steps.