467aaab50e
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 |
||
---|---|---|
.. | ||
bootstrap | ||
build_helper | ||
ci | ||
compiler-rt@d30da544a8 | ||
doc | ||
driver | ||
etc | ||
grammar | ||
jemalloc@11bfb0dcf8 | ||
liballoc | ||
liballoc_jemalloc | ||
liballoc_system | ||
libarena | ||
libbacktrace | ||
libcollections | ||
libcompiler_builtins | ||
libcore | ||
libflate | ||
libfmt_macros | ||
libgetopts | ||
libgraphviz | ||
liblibc@05a2d19735 | ||
libpanic_abort | ||
libpanic_unwind | ||
libproc_macro | ||
libproc_macro_plugin | ||
librand | ||
librustc | ||
librustc_asan | ||
librustc_back | ||
librustc_bitflags | ||
librustc_borrowck | ||
librustc_const_eval | ||
librustc_const_math | ||
librustc_data_structures | ||
librustc_driver | ||
librustc_errors | ||
librustc_incremental | ||
librustc_lint | ||
librustc_llvm | ||
librustc_lsan | ||
librustc_metadata | ||
librustc_mir | ||
librustc_msan | ||
librustc_passes | ||
librustc_platform_intrinsics | ||
librustc_plugin | ||
librustc_privacy | ||
librustc_resolve | ||
librustc_save_analysis | ||
librustc_trans | ||
librustc_tsan | ||
librustc_typeck | ||
librustdoc | ||
libserialize | ||
libstd | ||
libstd_unicode | ||
libsyntax | ||
libsyntax_ext | ||
libsyntax_pos | ||
libterm | ||
libtest | ||
libunwind | ||
llvm@2e951c3ae3 | ||
rt | ||
rtstartup | ||
rust-installer@4f99485080 | ||
rustc | ||
rustllvm | ||
test | ||
tools | ||
Cargo.lock | ||
Cargo.toml | ||
stage0.txt |