From 612afd1b49950d38fddbe52b3efec862a677928d Mon Sep 17 00:00:00 2001 From: SangHun Kim Date: Mon, 27 Apr 2026 23:27:14 +0900 Subject: [PATCH] Add regression test --- .../const-eval/static-promotion-issue-101363.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/consts/const-eval/static-promotion-issue-101363.rs diff --git a/tests/ui/consts/const-eval/static-promotion-issue-101363.rs b/tests/ui/consts/const-eval/static-promotion-issue-101363.rs new file mode 100644 index 0000000000000..ff17377757653 --- /dev/null +++ b/tests/ui/consts/const-eval/static-promotion-issue-101363.rs @@ -0,0 +1,11 @@ +//@ check-pass +// Regression test for + +const OPTIONAL_SLICE_V1: Option<&'static [u8]> = Some(&{ + let array = [1, 2, 3]; + array +}); + +fn main() { + let _ = OPTIONAL_SLICE_V1; +}