summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-29522.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-29522.rs')
-rw-r--r--tests/ui/issues/issue-29522.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-29522.rs b/tests/ui/issues/issue-29522.rs
new file mode 100644
index 000000000..3d2de5ef6
--- /dev/null
+++ b/tests/ui/issues/issue-29522.rs
@@ -0,0 +1,17 @@
+// run-pass
+#![allow(unused_variables)]
+// check that we don't accidentally capture upvars just because their name
+// occurs in a path
+
+fn assert_static<T: 'static>(_t: T) {}
+
+mod foo {
+ pub fn scope() {}
+}
+
+fn main() {
+ let scope = &mut 0;
+ assert_static(|| {
+ foo::scope();
+ });
+}