Rollup merge of #77739 - est31:remove_unused_code, r=petrochenkov,varkor
Remove unused code Rustc has a builtin lint for detecting unused code inside a crate, but when an item is marked `pub`, the code, even if unused inside the entire workspace, is never marked as such. Therefore, I've built [warnalyzer](https://github.com/est31/warnalyzer) to detect unused items in a cross-crate setting. Closes https://github.com/est31/warnalyzer/issues/2
This commit is contained in:
commit
022d20759b
46 changed files with 8 additions and 684 deletions
|
@ -44,9 +44,6 @@ pub trait PpAnn {
|
|||
fn nested(&self, _state: &mut State<'_>, _nested: Nested) {}
|
||||
fn pre(&self, _state: &mut State<'_>, _node: AnnNode<'_>) {}
|
||||
fn post(&self, _state: &mut State<'_>, _node: AnnNode<'_>) {}
|
||||
fn try_fetch_item(&self, _: hir::HirId) -> Option<&hir::Item<'_>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NoAnn;
|
||||
|
@ -54,9 +51,6 @@ impl PpAnn for NoAnn {}
|
|||
pub const NO_ANN: &dyn PpAnn = &NoAnn;
|
||||
|
||||
impl PpAnn for hir::Crate<'_> {
|
||||
fn try_fetch_item(&self, item: hir::HirId) -> Option<&hir::Item<'_>> {
|
||||
Some(self.item(item))
|
||||
}
|
||||
fn nested(&self, state: &mut State<'_>, nested: Nested) {
|
||||
match nested {
|
||||
Nested::Item(id) => state.print_item(self.item(id.id)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue