Skip to content

Commit a60177c

Browse files
committed
Lint only exported must_use_candidates
1 parent 61b19a1 commit a60177c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/functions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ fn check_must_use_candidate<'a, 'tcx>(
449449
|| mutates_static(cx, body)
450450
|| in_external_macro(cx.sess(), item_span)
451451
|| returns_unit(decl)
452+
|| !cx.access_levels.is_exported(item_id)
452453
|| is_must_use_ty(cx, return_ty(cx, item_id))
453454
{
454455
return;

0 commit comments

Comments
 (0)