Skip to content

Commit e9aa254

Browse files
authored
Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nnethercote
errors: only eagerly translate subdiagnostics Subdiagnostics don't need to be lazily translated, they can always be eagerly translated. Eager translation is slightly more complex as we need to have a `DiagCtxt` available to perform the translation, which involves slightly more threading of that context. This slight increase in complexity should enable later simplifications - like passing `DiagCtxt` into `AddToDiagnostic` and moving Fluent messages into the diagnostic structs rather than having them in separate files (working on that was what led to this change). r? ```@nnethercote```
2 parents 64dfa4f + ec5328b commit e9aa254

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for TargetFeatureDisableOrEnabl
122122
diag.span(span);
123123
};
124124
if let Some(missing_features) = self.missing_features {
125-
diag.subdiagnostic(missing_features);
125+
diag.subdiagnostic(dcx, missing_features);
126126
}
127127
diag.arg("features", self.features.join(", "));
128128
diag

0 commit comments

Comments
 (0)