Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/157774>.
//!
//! A self-referential inherent associated type used to ICE with
//! `item_bounds called on` an impl item.

//@ compile-flags: -Zassumptions-on-binders -Znext-solver=globally

#![feature(inherent_associated_types)]
#![expect(incomplete_features)]

struct Foo<'a> {
x: &'a (),
}

impl<'a> Foo<'a> {
type Assoc = &'a Foo<'a>::Assoc;
//~^ ERROR overflow evaluating the requirement `Foo<'a>::Assoc == _`
//~| ERROR overflow evaluating whether `&'a Foo<'a>::Assoc` is well-formed
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0275]: overflow evaluating the requirement `Foo<'a>::Assoc == _`
--> $DIR/self-referential-inherent-assoc-type-issue-157774.rs:16:5
|
LL | type Assoc = &'a Foo<'a>::Assoc;
| ^^^^^^^^^^

error[E0275]: overflow evaluating whether `&'a Foo<'a>::Assoc` is well-formed
--> $DIR/self-referential-inherent-assoc-type-issue-157774.rs:16:5
|
LL | type Assoc = &'a Foo<'a>::Assoc;
| ^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0275`.
Loading