-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: unexpected ambiguity: CanonicalQueryInput - broken MIR #141478
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
Labels
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
S-has-bisection
Status: A bisection has been found for this issue
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
|
Its possible this is a form of #105299 but the reproducer listed in that issue no longer causes an ICE and this generates a different error message in the ICE. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
auto-reduced a bit futher 🤷 fn pretty_print<'r, T: ToProviderRef<'r>>() {
request::<T::ProviderRef, Value>()
}
fn request<T, R: RequestWithArg<PeanoSucc<T>>>() -> R::Output {
unimplemented!()
}
trait RequestWithArg<P> {
type Output;
}
impl<P, T> RequestWithArg<P> for T
where
P: Peano,
{
type Output = ();
}
trait ToProviderRef<'r> {
type ProviderRef: Peano;
}
struct Value;
trait Tagged {
type Tag;
}
trait Unimplemented {}
impl<T: Unimplemented> Tagged for T {
type Tag = ();
}
struct PeanoSucc<N>(N);
trait Peano: Tagged<Tag = LifetimeListTag<LenOf<Self>>> + SplitAt {}
impl<P: Tagged<Tag = LifetimeListTag<LenOf<P>>>> Peano for P {}
trait SplitAt: PeanoType<Len: Sized> {}
impl<P> SplitAt for P {}
struct Dummy;
trait PeanoType {
type Len;
}
impl<P> PeanoType for P {
type Len = Dummy;
}
type LenOf<P> = <P as PeanoType>::Len;
struct LifetimeListTag<N>(N);
impl<P, U> Tagged for PeanoSucc<P>
where
P: Tagged<Tag = LifetimeListTag<U>>,
{
type Tag = LifetimeListTag<Dummy>;
} |
Bisection points to nightly-2024-02-11. PRs in range: - #120852 (Rollup of 11 pull requests) by matthiaskrgr
- #120351 (Implement SystemTime for UEFI)
- #120354 (improve normalization of `Pointee::Metadata`)
- #120776 (Move path implementations into `sys`)
- #120790 (better error message on download CI LLVM failure)
- #120806 (Clippy subtree update)
- #120815 (Improve `Option::inspect` docs)
- #120822 (Emit more specific diagnostics when enums fail to cast with `as`)
- #120827 (Print image input file and checksum in CI only)
- #120836 (hide impls if trait bound is proven from env)
- #120844 (Build DebugInfo for async closures)
- #120851 (Remove duplicate release note)
- #120862 (Rollup of 6 pull requests) by matthiaskrgr
- #120584 (For a rigid projection, recursively look at the self type's item bounds to fix the `associated_type_bounds` feature)
- #120596 ([rustdoc] Correctly generate path for non-local items in source code pages)
- #120629 (Move some test files)
- #120846 (Update jobserver-rs to 0.1.28)
- #120850 (ast_lowering: Fix regression in `use ::{}` imports.)
- #120853 (Avoid a collection and iteration on empty passes)
- #120721 (fix `llvm_out` to use the correct LLVM root) by onur-ozkan
- #120712 (Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits) by compiler-errors
- #120771 (Use `ensure` when the result of the query is not needed beyond its `Result`ness) by oli-obk
- #120877 (Rollup of 8 pull requests) by matthiaskrgr
- #117614 (static mut: allow mutable reference to arbitrary types, not just slices and arrays)
- #120719 (Remove support for `associated_type_bound` nested in `dyn` types)
- #120764 (Add documentation on `str::starts_with`)
- #120823 (Clarify that atomic and regular integers can differ in alignment)
- #120859 (Loosen an assertion to account for stashed errors.)
- #120865 (Turn the "no saved object file in work product" ICE into a translatable fatal error)
- #120866 (Remove unnecessary `#![feature(min_specialization)]`)
- #120870 (Allow restricted trait impls under `#[allow_internal_unstable(min_specialization)]`)
- #119614 (unstably allow constants to refer to statics and read from immutable statics) by RalfJung Sounds like one of the two |
simpler: fn pretty_print<'r, T: ToProviderRef<'r>>() {
request::<T::ProviderRef, u8>()
}
fn request<T, R: RequestWithArg<PeanoSucc<T>>>() -> R::Output {
unimplemented!()
}
trait RequestWithArg<P> {
type Output;
}
impl<P, T> RequestWithArg<P> for T
where
P: Tagged,
{
type Output = ();
}
trait ToProviderRef<'r> {
type ProviderRef: Tagged<Tag: Sized>;
}
trait Tagged {
type Tag;
}
trait Unimplemented {}
impl<T: Unimplemented> Tagged for T {
type Tag = ();
}
struct PeanoSucc<N>(N);
impl<P, U> Tagged for PeanoSucc<P>
where
P: Tagged<Tag = U>,
{
type Tag = ();
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
S-has-bisection
Status: A bisection has been found for this issue
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
I tried to minimize the code but ended up with quite a lot. Clone the below repo and run
cargo check
.https://gitlab.com/konnorandrews/supply/-/tree/rustc-ice-ambiguity?ref_type=heads
Meta
rustc --version --verbose
:Also tested on beta and nightly with same error.
Error output
Backtrace
There are three errors so three backtraces.
The text was updated successfully, but these errors were encountered: