DiagnosticBuilder
emit
To avoid the use of a mutable local variable, and because it reads more nicely.
gen
For more information about how rustc works, see the rustc dev guide.