-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
12682b4
to
4f1e71f
Compare
There was a problem hiding this 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[..] { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)?; |
There was a problem hiding this comment.
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
4f1e71f
to
63217e0
Compare
@bors r=lcnr |
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more r? `@lcnr`
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more r? ``@lcnr``
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more r? ``@lcnr``
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
r? @lcnr