Versions: rustc 1.50 and rustc 1.52(nightly)

Installing rust

I followed the instructions on the install page of rust-land and ran rustup like this:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

It downloaded a dozen of archives (megabytes) and installed rust in home under ~/.cargo/bin.

Compiling rust from source

I used a Dell XPS 13 9350 and I compiled rust version 1.52, latest in the git repo with these commands:

./x.py build
./x.py install

x.py build took 1 hour and /x.py install took 1.5 hour to finish.

Code coverage

I decided to try code coverage, it is an unstable feature:

  • unstable compiler options are not available in the release version of rust (1.50)
  • when I compile with the options -Zprofile=y or -Zinstrument-coverage=y, it fails to compile

The compile error I get is:

error[E0463]: can't find crate for `profiler_builtins`
  |
  = note: the compiler may have been built without the profiler runtime

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.

To fix this error, read the instructions in the nightly unstable documentation.

Debugging

I compiled my code with rustc -Cdebuginfo=2 to emit the full debug information.

I have gdb 10.0 installed on my machine and when I run rust-gdb it starts gdb 10.0.

To debug, I use the command (my program is called h):

rust-gdb -tui h
  • when I put a breakpoint on main, it stops in library/std/src/rt.rs and the function is lang_start, it doesn't work as expected
  • when I put a breakpoint on a statement in main and run, it stops on the correct line

Stability

In Rust by example, I read:

Since Rust 1.45, the `as` keyword performs a *saturating cast* when casting from float to int.

Reading the release notes, I notice there are many features that are unstable, deprecated or changing.

It means my source code needs to be tested for each new release of rust and then time needs to be spent to fix the issues.

If one decides to not fix the issues, the specific rust version for the source code has to be keep available and multiple version of rust might be needed.

Conclusion

As of today, the cost of using rust is far too high compare to the benifits it gives. The system is too unstable and the tools are not mature.