Description: Fix: Bypass temporary MappedSlice lifetime with from_raw_parts
 TODO: The MemoryMappedFile as_slice method returns a temporary guard (
MappedSlice). Rust prohibits returning a borrowed slice from a dropped 
temporary. This patch uses unsafe from_raw_parts to extract the pointer 
directly. This is logically safe because the function holds an excluse &mut
self borrow, preventing concurrent mutations or resizes.
 .
 dz6 (0.7.0-1) unstable; urgency=medium
 .
   * Initial release to Debian Mentors.
Author: Danielly <danielly@mentebinaria.com.br>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2026-06-19

--- dz6-0.7.0.orig/target/release/.fingerprint/dz6-32424271d1d79588/output-bin-dz6
+++ dz6-0.7.0/target/release/.fingerprint/dz6-32424271d1d79588/output-bin-dz6
@@ -1,3 +1,3 @@
-{"$message_type":"diagnostic","message":"cannot return reference to temporary value","code":{"code":"E0515","explanation":"A reference to a local variable was returned.\n\nErroneous code example:\n\n```compile_fail,E0515\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nLocal variables, function parameters and temporaries are all dropped before\nthe end of the function body. A returned reference (or struct containing a\nreference) to such a dropped value would immediately be invalid. Therefore\nit is not allowed to return such a reference.\n\nConsider returning a value that takes ownership of local data instead of\nreferencing it:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"error","spans":[{"file_name":"src/app.rs","byte_start":1120,"byte_end":1164,"line_start":41,"line_end":41,"column_start":20,"column_end":64,"is_primary":true,"text":[{"text":"            return &mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":20,"highlight_end":64}],"label":"returns a reference to data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/app.rs","byte_start":1121,"byte_end":1164,"line_start":41,"line_end":41,"column_start":21,"column_end":64,"is_primary":false,"text":[{"text":"            return &mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":21,"highlight_end":64}],"label":"temporary value created here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0515]\u001b[0m\u001b[1m: cannot return reference to temporary value\u001b[0m\n  \u001b[1m\u001b[94m--> \u001b[0msrc/app.rs:41:20\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m             return &mmap.as_slice(0, self.size as u64).unwrap();\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m^\u001b[0m\u001b[1m\u001b[94m-------------------------------------------\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m|\u001b[0m\u001b[1m\u001b[94m|\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m|\u001b[0m\u001b[1m\u001b[94mtemporary value created here\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91mreturns a reference to data owned by the current function\u001b[0m\n\n"}
+{"$message_type":"diagnostic","message":"cannot index into a value of type `&mut MemoryMappedFile`","code":{"code":"E0608","explanation":"Attempted to index a value whose type doesn't implement the\n`std::ops::Index` trait.\n\nErroneous code example:\n\n```compile_fail,E0608\n0u8[2]; // error: cannot index into a value of type `u8`\n```\n\nOnly values with types that implement the `std::ops::Index` trait\ncan be indexed with square brackets. Example:\n\n```\nlet v: Vec<u8> = vec![0, 1, 2, 3];\n\n// The `Vec` type implements the `Index` trait so you can do:\nprintln!(\"{}\", v[2]);\n```\n\nTuples and structs are indexed with dot (`.`), not with brackets (`[]`),\nand tuple element names are their positions:\n```ignore(pseudo code)\n// this (pseudo code) expression is true for any tuple:\ntuple == (tuple.0, tuple.1, ...)\n```\n"},"level":"error","spans":[{"file_name":"src/app.rs","byte_start":1125,"byte_end":1139,"line_start":41,"line_end":41,"column_start":25,"column_end":39,"is_primary":true,"text":[{"text":"            return &mmap[0..self.size];","highlight_start":25,"highlight_end":39}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0608]\u001b[0m\u001b[1m: cannot index into a value of type `&mut MemoryMappedFile`\u001b[0m\n  \u001b[1m\u001b[94m--> \u001b[0msrc/app.rs:41:25\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m             return &mmap[0..self.size];\n   \u001b[1m\u001b[94m|\u001b[0m                         \u001b[1m\u001b[91m^^^^^^^^^^^^^^\u001b[0m\n\n"}
 {"$message_type":"diagnostic","message":"aborting due to 1 previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[1m\u001b[91merror\u001b[0m\u001b[1m: aborting due to 1 previous error\u001b[0m\n\n"}
-{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0515`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about this error, try `rustc --explain E0515`.\u001b[0m\n"}
+{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0608`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about this error, try `rustc --explain E0608`.\u001b[0m\n"}
