about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-04-19 08:40:27 +0000
committerbors <bors@rust-lang.org>2017-04-19 08:40:27 +0000
commit467aaab50ef0c7284121d59d8f7af3184836e586 (patch)
treec68f780aaf8b83de6b7cd5dc9fe7e68d9446e1ad /src/test/run-pass/thinlto
parent5f22d46e4bea4b5a335c671c61c96f00a5b3f554 (diff)
parentcd64ff943889b1cda1029a4a0d906d934a47abeb (diff)
downloadrust-467aaab50ef0c7284121d59d8f7af3184836e586.tar.gz
rust-467aaab50ef0c7284121d59d8f7af3184836e586.zip
Auto merge of #41325 - eddyb:isolate-snapshots-for-good, r=arielb1
Ban registering obligations during InferCtxt snapshots.

Back in #33852, a flag was added to `InferCtxt` to prevent rolling back a snapshot if obligations were added to some `FulfillmentContext` during the snapshot, to prevent leaking fresh inference variables (created during that snapshot, so their indices would get reused) in obligations, which could ICE or worse.

But that isn't enough in the long run, as type-checking ends up relying on success implying that eager side-effects are fine, and while stray obligations *do* get caught nowadays, those errors prevent, e.g. the speculative coercions from #37658, which *have to* be rolled back *even* if they succeed.

We can't just allow those obligations to stay around though, because we end up, again, in ICEs or worse.
Instead, this PR modifies `lookup_method_in_trait_adjusted` to return `InferOk` containing the obligations that `Autoderef::finalize_as_infer_ok` can propagate to deref coercions.

As there shouldn't be *anything* left that registers obligations during snapshots, it's completely banned.

r? @nikomatsakis @arielb1
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions