-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Normalization error with ToOwned
#71113
Labels
A-associated-items
Area: Associated items (types, constants & functions)
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Jerald
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 14, 2020
jonas-schievink
added
A-associated-items
Area: Associated items (types, constants & functions)
I-nominated
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
and removed
I-nominated
labels
Apr 14, 2020
Mark-Simulacrum
added
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Apr 14, 2020
The ICE starts to happen in 1.32 but I'm getting the following error in 1.31 ...
|
Ok, I was guessing that this may have been because the compiler stops before exercising the code that produces the ICE and I've just confirmed that. use std::borrow::{Borrow, Cow};
use std::ops::{Deref, DerefMut};
enum Recursive<'a>
where
Recursive<'a>: ToOwned<Owned=Box<Recursive<'a>>>
{
Variant(MyCow<'a, Recursive<'a>>),
}
pub struct Wrapper<T>(T);
pub struct MyCow<'a, T: ToOwned<Owned=Box<T>> + 'a>(Wrapper<Cow<'a, T>>); Also ICEs in 1.31 |
spastorino
added
P-medium
Medium priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Apr 14, 2020
Assigning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-associated-items
Area: Associated items (types, constants & functions)
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I've recently been messing around with
Cow
and discovered the very weird behaviour associated with it, rooted inToOwned
. In an attempt to make an enum that can hold aCow
of itself, I ran into an internal compiler error! Very fun.I've been developing on nightly, but I tested it on stable and the error exists there as well. I included both versions I tested with below.
The code below seems to be the minimal version that will even compile, let alone produce the error. There is likely more distant forms of complex reduction that could be done to get to a more core version of the error, but that's outside the scope of what I found.
I found a few other issues related to similar weirdness with
ToOwned
and/or normalization issues that seem to be similar (but not directly):Cow
,'static
and slice triggers "overflow evaluating the requirement" #47032Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: