MaulingMonkey
MaulingMonkey
> Since COM methods will almost always result in accesses to memory outside the bounds of the base class struct, calling these methods will usually result in undefined behavior. I...
Using exposed provenance is trickier than I'd hoped. [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=13a9c57a23e138ed7b671d7f88f42f90) ```rust #![feature(strict_provenance)] #![forbid(unsafe_op_in_unsafe_fn)] #![allow(dead_code)] #![allow(non_snake_case)] use std::sync::{Arc, atomic::*}; use core::ffi::c_void; fn main() { let com = CComObject::new(); unsafe { Arc::increment_strong_count(com) };...
> ### Unresolved Questions > * What's Problematic (And Should Work)? > > * [ ] downcasting to subclasses? > * Would be nice if you could create a reference...
> I believe Miri is complaining in your example because you're only exposing the provenance of the `CComObject` itself when you call `expose_addr` from the `CComObject::deref` impl Ahh, good catch!...
> Is this, in fact, an instance of undefined behavior? I believe so. It violates one of the two core rules defined in the [rustonomicon](https://doc.rust-lang.org/nomicon/references.html): "A reference cannot outlive its...
Saw [your post on HN](https://news.ycombinator.com/item?id=26089539) and used your project as an excuse to work on my WASM build tools. I've uploaded a built version to github so you can play...
Even if the disassembly was exactly the same aside from the constants and file timestamps, [the readme](https://github.com/janiorca/sphere_dance#for-the-release-version) mentions crinkler is used to compress the executable further - which could mean...
I suspect you've confused `include_str!` with `std::fs::read_to_string`. include_str does *not* require you keep the file: ``` C:\local\example>echo fn main() { println!("{}", include_str!("test.txt")); } > main.rs C:\local\example>echo Hello, world! > test.txt...
You can also see the resulting string inlined into your executable:  (`"Hello, world! \r\n"`)
The extension by default explicitly tries to use `nightly`, so you'd need to change that under `Tools > Options > Rust`. Of course, that dialog was broken for me in...