Skip to content

internal: remove Default from OpQueue #18195

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

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

davidbarsky
Copy link
Contributor

@Wilfred and I were talking about OpQueue and we identified one symptom of its (relative) weirdness is that last_op_result returns a T::default(); not Option<&T>, which means it's not possible to distinguish between "the OpQueue hasn't run yet" and "the OpQueue ran, but didn't produce a result". This branch fixes that.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2024
Copy link
Contributor

@Wilfred Wilfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea, I think explicitly having a 'OpQueue has never done anything' state is much clearer.

@davidbarsky
Copy link
Contributor Author

The test failures are legitimate, fwiw.

@davidbarsky davidbarsky force-pushed the davidbarsky/push-xkqnsyksmzqv branch from 29c9834 to 0c58839 Compare September 27, 2024 16:12
@davidbarsky
Copy link
Contributor Author

If there are no objections, I'll merge this after Monday's release. This change feels like it has a large blast radius.

@davidbarsky davidbarsky force-pushed the davidbarsky/push-xkqnsyksmzqv branch 2 times, most recently from 0ff9e51 to b66d3ff Compare September 30, 2024 14:11
@davidbarsky davidbarsky force-pushed the davidbarsky/push-xkqnsyksmzqv branch from b66d3ff to fc6eb66 Compare September 30, 2024 14:13
@Veykril
Copy link
Member

Veykril commented Sep 30, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Sep 30, 2024

📌 Commit fc6eb66 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 30, 2024

⌛ Testing commit fc6eb66 with merge 28830ff...

@bors
Copy link
Contributor

bors commented Sep 30, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 28830ff to master...

@bors bors merged commit 28830ff into rust-lang:master Sep 30, 2024
11 checks passed
@davidbarsky davidbarsky deleted the davidbarsky/push-xkqnsyksmzqv branch September 30, 2024 14:40
bors added a commit that referenced this pull request Oct 14, 2024
…eykril

internal: switch remaining OpQueues to use named structs

Building atop of #18195, I switched `GlobalState::fetch_build_data_queue` to use a struct instead of a tuple.

(I didn't switch `fetch_proc_macros_queue` to not return a bool, as the return value is only used in one spot.)
bors added a commit that referenced this pull request Oct 14, 2024
…avidbarsky

internal: switch remaining OpQueues to use named structs

Building atop of #18195, I switched `GlobalState::fetch_build_data_queue` to use a struct instead of a tuple.

(I didn't switch `fetch_proc_macros_queue` to not return a bool, as the return value is only used in one spot.)
lnicola pushed a commit to lnicola/rust that referenced this pull request Oct 17, 2024
…rpoq, r=davidbarsky

internal: switch remaining OpQueues to use named structs

Building atop of rust-lang/rust-analyzer#18195, I switched `GlobalState::fetch_build_data_queue` to use a struct instead of a tuple.

(I didn't switch `fetch_proc_macros_queue` to not return a bool, as the return value is only used in one spot.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants