We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81eef2d commit 10a584aCopy full SHA for 10a584a
compiler/rustc_trait_selection/src/errors.rs
@@ -1907,10 +1907,18 @@ impl Subdiagnostic for AddPreciseCapturingForOvercapture {
1907
diag: &mut Diag<'_, G>,
1908
_f: &F,
1909
) {
1910
+ let applicability = if self.apit_spans.is_empty() {
1911
+ Applicability::MachineApplicable
1912
+ } else {
1913
+ // If there are APIT that are converted to regular parameters,
1914
+ // then this may make the API turbofishable in ways that were
1915
+ // not intended.
1916
+ Applicability::MaybeIncorrect
1917
+ };
1918
diag.multipart_suggestion_verbose(
1919
fluent::trait_selection_precise_capturing_overcaptures,
1920
self.suggs,
- Applicability::MaybeIncorrect,
1921
+ applicability,
1922
);
1923
if !self.apit_spans.is_empty() {
1924
diag.span_note(
0 commit comments