about summary refs log tree commit diff
path: root/tests/crashes
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-06-18 20:22:48 -0400
committerGitHub <noreply@github.com>2025-06-18 20:22:48 -0400
commitcff8e9ae142c3dcaf4c66ec5b6be932f1442c4b5 (patch)
treef3a817601e97ce7acaaedf8d983c7811fc03b8ca /tests/crashes
parent044514eb26511d2d8aa999fdf27e85df6beb6576 (diff)
parent377d8fa4e3057838f20dd1eb1669d4ebaf8a561a (diff)
downloadrust-cff8e9ae142c3dcaf4c66ec5b6be932f1442c4b5.tar.gz
rust-cff8e9ae142c3dcaf4c66ec5b6be932f1442c4b5.zip
Rollup merge of #140247 - BoxyUwU:iats_no_query_cycles, r=lcnr
Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs

Fixes rust-lang/rust#108491

Fixes rust-lang/rust#125879
This was due to updating inhabited predicate stuff which I had to do to make constructing ADTs with IATs in fields not ICE

Fixes rust-lang/rust#136678 (but no test added, I don't rly care about weird IAT edge cases under GCE)
Fixes rust-lang/rust#138131

Avoids doing "fully correct" candidate selection for IATs during hir ty lowering when in item signatures as it almost always leads to a query cycle from trying to build a `ParamEnv`. I replaced it with a use `DeepRejectCtxt` which should be able to handle this kind of conservative "could these types unify" while in a context where we don't want to do type equality.

This is a relatively simple scheme and should be forwards compatible with doing something more complex/powerful.

I'm not really sure how this interacts with rust-lang/rust#126651, though I'm also not really sure its super important to support projecting IATs from IAT self types given we don't even support `T::Assoc::Other` for trait-associated types so didn't give much thought to how this might fit in with that.

r? `@compiler-errors`
cc `@fmease`
Diffstat (limited to 'tests/crashes')
-rw-r--r--tests/crashes/125879.rs18
-rw-r--r--tests/crashes/136678.rs18
-rw-r--r--tests/crashes/138131.rs12
3 files changed, 0 insertions, 48 deletions
diff --git a/tests/crashes/125879.rs b/tests/crashes/125879.rs
deleted file mode 100644
index 4318842e455..00000000000
--- a/tests/crashes/125879.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ known-bug: rust-lang/rust#125879
-#![feature(inherent_associated_types)]
-#![allow(incomplete_features)]
-
-pub type PubAlias0 = PubTy::PrivAssocTy;
-
-pub struct PubTy;
-impl PubTy {
-    type PrivAssocTy = ();
-}
-
-pub struct S(pub PubAlias0);
-
-pub unsafe fn foo(a: S) -> S {
-    a
-}
-
-fn main() {}
diff --git a/tests/crashes/136678.rs b/tests/crashes/136678.rs
deleted file mode 100644
index e7d7de23bfe..00000000000
--- a/tests/crashes/136678.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ known-bug: #136678
-#![feature(inherent_associated_types)]
-#![feature(generic_const_exprs)]
-#![allow(incomplete_features)]
-
-struct B<const A: usize>;
-
-struct Test<const A: usize>;
-
-impl<const A: usize> Test<A> {
-    type B = B<{ A }>;
-
-    fn test(a: Self::B) -> Self::B {
-        a
-    }
-}
-
-pub fn main() {}
diff --git a/tests/crashes/138131.rs b/tests/crashes/138131.rs
deleted file mode 100644
index f400c02de8d..00000000000
--- a/tests/crashes/138131.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ known-bug: #138131
-#![feature(min_generic_const_args)]
-#![feature(inherent_associated_types)]
-struct Foo<'a> {
-    x: &'a (),
-}
-
-impl<'a> Foo<'a> {
-    fn foo(_: [u8; Foo::X]) {}
-}
-
-fn main() {}