Skip to content

Instantly share code, notes, and snippets.

View danielhenrymantilla's full-sized avatar
🦀

Daniel Henry-Mantilla danielhenrymantilla

🦀
View GitHub Profile
@danielhenrymantilla
danielhenrymantilla / msrv_policy.md
Last active September 4, 2023 11:10
MSRV Policy

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 {