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

TAIT crash: stack overflow in check_for_opaque_ty #104291

Closed
jruderman opened this issue Nov 11, 2022 · 0 comments · Fixed by #104296
Closed

TAIT crash: stack overflow in check_for_opaque_ty #104291

jruderman opened this issue Nov 11, 2022 · 0 comments · Fixed by #104296
Assignees
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jruderman
Copy link
Contributor

Found by mutating src/test/ui/lint/lint-ctypes-73251-2.rs with a modified fuzz-rustc

Code

Compared to the original test, this modifies the definition of AliasB by removing <Assoc = AliasA>.

#![feature(type_alias_impl_trait)]

pub trait TraitA {
    type Assoc;
}

impl TraitA for u32 {
    type Assoc = u32;
}

pub trait TraitB {
    type Assoc;
}

impl<T> TraitB for T
where
    T: TraitA,
{
    type Assoc = <T as TraitA>::Assoc;
}

type AliasA = impl TraitA<Assoc = u32>;

type AliasB = impl TraitB;

fn use_of_a() -> AliasA {
    3
}

fn use_of_b() -> AliasB {
    3
}

extern "C" {
    fn lint_me() -> <AliasB as TraitB>::Assoc;
}

fn main() {}

Regression

Regression in nightly-2020-06-22, presumably due to the same PR that added the mutated test: #73287 (@davidtwco)

Version

rustc 1.67.0-nightly (e75aab045 2022-11-09)
binary: rustc
commit-hash: e75aab045fc476f176a58c408f6b06f0e275c6e1
commit-date: 2022-11-09
host: x86_64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

@rustbot label +I-crash +T-compiler +F-type_alias_impl_trait

@jruderman jruderman added the C-bug Category: This is a bug. label Nov 11, 2022
@rustbot rustbot added F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 11, 2022
@compiler-errors compiler-errors self-assigned this Nov 11, 2022
@bors bors closed this as completed in d8b416d Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants