Files
rust/compiler/rustc_driver_impl
Nicholas Nethercote d571cae83e Minimize DiagCtxt methods
We have `DiagCtxt`, `DiagCtxtInner`, and `DiagCtxtHandle`. They're all
necessary, but the method placement is inconsistent. This commit
establishes a clearer rule: methods should *not* go on `DiagCtxt`
whenever possible.

Benefits:

- Simpler rule for deciding where to put a method.

- `impl Deref for DiagCtxtHandle` can be removed, including its
  non-standard double-reference `&&'a DiagCtxt` return value.
  This makes it impossible to accidentally discard a taint target by
  calling `handle` on a `DiagCtxtHandle`.

- Catches some places where we were calling `dcx.handle()` when `dcx`
  was already a handle.
2026-09-08 15:25:09 +10:00
..
2026-09-08 15:25:09 +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.