Skip to content

Instantly share code, notes, and snippets.

View danielhenrymantilla's full-sized avatar
🦀

Daniel Henry-Mantilla danielhenrymantilla

🦀
View GitHub Profile

MSRV Policy

The MSRV (Minimum Supported Rust [toolchain] Version) policy of my crates for a [semver-compatible bump] is the following:

stable - 9

More precisely:

  • Patch[^patch] bump ⇒ same MSRV

@danielhenrymantilla
danielhenrymantilla / _question.md
Last active June 2, 2023 11:49
Soundness of "existential lifetime" erasure

[These posts have been extracted from this Discord conversation, so as not to require readers to use their Discord account to read it 😔]

Question

HI!

Question and idea about narrowing lifetime of mutable references.

In rust code when developing finite state machines, behaviour trees and other algorithms we often need to pass around Context on which these algorithms will work.

digraph __crate__ {
subgraph cluster_Mir_0_10 {
graph [fontname="Courier, monospace"];
node [fontname="Courier, monospace"];
edge [fontname="Courier, monospace"];
// label=<fn main() -&gt; ()<br align="left"/>let mut _1: std::string::String;<br align="left"/>let mut _2: DropGlue&lt;&amp;mut std::string::String&gt;;<br align="left"/>let mut _3: &amp;mut std::string::String;<br align="left"/>let mut _4: *mut std::string::String;<br align="left"/>let _5: ();<br align="left"/>debug _2 =&gt; _2;<br align="left"/>debug _1 =&gt; _1;<br align="left"/>>;
bb0__0_10 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">StorageLive(_1)<br/></td></tr><tr><td align="left">_1 = String::new()</td></tr></table>>];
bb1__0_10 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left" balign="left">Sto
# http://www.graphviz.org/content/cluster
digraph G {
graph [fontname = "courier"];
node [fontname = "courier", shape=box];
edge [fontname = "courier"];
compound=true;
subgraph cluster_a {
@danielhenrymantilla
danielhenrymantilla / nested_polonius.rs
Last active October 10, 2024 02:36
Nested polonius-the-crab
use ::polonius_the_crab::prelude::*;
struct DummyStream {
buffer: Vec<u8>,
frame_count: u32,
}
impl DummyStream {
fn new(width: usize, height: usize) -> Self {
Self {
@danielhenrymantilla
danielhenrymantilla / understading_soname.md
Created April 3, 2025 15:57
Understanding the role of `SONAME` in dynamic linkage and dynamic loading

Understanding the role of SONAME in dynamic linkage and dynamic loading

Note that this is a Linux-specific feature.

The primary role of SONAME

Say we are a library libfoo.so.3.5, and some dependent binary artifact is being linked against us.

  • Note that this dependent binary artifact may well be a final executable, à la ./main;