-
Notifications
You must be signed in to change notification settings - Fork 13.4k
type alias Plus2
is never used
#127911
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
Comments
|
checking |
warnings are popping up as well, so wrong repo I guess ? is there a way to transfer this issue to rustc ? |
This will need a smaller reproduction. Any chance you could try extracting the relevant code out? |
I don't really have time currently I'm afraid :/ otherwise I could offer an automated bisect on that |
No worries, somebody will chase it down at some point :) |
I will have a look |
There are also similar older versions of this issue, like the following (playground). That's been warning since 1.57: use std::mem;
#[repr(transparent)]
pub struct X<T: ?Sized> {
pub inner: T,
}
pub struct Y {}
impl Drop for Y {
fn drop(&mut self) {
type A = Vec<u8>;
const _: () = assert!(mem::size_of::<X<A>>() == mem::size_of::<A>());
}
} Note that this is not a reduction of the OP and not necessarily a duplicate, but was encountered in real world code. |
@rustbot claim |
Reduced (play): struct T<X>(X);
type A<X> = T<X>;
trait Tr {
fn foo();
}
impl<X> Tr for T<A<X>> {
fn foo() {}
}
fn main() {
T::<T<()>>::foo();
} |
Rollup merge of #141407 - mu001999-contrib:dead-code/refactor, r=petrochenkov Refactor the two-phase check for impls and impl items Refactor the two-phase dead code check to make the logic clearer and simpler: 1. adding assoc fn and impl into `unsolved_items` directly during the initial construction of the worklist 2. converge the logic of checking whether assoc fn and impl are used to `item_should_be_checked`, and the item is considered used only when its corresponding trait and Self adt are used This PR only refactors as much as possible to avoid affecting the original functions. However, due to the adjustment of the order of checks, the test results are slightly different, but overall, there is no regression problem Fixes #127911 Fixes #128839 Extracted from #128637. r? petrochenkov try-job: dist-aarch64-linux
…ochenkov Refactor the two-phase check for impls and impl items Refactor the two-phase dead code check to make the logic clearer and simpler: 1. adding assoc fn and impl into `unsolved_items` directly during the initial construction of the worklist 2. converge the logic of checking whether assoc fn and impl are used to `item_should_be_checked`, and the item is considered used only when its corresponding trait and Self adt are used This PR only refactors as much as possible to avoid affecting the original functions. However, due to the adjustment of the order of checks, the test results are slightly different, but overall, there is no regression problem Fixes rust-lang/rust#127911 Fixes rust-lang/rust#128839 Extracted from rust-lang/rust#128637. r? petrochenkov try-job: dist-aarch64-linux
Uh oh!
There was an error while loading. Please reload this page.
Summary
Some type is flagged by Clippy as never used, though it is used in an internal trait implementation
Lint Name
dead_code
Reproducer
I tried this code:
clone zama-ai/concrete-fft@aeb75d4
run pre commit checks, runs a clippy check:
make pcc
faulty clippy invokation:
I saw this happen:
I expected to see this happen:
No warning/error for these types as they are used in e.g. https://github.com/zama-ai/concrete-fft/blob/aeb75d4b7c5cc6b3031bf5b9f4730961f3132fe5/src/dit16.rs#L823
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: