compiler-errors/next-solver-hir-issues

Evaluation probe in new solver causes ICE in late borrowck

compiler-errors opened this issue · 0 comments

use std::collections::HashMap;

fn foo() -> &'static HashMap<i32, i32>
{
    &HashMap::new()
}

fn main() {}

Causes:

thread 'rustc' panicked at 'region constraints already solved', compiler/rustc_infer/src/infer/mod.rs:230:14

Since an evaluate_obligation call in the new solver doesn't actually call out to a query, so if we've already taken region constraints, a InferCtxt::probe call will ICE.