about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-10-22 00:12:16 -0400
committerAaron Hill <aa1ronham@gmail.com>2018-10-22 19:40:43 -0400
commit4f2624cac90ee9145175d6e4b9c59b9ab7875a9c (patch)
tree55d71dee6692252002f407575265b35560944a8f /src/rustllvm/RustWrapper.cpp
parentca2639e82ec4a18d7359efbfb555ea69dd644c97 (diff)
downloadrust-4f2624cac90ee9145175d6e4b9c59b9ab7875a9c.tar.gz
rust-4f2624cac90ee9145175d6e4b9c59b9ab7875a9c.zip
Fix Rustdoc ICE when checking blanket impls
Fixes #55001, #54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions