Skip to content

ICE with feature(trait_alias) when using dyn with type alias #84789

Closed
@Zenithsiz

Description

@Zenithsiz

Code

#![feature(trait_alias)]

pub trait MyFn = Fn(&mut Self);

// 1.
pub type F = dyn MyFn;

// 2.
pub fn f(_f: &dyn MyFn) {
    
}

Tested on the playground.

1.53.0-nightly

(2021-04-30 4ae0a8e413a67b9f6c38)

Error output

With just 2:

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `playground`

Caused by:
  process didn't exit successfully: `[...]` (signal: 6, SIGABRT: process abort signal)

With just 1:

error: internal compiler error: compiler/rustc_privacy/src/lib.rs:272:17: unexpected type: FreshTy(0)

thread 'rustc' panicked at 'Box<Any>', /rustc/4ae0a8e413a67b9f6c38f09b24f6179e98c1ba25/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (4ae0a8e41 2021-04-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [privacy_access_levels] privacy access levels
#1 [analysis] running analysis passes on this crate
end of query stack
thread 'rustc' panicked at 'Box<Any>', /rustc/4ae0a8e413a67b9f6c38f09b24f6179e98c1ba25/library/std/src/panic.rs:59:5

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (4ae0a8e41 2021-04-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [check_mod_privacy] checking privacy in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `playground`

Backtrace:
Note sure how to generate a backtrace on the playground, unfortunately

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-trait_alias`#![feature(trait_alias)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions