Skip to content

TAIT results in non-rigid alias in TypeOutlives param env clauses #293

Description

@lcnr

@_sjwang05|656176 said:

  • tests/ui/type-alias-impl-trait/implied_bounds2.rs
  • tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs
  • tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs
  • tests/ui/type-alias-impl-trait/unbounded_opaque_type.rs
  • tests/ui/pattern/usefulness/impl-trait.rs

all ICE with the same-ish stacktraces. Seems like it happens because of the set_opaques_to_non_rigid call when wfck creates a param_env: https://github.com/rust-lang/rust/blob/e19d321c06479c6fd77533582b0d5a86651f1be3/compiler/rustc_trait_selection/src/traits/mod.rs#L309-L313
and then the debug_assert here explodes when it seems the non-rigid opaques: https://github.com/rust-lang/rust/blob/e19d321c06479c6fd77533582b0d5a86651f1be3/compiler/rustc_trait_selection/src/regions.rs#L33-L37


This is kind of a pain 🤔 either we do renormalize region assumptions from the ParamEnv just for TAIT, we could alternatively emit an error when encountering TAIT in a rigid position in the ParamEnv as something that is not supported yet

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions