Skip to content
Merged
Changes from 1 commit
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
Next Next commit
add regression test
  • Loading branch information
lcnr committed Feb 13, 2026
commit b4f38c1da4a7aa9d7065253f77a65a482a5a7993
17 changes: 17 additions & 0 deletions tests/ui/layout/rigid-alias-due-to-broken-impl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Make sure we don't ICE if `layout_of` encounters an alias
// which is rigid due to a malformed program. A regression test
// for #152545.
//
// This specific ICE happens in the `KnownPanicsLint` visitor.

//@ compile-flags: --crate-type=rlib
trait Foo {
type Assoc;
}

// The trait solver only treats missng associated items
// as rigid if the self-type is known to be unsized.
impl Foo for str {}
//~^ ERROR not all trait items implemented

fn foo(_: [u32; std::mem::size_of::<<str as Foo>::Assoc>()]) {}