Note that this is a Linux-specific feature.
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
;
Note that this is a Linux-specific feature.
Say we are a library libfoo.so.3.5
, and some dependent binary artifact is being linked against us.
./main
;use ::polonius_the_crab::prelude::*; | |
struct DummyStream { | |
buffer: Vec<u8>, | |
frame_count: u32, | |
} | |
impl DummyStream { | |
fn new(width: usize, height: usize) -> Self { | |
Self { |
# http://www.graphviz.org/content/cluster | |
digraph G { | |
graph [fontname = "courier"]; | |
node [fontname = "courier", shape=box]; | |
edge [fontname = "courier"]; | |
compound=true; | |
subgraph cluster_a { |
digraph __crate__ { | |
subgraph cluster_Mir_0_10 { | |
graph [fontname="Courier, monospace"]; | |
node [fontname="Courier, monospace"]; | |
edge [fontname="Courier, monospace"]; | |
// label=<fn main() -> ()<br align="left"/>let mut _1: std::string::String;<br align="left"/>let mut _2: DropGlue<&mut std::string::String>;<br align="left"/>let mut _3: &mut std::string::String;<br align="left"/>let mut _4: *mut std::string::String;<br align="left"/>let _5: ();<br align="left"/>debug _2 => _2;<br align="left"/>debug _1 => _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 |
[These posts have been extracted from this Discord conversation, so as not to require readers to use their Discord account to read it 😔]
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.
Percentage:
<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>
Pixels:
<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">
struct MyAllocator; | |
#[global_allocator] | |
static A: MyAllocator = MyAllocator; | |
const _: () = { | |
use ::std::{ | |
alloc::{ | |
GlobalAlloc, | |
Layout, |
Panics which happen inside a Drop
impl currently unwind as long as the drop was not itself called during unwinding (which would otherwise abort immediated due to a double-panic). This design meeting proposes to change this behavior to always abort if a panic attempts to escape a drop, even if this drop was invoked as part of normal function execution (as opposed to unwinding).
The dicussion on this issue dates back to 2014 (rust-lang/rust#14875) where the decision was made to support unwinding in drops but leave the door open to potentially reversing this decision.