Skip to content
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

Can’t assign a marker to types wrapped by async functions #61

Open
JustusAdam opened this issue Sep 29, 2023 · 0 comments
Open

Can’t assign a marker to types wrapped by async functions #61

JustusAdam opened this issue Sep 29, 2023 · 0 comments
Labels
enhancement New feature or request markers Concerns the assignment logic for markers

Comments

@JustusAdam
Copy link
Collaborator

This came up when testing DFPP on Lemmy for our Eurosys submission. There was a label applied to type LocalUserView. DFPP can see that

LocalUserView::find_by_email_or_name(conn, &username_or_email) returns type LocalUserView and apply the label correctly, but when it’s wrapped in the blocking() function, it can’t anymore.

// problem with async blocking function (we use a type walk, need to go handle impl Future structure to infer the type here)
let local_user_view = apply_localuserview_label(blocking(context.pool(), move |conn| {
  LocalUserView::find_by_email_or_name(conn, &username_or_email)
})
.await?)
.map_err(|e| LemmyError::from_error_message(e, "couldnt_find_that_username_or_email"))?;

Also ran into this error with Flowistry intermittently when running DFPP on Lemmy:

thread 'rustc' panicked at 'internal error: entered unreachable code', 
/Users/carolynzech/.cargo/git/checkouts/flowistry-58afecc4a577121d/6e1de04/crates/flowistry/src/mir/borrowck_facts.rs:93:38

I couldn’t establish any clear pattern for when it was happening, and cargo clean always fixed it, so maybe not a huge deal.

@JustusAdam JustusAdam added the markers Concerns the assignment logic for markers label Sep 29, 2023
@JustusAdam JustusAdam changed the title Can’t assign a label to types wrapped by async functions Can’t assign a marker to types wrapped by async functions Sep 29, 2023
@JustusAdam JustusAdam added the enhancement New feature or request label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request markers Concerns the assignment logic for markers
Projects
None yet
Development

No branches or pull requests

1 participant