Skip to content

ICE with GAT + HRTB #92954

Closed
Closed
@SevenO2

Description

@SevenO2

Code

#![feature(generic_associated_types)]
pub trait EphemeralContext {
    type Context<'c> where Self: 'c;
    fn handle(&self) -> Vec<Box<dyn 'static + for<'c> FnOnce(&Self::Context<'c>)>>;
    fn run_requests<'c>(&mut self, context: &Self::Context<'c>);
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.60.0-nightly (1bd4fdc94 2022-01-12)
binary: rustc
commit-hash: 1bd4fdc943513e1004f498bbf289279c9784fc6f
commit-date: 2022-01-12
host: x86_64-pc-windows-msvc
release: 1.60.0-nightly
LLVM version: 13.0.0

Error output

error: internal compiler error: compiler\rustc_infer\src\infer\lexical_region_resolve\mod.rs:376:17: cannot relate region: LUB(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ testy_tanky[1935]::EphemeralContext::handle::'c), 'c) }), ReFree(DefId(0:6 ~ testy_tanky[1935]::EphemeralContext::handle), BrAnon(0)))
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', compiler\rustc_errors\src\lib.rs:1169:9
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.60.0-nightly (1bd4fdc94 2022-01-12) running on x86_64-pc-windows-msvc

note: compiler flags: -Z share-generics=n -C embed-bitcode=no -C debuginfo=1 -C linker=rust-lld.exe -C incremental -C link-args=/debug:fastlink /opt:ref,noicf --crate-type bin

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

query stack during panic:
#0 [check_trait_item_well_formed] checking that `EphemeralContext::Context` is well-formed
#1 [analysis] running analysis passes on this crate
end of query stack

Metadata

Metadata

Labels

A-GATsArea: Generic associated types (GATs)C-bugCategory: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsI-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