-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE on stable in selection #89864
Comments
If I had to guess, this is because in the non-codegen phase, we can't prove Seems like a very lazy-norm thing and this is all speculation. |
#90891 changed the format_args expansion slightly so the example no longer ICEs, but it can still be reproduced by calling #![feature(fmt_internals)]
use core::{fmt, marker::PhantomData};
pub trait WrapperTrait {
type Assoc;
}
pub trait Trait {
type Assoc;
}
pub struct Ice<T>(<<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc);
fn ice<T>(i: Ice<T>)
where
<<Dynamic<T> as WrapperTrait>::Assoc as Trait>::Assoc: fmt::Debug,
{
fmt::ArgumentV1::new(&i.0, fmt::Debug::fmt);
}
pub struct TraitImplementor;
impl Trait for TraitImplementor {
type Assoc = ConcreteAssoc;
}
pub struct ConcreteAssoc;
impl<T> WrapperTrait for Dynamic<T> {
type Assoc = TraitImplementor;
}
pub struct Dynamic<T>(PhantomData<T>); |
Hmm... this is what I was worried about in the PR. This compiles now, but the trait bound ConcreteAssoc::Debug doesn't hold. |
Is it an issue? The function |
oh 🤦 yea, I can't find a way to call it either. Thanks! |
This is fixes and we have appropriate tests imo |
Ran into an ICE on stable, threw together a quick minimization. There's probably a lot more room here for minimization but some other things I tried mostly wrt switching
Debug
/format_args!
out for something generic weren't immediately successful at reproducing it.Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: