File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/rustc_trait_selection/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1907,10 +1907,18 @@ impl Subdiagnostic for AddPreciseCapturingForOvercapture {
1907
1907
diag : & mut Diag < ' _ , G > ,
1908
1908
_f : & F ,
1909
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
+ } ;
1910
1918
diag. multipart_suggestion_verbose (
1911
1919
fluent:: trait_selection_precise_capturing_overcaptures,
1912
1920
self . suggs ,
1913
- Applicability :: MaybeIncorrect ,
1921
+ applicability ,
1914
1922
) ;
1915
1923
if !self . apit_spans . is_empty ( ) {
1916
1924
diag. span_note (
You can’t perform that action at this time.
0 commit comments