vtable resolution does not take place for calls that are not statically resolved #3221
Labels
A-type-system
Area: Type system
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Vtable resolution ignores calls to methods on type parameters or traits. If the methods themselves take bounded type parameters, this leads to ICEs in trans because the requisite information is not found.
Consider this example:
Here, the
call_it()
function should not compile, becausegimme_an_a()
demands a type which implements the interfaceTraitA
---of which there are no implementations! Still it compiles. Bad.The relevant code is in
rustc::middle::typeck::check::vtable::resolve_expr()
, which ignores all cases other thanmethod_static
:The text was updated successfully, but these errors were encountered: