summaryrefslogtreecommitdiff
path: root/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/impls-nested-within-anon-consts-semantic.rs')
-rw-r--r--tests/ui/parser/impls-nested-within-anon-consts-semantic.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs b/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs
new file mode 100644
index 00000000000..b74dc3d4926
--- /dev/null
+++ b/tests/ui/parser/impls-nested-within-anon-consts-semantic.rs
@@ -0,0 +1,35 @@
+// Regression test for issue #89342 and for part of #119924.
+// check-pass
+
+struct Expr<const N: u32>;
+
+trait Trait0 {
+ fn required(_: Expr<{
+ struct Type;
+
+ impl Type {
+ // This visibility qualifier used to get rejected.
+ pub fn perform() {}
+ }
+
+ 0
+ }>);
+}
+
+trait Trait1 {}
+
+impl Trait1 for ()
+where
+ [(); {
+ struct Type;
+
+ impl Type {
+ // This visibility qualifier used to get rejected.
+ pub const STORE: Self = Self;
+ }
+
+ 0
+ }]:
+{}
+
+fn main() {}