Skip to content

Hang with ADT const param, self-mention in where clause #103770

Closed
@jruderman

Description

@jruderman

The compiler hangs on:

#![feature(generic_const_exprs)]
#![feature(adt_const_params)]
#![allow(incomplete_features)]
#![allow(dead_code)]

#[derive(PartialEq, Eq)]
struct U;

struct S<const N: U>()
where
    S<{ U }>:;

fn main() {}

Hang sample

Version

rustc 1.66.0-nightly (0da281b60 2022-10-27)
binary: rustc
commit-hash: 0da281b6068a7d889ae89a9bd8991284cc9b7535
commit-date: 2022-10-27
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

Regression

searched nightlies: from nightly-2022-06-16 to nightly-2022-10-28
regressed nightly: nightly-2022-06-30
searched commit range: 8308806...ddcbba0
regressed commit: 116edb6 (#98542)

@rustbot label +A-const-generics +F-generic_const_exprs +I-hang +T-compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.F-adt_const_params`#![feature(adt_const_params)]`F-generic_const_exprs`#![feature(generic_const_exprs)]`I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions