Skip to content

PostAnalysis mode no longer eagerly reveals opaque types #153

Open
@lcnr

Description

@lcnr

affected test

  • tests/ui/type-alias-impl-trait/in-where-clause.rs
#![feature(type_alias_impl_trait)]
type Bar = impl Sized;

fn foo() -> Bar
where
    Bar: Send,
{
    [0; 1 + 2]
}

fn main() {}

This encounters a query cycle with the old solver as evaluating 1 + 2 ends up normalizing the where-clause Bar: Send, normalizing Bar relies on type checking foo as its a defining use. We encounter these cycles whenever there's an opaque type in a where-clause of its defining scope and we evaluate a constant during typeck.

The new solver does not eagerly normalize its ParamEnv when switching to post analysis, causing us to only fail with a cycle error when actually trying to use that where-bound.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions