Files
rust/compiler/rustc_driver_impl
Nicholas Nethercote d1d3129ad1 Improve the "no space between flag name and value" warning
A command like `rustc -optimize a.rs` currently gives this:
```
warning: option `-o` has no space between flag name and value, which can be confusing

note: output filename `-o ptimize` is applied instead of a flag named `optimize`

help: insert a space between `-o` and `ptimize` if this is intentional: `-o ptimize`
```

A top-level warning, then a top-level note, then a top-level help.
Weird!

This commit converts the note and the help into children of the warning,
which looks better and matches how things are normally done, giving
this:
```
warning: option `-o` has no space between flag name and value, which can be confusing
  |
  = note: output filename `-o ptimize` is applied instead of a flag named `optimize`
  = help: insert a space between `-o` and `ptimize` if this is intentional: `-o ptimize`
```
Much better.
2026-09-12 11:07:16 +10:00
..
2026-08-21 10:35:02 +02:00
2024-10-06 18:08:28 +08:00

The driver crate is effectively the "main" function for the rust compiler. It orchestrates the compilation process and "knits together" the code from the other crates within rustc. This crate itself does not contain any of the "main logic" of the compiler (though it does have some code related to pretty printing or other minor compiler options).

For more information about how the driver works, see the rustc dev guide.