Skip to content

Commit

Permalink
Auto merge of #4886 - rust-lang:must-use-pub-only, r=phansch
Browse files Browse the repository at this point in the history
Lint only exported must_use_candidates

As promised on #4779, here's the check for publicly visible items for `must_use_candidate`

changelog: none
  • Loading branch information
bors committed Dec 11, 2019
2 parents b245fbd + a60177c commit 221bf65
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clippy_lints/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ fn check_must_use_candidate<'a, 'tcx>(
|| mutates_static(cx, body)
|| in_external_macro(cx.sess(), item_span)
|| returns_unit(decl)
|| !cx.access_levels.is_exported(item_id)
|| is_must_use_ty(cx, return_ty(cx, item_id))
{
return;
Expand Down

0 comments on commit 221bf65

Please sign in to comment.