-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that all hidden types are the same and then deduplicate them.
- Loading branch information
Showing
2 changed files
with
110 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// check-pass | ||
|
||
use std::marker::PhantomData; | ||
|
||
pub struct ConcreteError {} | ||
pub trait IoBase {} | ||
struct X {} | ||
impl IoBase for X {} | ||
|
||
pub struct ClusterIterator<B, E, S = B> { | ||
pub fat: B, | ||
phantom_s: PhantomData<S>, | ||
phantom_e: PhantomData<E>, | ||
} | ||
|
||
pub struct FileSystem<IO: IoBase> { | ||
pub disk: IO, | ||
} | ||
|
||
impl<IO: IoBase> FileSystem<IO> { | ||
pub fn cluster_iter(&self) -> ClusterIterator<impl IoBase + '_, ConcreteError> { | ||
ClusterIterator { | ||
fat: X {}, | ||
phantom_s: PhantomData::default(), | ||
phantom_e: PhantomData::default(), | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |