summaryrefslogtreecommitdiffstats
path: root/tests/ui/methods/issues/issue-94581.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/methods/issues/issue-94581.rs')
-rw-r--r--tests/ui/methods/issues/issue-94581.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/methods/issues/issue-94581.rs b/tests/ui/methods/issues/issue-94581.rs
new file mode 100644
index 000000000..df393e91d
--- /dev/null
+++ b/tests/ui/methods/issues/issue-94581.rs
@@ -0,0 +1,7 @@
+fn get_slice() -> &'static [i32] {
+ &[1, 2, 3, 4]
+}
+
+fn main() {
+ let sqsum = get_slice().map(|i| i * i).sum(); //~ ERROR [E0599]
+}