Skip to content

Rollup of 8 pull requests #141944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jun 3, 2025
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
200d742
Clarify &mut-methods' docs on sync::OnceLock
lukaslueg May 6, 2025
f023a69
Async drop - type instead of async drop fn and incorrect drop signatu…
azhogin May 28, 2025
bb063e6
Factor out repeated code into `is_mod_inherent`.
nnethercote May 29, 2025
176c34a
Invert the sense of `is_not_macro_export`.
nnethercote May 29, 2025
c5e758d
Fixed a typo in `ManuallyDrop`'s doc
neeko-cat Jun 1, 2025
d2d0f62
Don't declare variables in ExprKind::Let in invalid positions
compiler-errors Jun 2, 2025
4a803d2
Suppress redundant error
compiler-errors Jun 2, 2025
87054fc
Add missing 2015 edition directives
Veykril Jun 2, 2025
aba70e8
Add missing `dyn` keywords to tests that do not test for them
Veykril Jun 2, 2025
a5f7d44
add test for 141764
jdonszelmann Jun 2, 2025
2e527f0
fix bug where borrowck tries to describe a name from a macro in anoth…
jdonszelmann Jun 2, 2025
8b5b6d0
add fixme to improve error matching
jdonszelmann Jun 2, 2025
8747ccb
Overhaul `UsePath`.
nnethercote May 29, 2025
55f7571
Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35
matthiaskrgr Jun 3, 2025
aed1171
Rollup merge of #141677 - azhogin:azhogin/async-drop-unexpected-type-…
matthiaskrgr Jun 3, 2025
8db6881
Rollup merge of #141741 - nnethercote:overhaul-UsePath, r=petrochenkov
matthiaskrgr Jun 3, 2025
6a5459e
Rollup merge of #141873 - neeko-cat:patch-1, r=tgross35
matthiaskrgr Jun 3, 2025
69ebe39
Rollup merge of #141876 - compiler-errors:missing-let-ty, r=SparrowLii
matthiaskrgr Jun 3, 2025
f616453
Rollup merge of #141886 - ferrocene:lw/2015-edition-directives, r=com…
matthiaskrgr Jun 3, 2025
d7fcb09
Rollup merge of #141889 - ferrocene:lw/missing-dyn-kw, r=petrochenkov
matthiaskrgr Jun 3, 2025
f3622ea
Rollup merge of #141891 - jdonszelmann:fix-141764, r=jieyouxu
matthiaskrgr Jun 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Invert the sense of is_not_macro_export.
I find it much easier to think about in the positive sense.
  • Loading branch information
nnethercote committed Jun 1, 2025
commit 176c34a946df6b096cc2bce19c477fd49c0c9a09
10 changes: 5 additions & 5 deletions src/tools/clippy/clippy_lints/src/redundant_pub_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
if cx.tcx.visibility(item.owner_id.def_id) == ty::Visibility::Restricted(CRATE_DEF_ID.to_def_id())
&& !cx.effective_visibilities.is_exported(item.owner_id.def_id)
&& self.is_exported.last() == Some(&false)
&& is_not_macro_export(item)
&& !is_macro_export(item)
&& !item.span.in_external_macro(cx.sess().source_map())
{
let span = item
Expand Down Expand Up @@ -86,18 +86,18 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
}
}

fn is_not_macro_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
fn is_macro_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
if let ItemKind::Use(path, _) = item.kind {
if path
.res
.iter()
.all(|res| matches!(res, Res::Def(DefKind::Macro(MacroKind::Bang), _)))
{
return false;
return true;
}
} else if let ItemKind::Macro(..) = item.kind {
return false;
return true;
}

true
false
}