File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
compiler/rustc_hir_analysis/src Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -126,12 +126,14 @@ pub enum AssocItemNotFoundSugg<'a> {
126
126
assoc_kind : & ' static str ,
127
127
suggested_name : Symbol ,
128
128
} ,
129
- #[ suggestion( hir_analysis_assoc_item_not_found_other_sugg, code = "{suggested_name}" ) ]
129
+ #[ suggestion(
130
+ hir_analysis_assoc_item_not_found_other_sugg,
131
+ code = "{suggested_name}" ,
132
+ applicability = "maybe-incorrect"
133
+ ) ]
130
134
Other {
131
135
#[ primary_span]
132
136
span : Span ,
133
- #[ applicability]
134
- applicability : Applicability ,
135
137
ty_param_name : & ' a str ,
136
138
assoc_kind : & ' static str ,
137
139
suggested_name : Symbol ,
Original file line number Diff line number Diff line change @@ -269,20 +269,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
269
269
}
270
270
271
271
// If we still couldn't find any associated item, and only one associated item exists,
272
- // suggests using it.
272
+ // suggest using it.
273
273
if let [ candidate_name] = all_candidate_names. as_slice ( ) {
274
- // This should still compile, except on `#![feature(associated_type_defaults)]`
275
- // where it could suggests `type A = Self::A`, thus recursing infinitely.
276
- let applicability =
277
- if assoc_kind == ty:: AssocKind :: Type && tcx. features ( ) . associated_type_defaults {
278
- Applicability :: Unspecified
279
- } else {
280
- Applicability :: MaybeIncorrect
281
- } ;
282
-
283
274
err. sugg = Some ( errors:: AssocItemNotFoundSugg :: Other {
284
275
span : assoc_name. span ,
285
- applicability,
286
276
ty_param_name,
287
277
assoc_kind : assoc_kind_str,
288
278
suggested_name : * candidate_name,
You can’t perform that action at this time.
0 commit comments