diff options
Diffstat (limited to 'tests/ui/self/explicit-self-closures.rs')
-rw-r--r-- | tests/ui/self/explicit-self-closures.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/self/explicit-self-closures.rs b/tests/ui/self/explicit-self-closures.rs new file mode 100644 index 000000000..b409dfd7a --- /dev/null +++ b/tests/ui/self/explicit-self-closures.rs @@ -0,0 +1,17 @@ +// build-pass (FIXME(62277): could be check-pass?) +#![allow(dead_code)] +// Test to make sure that explicit self params work inside closures + +// pretty-expanded FIXME #23616 + +struct Box { + x: usize +} + +impl Box { + pub fn set_many(&mut self, xs: &[usize]) { + for x in xs { self.x = *x; } + } +} + +pub fn main() {} |