diff options
| author | bors <bors@rust-lang.org> | 2021-09-12 17:04:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-12 17:04:10 +0000 |
| commit | d2dfb0eb8e30d188fb1731e540bc1b418bcd046d (patch) | |
| tree | 0b3912abc6d0c51624bed509f80b22d434543faa /src | |
| parent | c7dbe7a830100c70d59994fd940bf75bb6e39b39 (diff) | |
| parent | 47035e4d084d3ca57acd3c8a68371b866407d149 (diff) | |
| download | rust-d2dfb0eb8e30d188fb1731e540bc1b418bcd046d.tar.gz rust-d2dfb0eb8e30d188fb1731e540bc1b418bcd046d.zip | |
Auto merge of #88811 - jackh726:issue-88446, r=nikomatsakis
Use a HashMap for UniverseInfo in mir borrowck Fixes #88446 r? `@nikomatsakis`
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/hrtb/issue-88446.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/ui/hrtb/issue-88446.rs b/src/test/ui/hrtb/issue-88446.rs new file mode 100644 index 00000000000..571b8531757 --- /dev/null +++ b/src/test/ui/hrtb/issue-88446.rs @@ -0,0 +1,35 @@ +// check-pass + +trait Yokeable<'a> { + type Output: 'a; +} +impl<'a> Yokeable<'a> for () { + type Output = (); +} + +trait DataMarker<'data> { + type Yokeable: for<'a> Yokeable<'a>; +} +impl<'data> DataMarker<'data> for () { + type Yokeable = (); +} + +struct DataPayload<'data, M>(&'data M); + +impl DataPayload<'static, ()> { + pub fn map_project_with_capture<M2, T>( + _: for<'a> fn( + capture: T, + std::marker::PhantomData<&'a ()>, + ) -> <M2::Yokeable as Yokeable<'a>>::Output, + ) -> DataPayload<'static, M2> + where + M2: DataMarker<'static>, + { + todo!() + } +} + +fn main() { + let _: DataPayload<()> = DataPayload::<()>::map_project_with_capture::<_, &()>(|_, _| todo!()); +} |
