From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/generator/issue-113279.rs | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 tests/ui/generator/issue-113279.rs (limited to 'tests/ui/generator/issue-113279.rs') diff --git a/tests/ui/generator/issue-113279.rs b/tests/ui/generator/issue-113279.rs deleted file mode 100644 index f69f804b7..000000000 --- a/tests/ui/generator/issue-113279.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![feature(generators)] - -// `foo` attempts to dereference `""`, which results in an error being reported. Later, the -// generator transform for `foo` then produces a union which contains a `str` type - unions should -// not contain unsized types, but this is okay because an error has been reported already. -// When const propagation happens later in compilation, it attempts to compute the layout of the -// generator (as part of checking whether something can be const propagated) and in turn attempts -// to compute the layout of `str` in the context of a union - where this caused an ICE. This test -// makes sure that doesn't happen again. - -fn foo() { - let _y = static || { - let x = &mut 0; - *{ - yield; - x - } += match { *"" }.len() { - //~^ ERROR cannot move a value of type `str` [E0161] - //~^^ ERROR cannot move out of a shared reference [E0507] - _ => 0, - }; - }; -} - -fn main() { - foo() -} -- cgit v1.2.3