-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
We were trying to make a function that returns itself.
#![feature(conservative_impl_trait)]
fn foo() -> impl Copy {
foo
}
rustc overflows its stack.
cc @aturon
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
aturon commentedon Sep 27, 2016
cc @eddyb
eddyb commentedon Sep 27, 2016
Well, you've sort of succeeded: what trans sees is
fn foo() -> typeof foo
(an infinitely recursive type).However, I would've expected
traits::project
to catch this via the recursion limit, as the backtrace repeatstraits::project::AssociatedTypeNormalizer::fold_ty
. cc @nikomatsakis[-]`impl Trait` ICE returning a function[/-][+]`impl Trait` ICE returning a recursive type[/+]topecongiro commentedon Dec 27, 2017
rustc does not overflow its stack on
rustc 1.24.0-nightly (cddc4a62d 2017-12-26)
.Add tests to fixed issues.
Rollup merge of rust-lang#47344 - topecongiro:fixed-ices, r=alexcrichton
Rollup merge of rust-lang#47344 - topecongiro:fixed-ices, r=alexcrichton
Rollup merge of rust-lang#47344 - topecongiro:fixed-ices, r=alexcrichton