From 847311e36f9e194a2b06b583df61bf6770038b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 21 Mar 2024 22:02:32 +0100 Subject: [PATCH] add test for ice "cannot relate region: LUB(ReErased, ReError)" Fixes #109178 --- .../ice-cannot-relate-region-109178.rs | 14 +++++++++++++ .../ice-cannot-relate-region-109178.stderr | 21 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/ui/inference/ice-cannot-relate-region-109178.rs create mode 100644 tests/ui/inference/ice-cannot-relate-region-109178.stderr diff --git a/tests/ui/inference/ice-cannot-relate-region-109178.rs b/tests/ui/inference/ice-cannot-relate-region-109178.rs new file mode 100644 index 00000000000..3282f95a992 --- /dev/null +++ b/tests/ui/inference/ice-cannot-relate-region-109178.rs @@ -0,0 +1,14 @@ +// test for ice #109178 cannot relate region: LUB(ReErased, ReError) + +#![allow(incomplete_features)] +#![crate_type = "lib"] +#![feature(adt_const_params, generic_const_exprs)] + +struct Changes +//~^ ERROR `&` without an explicit lifetime name cannot be used here +where + [(); CHANGES.len()]:, {} + +impl Changes where [(); CHANGES.len()]: {} +//~^ ERROR `&` without an explicit lifetime name cannot be used here +//~^^ ERROR `&` without an explicit lifetime name cannot be used here diff --git a/tests/ui/inference/ice-cannot-relate-region-109178.stderr b/tests/ui/inference/ice-cannot-relate-region-109178.stderr new file mode 100644 index 00000000000..0ac924452c0 --- /dev/null +++ b/tests/ui/inference/ice-cannot-relate-region-109178.stderr @@ -0,0 +1,21 @@ +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:7:31 + | +LL | struct Changes + | ^ explicit lifetime name needed here + +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:12:21 + | +LL | impl Changes where [(); CHANGES.len()]: {} + | ^ explicit lifetime name needed here + +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:12:23 + | +LL | impl Changes where [(); CHANGES.len()]: {} + | ^ explicit lifetime name needed here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0637`.