-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
"coherence failed to report ambiguity" ICE #23336
Comments
It's a bug - we forgot to normalize the type. |
Actually, this is a typeck coherence error (I thought these were all trans errors). Could you try to give an example that causes the ICE? |
The simplest possible repro I could think of (an empty |
Putting the following in playpen causes the ICE for me at the moment. Looking at it in this distilled form, it does seem a bit suspicious (like, maybe it shouldn't work ;)). But, still ICEs, and probably shouldn't do that at least. trait Data : Clone+Send+'static { }
impl<T: Clone+Send+'static> Data for T { }
pub trait UnaryLogic {
type D: Data;
}
pub struct Test<D: Data> {
data: D,
}
pub struct UnaryScope<L: UnaryLogic> {
input: Test<L::D>,
}
fn main() {} |
We error on a trivial ambiguity between a blanket |
Less obscure: pub trait Data { fn doit(&self) {} }
impl<T> Data for T { }
pub trait UnaryLogic { type D: Data; }
pub fn ice<T: UnaryLogic>(t: T::D) {
t.doit();
}
fn main() {} |
cc me, I agree with @arielb1's diagnosis |
The following ICEs for me (full ICE text below):
I get the following backtrace:
with
The
Data
trait is just some mash-up of other traits, off in another file. Not clear if this is a "you wrote bad code, but the compiler barfed telling you" or "nope; that should work". Seems like ICE probably not the right answer in either case, though! :DThe text was updated successfully, but these errors were encountered: