Println in core library and fast compile

Hi, I'm new to Rust and try print variables from library/core/src/slice/sort.rs. I have two questions;

  1. How to do this? println!/debug!/dbg! don't seem to work.
  2. How to get a working compiler fast? I tried ./x.py --stage 0 etc. but it is still very slow.
1 Like

printf works in core and alloc, format! only works in alloc. It seems the best way is to rip the code to be debugged out into a crate and use the usual println! there.

From an answer in Zulip:

  1. x.py setup, then choose library
  2. x.py build -j22 finished in 13 seconds after an edit.

Use std if you don’t need a freestanding binary. Don’t print variables or use native ways (bios api, for example) if you need a freestanding binary.

Also you’ve picked the wrong forum. You need URLO

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.