I am from CodinGame.com where we have rust support for our programming games. For various reasons (no internet access from chroot, speed of execution) we are using rustc directly (i.e. not through Cargo).
I could not find a way to pass the "edition=2018" option from the Cargo.toml file to rustc. Does anyone have an idea what rustc flag to use to compile in "2018" mode?
% rustc --version
rustc 1.35.0-nightly (3eb4890df 2019-03-19)
% rustc --help -v | grep edition
--edition 2015|2018
Specify which edition of the compiler to use when
Thank you @dekellum for reminding me to do a --version . That was the root cause of my problem: I was looking at the help from the previous version, so could not find the edition flag. How stupid!
Thank you @kyrias for the cargo build -v tip. It will be very helpful moving forward.
@shepmaster, does this mean that some crates were preinstalled on the playground? I could use "rand" for example from the playground. So I am curious on how you did this.
Basically, we pre-build all the crates we care about on a Docker image. This step has network access. At user submission time, we start the container without network access, pass the user input in, compile and run it.