Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostAnalysis mode no longer eagerly reveals opaque types #153

Open
lcnr opened this issue Jan 29, 2025 · 1 comment
Open

PostAnalysis mode no longer eagerly reveals opaque types #153

lcnr opened this issue Jan 29, 2025 · 1 comment

Comments

@lcnr
Copy link
Contributor

lcnr commented Jan 29, 2025

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.

@lcnr lcnr moved this to potentially irrelevant in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr moved this from potentially irrelevant to unknown in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr moved this from unknown to todo in -Znext-solver=globally Feb 13, 2025
@lcnr
Copy link
Contributor Author

lcnr commented Feb 13, 2025

when stabilizing TAIT we should make sure that using them in the env is an error determinstically

@lcnr lcnr moved this from todo to potentially irrelevant in -Znext-solver=globally Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: potentially irrelevant
Development

No branches or pull requests

1 participant