Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tests/ui/traits/next-solver/generalize/relate-alias-in-lub.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//@ revisions: old next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ check-pass
// Reproduces https://github.com/rust-lang/rust/pull/151746#issuecomment-3822930803.
//
// The change we tried to make there caused relating a type variable with an alias inside lub,
// In 5bd20bbd0ba6c0285664e55a1ffc677d7487c98b, we moved around code
// that adds an alias-relate predicate to be earlier, from one shared codepath into several
// distinct code paths. However, we forgot the codepath in `LatticeOp`, causing an ICE in serde.
// In the end we dropped said commit, but the reproducer is still a useful as test.

use std::marker::PhantomData;

pub trait Trait {
type Error;
}

pub struct Struct<E>(PhantomData<E>);

impl Trait for () {
type Error = ();
}

fn main() {
let _: Struct<<() as Trait>::Error> = match loop {} {
b => loop {},
a => Struct(PhantomData),
};
}
Loading