-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: unstable fingerprints for evaluate_obligation #91114
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
Comments
cargo check
of a local checkout of a dependency
We're also hitting an ICE with a similar error message using I'm in the process of building a minimal example here:
|
It's an use std::convert::TryFrom;
use std::error::Error;
use std::fmt::{self, Display};
#[derive(Default)]
pub struct App;
impl App {
pub fn run(&mut self) -> Result<(), anyhow::Error> {
Result::<(), Err>::Ok(())?;
Ok(())
}
}
#[derive(Debug)]
pub enum Err {
Err(q::Value),
}
impl Display for Err {
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
Ok(())
}
}
impl Error for Err {}
impl From<anyhow::Error> for Err {
fn from(_: anyhow::Error) -> Self {
todo!()
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Value {
List(Vec<Value>),
}
impl TryFrom<q::Value> for Value {
type Error = q::Value;
fn try_from(value: q::Value) -> Result<Self, Self::Error> {
match value {
q::Value::List(vals) => vals
.into_iter()
.map(Value::try_from)
.collect::<Result<Vec<_>, _>>()
.map(Value::List),
_ => todo!(),
}
}
}
pub mod q {
use std::collections::BTreeMap;
pub type Value = ValueInner<'static, String>;
pub trait AsValue<'a> {
type Value;
}
impl<'a> AsValue<'a> for String {
type Value = String;
}
#[derive(Debug)]
pub enum ValueInner<'a, T: AsValue<'a>> {
Variable(T::Value),
List(Vec<ValueInner<'a, T>>),
Object(BTreeMap<T::Value, ValueInner<'a, T>>),
}
} |
Thanks @neysofu for reporting this and generating a repro!! I was able to trim a few pieces off your latest version: use std::convert::TryFrom;
use std::error::Error;
use std::fmt::{self, Display};
pub fn run() -> Result<(), anyhow::Error> {
Result::<(), Err>::Ok(())?;
Ok(())
}
#[derive(Debug)]
enum Err {
Err(q::Value),
}
impl Display for Err {
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
Ok(())
}
}
impl Error for Err {}
impl From<anyhow::Error> for Err {
fn from(_: anyhow::Error) -> Self {
todo!()
}
}
enum Value {
List(Vec<Value>),
}
impl TryFrom<q::Value> for Value {
type Error = q::Value;
fn try_from(value: q::Value) -> Result<Self, Self::Error> {
match value {
q::Value::List(vals) => vals
.into_iter()
.map(Value::try_from)
.collect::<Result<Vec<_>, _>>()
.map(Value::List),
_ => todo!(),
}
}
}
pub mod q {
use std::collections::BTreeMap;
pub type Value = ValueInner<'static, String>;
pub trait AsValue<'a> {
type Value;
}
impl<'a> AsValue<'a> for String {
type Value = String;
}
#[derive(Debug)]
pub enum ValueInner<'a, T: AsValue<'a>> {
Variable(T::Value),
List(Vec<ValueInner<'a, T>>),
Object(BTreeMap<T::Value, ValueInner<'a, T>>),
}
} |
So the issue here is with the projection cache and the fact that it doesn't store outlives predicates in the nested obligations of a projection cache entry. The issue starts when we try to evaluate In order to normalize this projection type, we need to satisfy Due to this region constraint being registered during the normalization of However, later on (and I'm not exactly sure of why? intercrate mode, perhaps?), we evaluate This means that we evaluate However, when we do something like |
There are several issues here, I think. Firstly, I think the
but idk, I'm not super familiar with the projection cache, so take my words with a large grain of salt. |
I was wondering if @compiler-errors has any tips on how to tackle this and hopefully I can take a stab at it. My team would love to get this fixed. |
I think this has to do with incremental compilation, so a minimal example is unlikely to work out well. Compiling the crate was fine. Once I went to
cargo check
some changes in a local checkout ofgraphql-parser
and got that working, coming back tographql_client_codegen
ended up with an ICE until I cleaned thegraphql_client_codegen
crate.I am using
sccache
if that matters.The text was updated successfully, but these errors were encountered: