Skip to content

ICE in trait normalization when specialization enabled #43037

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
cjsut opened this issue Jul 3, 2017 · 2 comments · Fixed by #99795
Closed

ICE in trait normalization when specialization enabled #43037

cjsut opened this issue Jul 3, 2017 · 2 comments · Fixed by #99795
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. F-specialization `#![feature(specialization)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cjsut
Copy link
Contributor

cjsut commented Jul 3, 2017

The following code (playground)

#![crate_type = "lib"]
#![feature(specialization)] // comment this line to get the expected behavior
trait X {}
trait Y: X {}
trait Z { type Assoc: Y; }
struct A<T>(T);

impl<T> Y for T where T: X {}
impl<T: X> Z for A<T> { type Assoc = T; }

// this impl is invalid, but causes an ICE anyway
impl<T> From<<A<T> as Z>::Assoc> for T {}

produces

error: internal compiler error: /checkout/src/librustc/traits/specialize/mod.rs:201: failed to fully normalize <T as std::convert::From<<A<T> as Z>::Assoc>>: [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<T as X>)),depth=1),Unimplemented)]
@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jul 6, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@steveklabnik
Copy link
Member

Triage: still ICEs

@Alexendoo Alexendoo added A-specialization Area: Trait impl specialization F-specialization `#![feature(specialization)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 13, 2019
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 15, 2019
@Centril Centril added the requires-nightly This issue requires a nightly compiler in some way. label Oct 25, 2019
@matthiaskrgr
Copy link
Member

This ICEs since 1.33
@rustbot modify labels: +regression-from-stable-to-stable

@rustbot rustbot added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Dec 20, 2020
@apiraino apiraino removed the requires-nightly This issue requires a nightly compiler in some way. label Feb 3, 2022
@bors bors closed this as completed in 02fcec2 Aug 4, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-specialization Area: Trait impl specialization C-bug Category: This is a bug. F-specialization `#![feature(specialization)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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.

10 participants