-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
Consider this (rather silly) code:
struct FooRead<T: Read> {
inner: T
}
impl<T: Read> Read for FooRead<T> {
fn read(&mut self, _: &mut [u8]) -> Result<usize, std::io::Error> {
Ok(1)
}
}
struct Foo<T: Read> {
foo: T
}
impl<T: Read> Foo<T> {
fn new(t: T) -> Foo<FooRead<T>> {
Foo {
foo: FooRead { inner: t }
}
}
}
If the new
function is changed to this:
impl<T: Read> Foo<T> {
fn new(t: T) -> Self {
Self {
foo: FooRead { inner: t }
}
}
}
It errors with error[E0308]: mismatched types
geekswamp
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing