File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -200,16 +200,14 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustiveEnum {
200200 enum_span,
201201 "this seems like a manual implementation of the non-exhaustive pattern" ,
202202 |diag| {
203- if !cx. tcx . adt_def ( enum_id) . is_variant_list_non_exhaustive ( )
204- && let header_span = cx. sess ( ) . source_map ( ) . span_until_char ( enum_span, '{' )
205- && let Some ( snippet) = snippet_opt ( cx, header_span)
206- {
207- diag. span_suggestion (
208- header_span,
209- "add the attribute" ,
210- format ! ( "#[non_exhaustive] {snippet}" ) ,
211- Applicability :: Unspecified ,
212- ) ;
203+ let header_span = cx. sess ( ) . source_map ( ) . span_until_char ( enum_span, '{' ) ;
204+ if let Some ( snippet) = snippet_opt ( cx, header_span) {
205+ diag. span_suggestion (
206+ header_span,
207+ "add the attribute" ,
208+ format ! ( "#[non_exhaustive] {snippet}" ) ,
209+ Applicability :: Unspecified ,
210+ ) ;
213211 }
214212 diag. span_help ( variant_span, "remove this variant" ) ;
215213 } ,
You can’t perform that action at this time.
0 commit comments