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 --- tests/ui/nll/issue-51351.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/ui/nll/issue-51351.rs (limited to 'tests/ui/nll/issue-51351.rs') diff --git a/tests/ui/nll/issue-51351.rs b/tests/ui/nll/issue-51351.rs new file mode 100644 index 000000000..591d49584 --- /dev/null +++ b/tests/ui/nll/issue-51351.rs @@ -0,0 +1,21 @@ +// +// Regression test for #51351 and #52133: In the case of #51351, +// late-bound regions (like 'a) that were unused within the arguments of +// a function were overlooked and could case an ICE. In the case of #52133, +// LBR defined on the creator function needed to be added to the free regions +// of the closure, as they were not present in the closure's generic +// declarations otherwise. +// +// check-pass + +fn creash<'a>() { + let x: &'a () = &(); +} + +fn produce<'a>() { + move || { + let x: &'a () = &(); + }; +} + +fn main() {} -- cgit v1.2.3