diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-29522.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-29522.rs b/src/test/ui/issues/issue-29522.rs new file mode 100644 index 000000000..3d2de5ef6 --- /dev/null +++ b/src/test/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(); + }); +} |