Skip to content

Commit ec5328b

Browse files
committed
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). Signed-off-by: David Wood <[email protected]>
1 parent 5a12a89 commit ec5328b

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)