File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/tools/clippy/clippy_lints/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,10 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
154154 return ;
155155 }
156156
157- let mir = cx. tcx . optimized_mir ( def_id) ;
157+ let mir = cx. tcx . mir_drops_elaborated_and_const_checked ( def_id) ;
158158
159- if let Ok ( ( ) ) = is_min_const_fn ( cx. tcx , mir, & self . msrv )
160- && let hir:: Node :: Item ( hir:: Item { vis_span, .. } ) | hir:: Node :: ImplItem ( hir:: ImplItem { vis_span, .. } ) =
159+ if let Ok ( ( ) ) = is_min_const_fn ( cx. tcx , & mir. borrow ( ) , & self . msrv )
160+ && let hir:: Node :: Item ( hir:: Item { vis_span, .. } ) | hir:: Node :: ImplItem ( hir:: ImplItem { vis_span, .. } ) =
161161 cx. tcx . hir_node_by_def_id ( def_id)
162162 {
163163 let suggestion = if vis_span. is_empty ( ) { "const " } else { " const" } ;
You can’t perform that action at this time.
0 commit comments