From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/issues/issue-31299.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/test/ui/issues/issue-31299.rs (limited to 'src/test/ui/issues/issue-31299.rs') diff --git a/src/test/ui/issues/issue-31299.rs b/src/test/ui/issues/issue-31299.rs deleted file mode 100644 index 78c3252d3..000000000 --- a/src/test/ui/issues/issue-31299.rs +++ /dev/null @@ -1,35 +0,0 @@ -// run-pass -// Regression test for #31299. This was generating an overflow error -// because of eager normalization: -// -// proving `M: Sized` requires -// - proving `PtrBack>: Sized` requires -// - normalizing `Vec< as Front>::Back>>: Sized` requires -// - proving `Vec: Front` requires -// - `M: Sized` <-- cycle! -// -// If we skip the normalization step, though, everything goes fine. -// -// This could be fixed by implementing lazy normalization everywhere. -// -// However, we want this to work before then. For that, when checking -// whether a type is Sized we only check that the tails are Sized. As -// PtrBack does not have a tail, we don't need to normalize anything -// and this compiles - -trait Front { - type Back; -} - -impl Front for Vec { - type Back = Vec; -} - -struct PtrBack(#[allow(unused_tuple_struct_fields)] Vec); - -struct M(#[allow(unused_tuple_struct_fields)] PtrBack>); - -#[allow(unused_must_use)] -fn main() { - std::mem::size_of::(); -} -- cgit v1.2.3