Skip to content

Reading diagnostics ​

When something is wrong, the compiler says what, where and what to change, in the layout rustc and ruff use.

text
error[name.unknown_reference]: Navigate.goal: nothing named 'gaol' matches @world/<goal or entity>
  --> demo.task:3:25
  |
3 |         Navigate(goal = @world/gaol)
  |                         ^^^^^^^^^^^ not declared
  |
  = help: did you mean 'goal'?
PartSays
error[name.unknown_reference]The level and the code. The code is stable; tools and tests match on it.
The messageThe cause, in one sentence.
--> demo.task:3:25The file, line and column of the cause.
The excerptThe source line, with the exact bytes underlined.
= help:What to change.
= note:The facts the decision rested on.

The cause can be in a library as well as in the program: a problem with a part points into its component.yaml.

Errors and warnings ​

An error blocks: nothing is written. A warning does not. A validation rule that cannot decide, usually because a part does not state something, says so as a warning at the place it points at, and the summary counts it undecided:

text
warning[validation.assembly.footprint_known]: cannot decide: part 'imu_basic' of 'imu' declares no collision box, so the footprint may be larger than the known shapes
   --> demo.core:22:5
   |
22 |     IMU imu(ref = "imu_basic", glue = (0, 0.0001, 0.0344, 0, 0, -1))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no collision shape
   |
   = help: add a `collision` box to the part's component.yaml
   = note: evidence: x in [-0.177, 0.177] m, y in [-0.173, 0.173] m from chassis, pack, driver_l, driver_r, motor_lf, motor_lb, motor_rf, motor_rb, wheel_lf, wheel_lb, wheel_rf, wheel_rb

Checked demo.core demo.world demo.task (14 checks, 1 undecided)

--warnings-as-errors makes every warning block, and each one says so in a note.

Everything at once ​

The parser stops at the first syntax error. Every later phase checks the whole program and reports every problem it finds, so one compile shows everything it can:

text
error[validation.assembly.wheel_mounts_filled]: the shaft of 'motor_lf' carries no wheel
   --> demo.core:12:5
   |
12 |     Motor motor_lf(ref = "gearmotor_37d", glue = (0.1275, 0.1294, -0.0216, 0, 1, 0), command = @core/driver_l)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nothing on its shaft
   |
   = help: glue a wheel onto its shaft with glue = (0.1275, 0.1494, -0.0216, 0, 1, 0)
   = note: evidence: 4 motors drive 3 wheels on 4 drive mounts; 0 free wheels on 0 free wheel mounts

error[validation.assembly.glue_on_connector]: the glue of 'wheel_lf' matches no connector of the chassis or of a placed part; the nearest is 'motor_lf.shaft', 0.008 m away with direction cosine 1.00
   ...

error: 2 errors; demo.core demo.world demo.task did not compile

One misplaced wheel produced both: the glue matches no connector, so the motor's shaft it was meant for carries nothing.

For tools ​

--json writes the whole result to stdout: every diagnostic, every validation rule with its status and evidence, the robot as the compiler put it together (its parts and the facts the rules read), and the files written. --color never turns colour off; it is also off when NO_COLOR is set or the output is not a terminal.

Exit statusMeans
0Nothing blocked; warnings may have been printed
1A diagnostic blocked
2The command line itself was wrong

Diagnostics in the reference specifies every field and code.

Next ​

Running the output explains what the compiler writes and how to launch it.