This PR makes rust-script not generate the source file in the package directory if possible, and let Cargo.toml refer to the given script file as the binary source path in that case. This will let cargo check on the package directory output the original file path instead of the generated one, which makes rust-analyzer correctly treat it in fly check.
Context: https://github.com/fornwall/rust-script/issues/11#issuecomment-1516408804
This PR makes
rust-script
not generate the source file in the package directory if possible, and letCargo.toml
refer to the given script file as the binary source path in that case. This will letcargo check
on the package directory output the original file path instead of the generated one, which makesrust-analyzer
correctly treat it in fly check.