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

Remove save_and_restore_in_snapshot_flag, use ObligationCtxt more #104206

Merged
merged 3 commits into from
Nov 12, 2022

Conversation

compiler-errors
Copy link
Member

r? @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 9, 2022
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

nits, then r=me

engine.register_predicate_obligations(infcx, obligations.chain(more_obligations));

let errors = engine.select_all_or_error(infcx);
match &errors[..] {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this just be if errors.is_empty() instead of matching?

Copy link
Member Author

@compiler-errors compiler-errors Nov 9, 2022

Choose a reason for hiding this comment

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

We still need to have access to errors for the debug! below, but I can refactor this into an if !errors.is_empty() which is how most other select_all_or_error callsites do it.

// to push them onto the stack to be expanded.
for ty in constraints.dtorck_types.drain(..) {
let Normalized { value: ty, obligations } =
ocx.infcx.at(&cause, param_env).normalize(ty)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we use the query normalizer instead of normalize here?

wanted to really look into the difference between these two in the near future anyways, so I can figure that out myself over the next weeks 😁

considering that this is preexisting, this is not blocking this PR

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 10, 2022

📌 Commit 63217e0 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 10, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 10, 2022
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more

r? `@lcnr`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 10, 2022
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more

r? ``@lcnr``
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more

r? ``@lcnr``
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#102049 (Add the `#[derive_const]` attribute)
 - rust-lang#103970 (Unhide unknown spans)
 - rust-lang#104206 (Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more)
 - rust-lang#104214 (Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures)
 - rust-lang#104267 (rustdoc: use checkbox instead of switch for settings toggles)
 - rust-lang#104302 (Update cargo)
 - rust-lang#104303 (UI tests can be assigned to T-compiler)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 662df1e into rust-lang:master Nov 12, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 12, 2022
@compiler-errors compiler-errors deleted the ocx-more-2 branch August 11, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants