Skip to content

Evaluation probe in new solver causes ICE in late borrowck #12

Closed
rust-lang/rust
#109753
@compiler-errors

Description

@compiler-errors
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions