about summary refs log tree commit diff
path: root/tests/ui/parser/impls-nested-within-fns-semantic-1.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-03-05 00:02:35 +0100
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-03-05 00:12:15 +0100
commit7d428db605d305198481b2201f46f5f91d5f8369 (patch)
treea76383abbc61da0ad62ab040e48ffd2aed41ddf3 /tests/ui/parser/impls-nested-within-fns-semantic-1.rs
parent5257aee7dd163d21d32fa904578d4fb0f4c91b79 (diff)
downloadrust-7d428db605d305198481b2201f46f5f91d5f8369.tar.gz
rust-7d428db605d305198481b2201f46f5f91d5f8369.zip
AST validation: Improve handling of inherent impls nested within functions and anon consts
Diffstat (limited to 'tests/ui/parser/impls-nested-within-fns-semantic-1.rs')
-rw-r--r--tests/ui/parser/impls-nested-within-fns-semantic-1.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/parser/impls-nested-within-fns-semantic-1.rs b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs
new file mode 100644
index 00000000000..43530e41a66
--- /dev/null
+++ b/tests/ui/parser/impls-nested-within-fns-semantic-1.rs
@@ -0,0 +1,22 @@
+// Regression test for part of issue #119924.
+//@ check-pass
+
+#![feature(const_trait_impl, effects)]
+
+#[const_trait]
+trait Trait {
+    fn required();
+}
+
+impl const Trait for () {
+    fn required() {
+        pub struct Type;
+
+        impl Type {
+            // This visibility qualifier used to get rejected.
+            pub fn perform() {}
+        }
+    }
+}
+
+fn main() {}