Skip to content

Commit 2cf31b5

Browse files
committed
fix: issues that arose with rust-lang/rust#128440
Note that I had to: 1. Add `defines_opaque()` in one place, and 2. Avoid using a TAIT all together and just go for the ugly concrete type version somewhere because apparently `defines_opaque()` doesn't support TAIT definitions that are constrained as a generic arg
1 parent 866a08d commit 2cf31b5

File tree

4 files changed

+54
-17
lines changed

4 files changed

+54
-17
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ style/tailwind_output.css
1111
.idea/
1212

1313
.aider.*
14+
15+
rustc-ice-*
16+
17+
.DS_Store

shared/src/avail.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ impl<T> IntoIterator for Avail<T> {
117117

118118
type IntoIter = AvailIntoIter<T>;
119119

120+
#[define_opaque(AvailIntoIter)]
120121
fn into_iter(self) -> Self::IntoIter {
121122
match self {
122123
Avail::Yes(i) => Some(i).into_iter(),

shared/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![feature(type_alias_impl_trait)]
33
#![feature(marker_trait_attr)]
44
#![feature(async_fn_track_caller)]
5+
#![feature(trait_alias)]
56

67
pub mod avail;
78
pub mod endpoints;

shared/src/sync_engine/new_defn.rs

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@ use std::pin::Pin;
55
use std::rc::Rc;
66

77
use crate::backend_api_trait::BackendApiTrait;
8-
use crate::types::label::Label;
9-
use crate::types::last_webhook_update_at::LastWebhookUpdateAt;
8+
use crate::types::github_app::GithubAppStoreMarker;
9+
use crate::types::installation_access_token_row::InstallationAccessTokenRowStoreMarker;
10+
use crate::types::issue::IssueStoreMarker;
11+
use crate::types::issue_comment::IssueCommentStoreMarker;
12+
use crate::types::issue_comment_initial_sync_status::IssueCommentsInitialSyncStatusStoreMarker;
13+
use crate::types::issues_initial_sync_status::IssuesInitialSyncStatusStoreMarker;
14+
use crate::types::label::{Label, LabelStoreMarker};
15+
use crate::types::last_webhook_update_at::{LastWebhookUpdateAt, LastWebhookUpdateAtStoreMarker};
16+
use crate::types::license::LicenseStoreMarker;
17+
use crate::types::milestone::MilestoneStoreMarker;
18+
use crate::types::repository::RepositoryStoreMarker;
19+
use crate::types::repository_initial_sync_status::RepositoryInitialSyncStatusStoreMarker;
20+
use crate::types::user::UserStoreMarker;
1021
use crate::types::{
1122
github_app::GithubApp, installation_access_token_row::InstallationAccessTokenRow, issue::Issue,
1223
issue_comment::IssueComment, issue_comment_initial_sync_status::IssueCommentsInitialSyncStatus,
@@ -15,7 +26,7 @@ use crate::types::{
1526
user::User,
1627
};
1728
use send_wrapper::SendWrapper;
18-
use typesafe_idb::{StoreMarker, TypesafeDb};
29+
use typesafe_idb::TypesafeDb;
1930
use url::Url;
2031

2132
use super::optimistic::db::DbWithOptimisticChanges;
@@ -24,20 +35,40 @@ use super::websocket_updates::transport::TransportTrait;
2435
use super::DbSubscription;
2536
use super::{error::SyncResult, SyncEngine};
2637

27-
pub type DbStoreMarkers = impl StoreMarker<IssueCommentsInitialSyncStatus>
28-
+ StoreMarker<RepositoryInitialSyncStatus>
29-
+ StoreMarker<IssueComment>
30-
+ StoreMarker<InstallationAccessTokenRow>
31-
+ StoreMarker<IssuesInitialSyncStatus>
32-
+ StoreMarker<License>
33-
+ StoreMarker<Label>
34-
+ StoreMarker<Milestone>
35-
+ StoreMarker<Repository>
36-
+ StoreMarker<GithubApp>
37-
+ StoreMarker<User>
38-
+ StoreMarker<Issue>
39-
+ StoreMarker<LastWebhookUpdateAt>
40-
+ Default;
38+
pub type DbStoreMarkers = (
39+
RepositoryInitialSyncStatusStoreMarker,
40+
(
41+
IssueCommentsInitialSyncStatusStoreMarker,
42+
(
43+
LastWebhookUpdateAtStoreMarker,
44+
(
45+
IssueCommentStoreMarker,
46+
(
47+
InstallationAccessTokenRowStoreMarker,
48+
(
49+
IssuesInitialSyncStatusStoreMarker,
50+
(
51+
LabelStoreMarker,
52+
(
53+
LicenseStoreMarker,
54+
(
55+
MilestoneStoreMarker,
56+
(
57+
RepositoryStoreMarker,
58+
(
59+
GithubAppStoreMarker,
60+
(UserStoreMarker, (IssueStoreMarker, ())),
61+
),
62+
),
63+
),
64+
),
65+
),
66+
),
67+
),
68+
),
69+
),
70+
),
71+
);
4172

4273
impl<BackendApi: BackendApiTrait, Transport: TransportTrait, GithubApi>
4374
SyncEngine<BackendApi, Transport, GithubApi>

0 commit comments

Comments
 (0)