Skip to content

Instantly share code, notes, and snippets.

@joboet
joboet / output.txt
Created March 3, 2024 09:46
Control flow bug
note: tracking was triggered
--> /Users/Jonas/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/locks/rwlock/queue.rs:200:6
|
200 | }
| ^ created stack variable allocation of 40 bytes (alignment 8 bytes) with id 702309
|
= note: BACKTRACE on thread `unnamed-9`:
= note: inside `std::sys::locks::rwlock::queue::Node::new` at /Users/Jonas/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/locks/rwlock/queue.rs:200:6: 200:6
= note: inside `std::sys::locks::rwlock::queue::RwLock::lock_contended` at /Users/Jonas/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/locks/rwlock/queue.rs:319:24: 319:40
= note: inside `std::sys::locks::rwlock::queue::RwLock::write` at /Users/Jonas/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/locks/rwlock/queue.rs:312:13: 312:38
@joboet
joboet / 0000-pattern-types.md
Last active April 27, 2024 01:47
Pattern types RFC

Summary

This RFC introduces pattern types, which are subtypes of matchable types that are statically restricted to a subset of the variants of the original type.

@joboet
joboet / better_dropck.md
Last active March 3, 2023 09:49
Empty lifetime and `Destruct` trait

Empty lifetime and Destruct trait

Reference-level explanation

Terms

A lifetime defines a region of time in the execution of a program. It is the continuous range of operations bounded by the creation of a reference and its invalidation.

To enable useful reasoning about lifetimes, lifetimes have a relation between them:

@joboet
joboet / mach_parker.rs
Last active April 26, 2022 09:56
macOS semaphore-based thread parker
#![allow(non_camel_case_types)]
use std::{
mem::MaybeUninit,
sync::{
atomic::{AtomicBool, Ordering::SeqCst},
Arc,
},
thread,
time::Duration,
};