Macros

  • forward 🔒
    In general, the DiagnosticBuilder uses deref to allow access to the fields and methods of the embedded diagnostic in a transparent way. However, many of the methods are intended to be used in a chained way, and hence ought to return self. In that case, we can’t just naively forward to the method on the diagnostic, because the return type would be a &Diagnostic instead of a &DiagnosticBuilder<'a>. This forward! macro makes it easy to declare such methods on the builder.

Structs

  • Marker type which enables implementation of create_bug and emit_bug functions for bug diagnostics.
  • Used for emitting structured error messages and other diagnostic information.
  • Marker type which enables implementation of create_fatal and emit_fatal functions for fatal diagnostics.

Enums

Traits

  • Trait for types that DiagnosticBuilder::emit can return as a “guarantee” (or “proof”) token that the emission happened.
  • Trait implemented by error types. This is rarely implemented manually. Instead, use #[derive(Diagnostic)] – see rustc_macros::Diagnostic.