Closed jon-whit closed 2 months ago
Yeah, it's hard to know. Rust doesn't document (afaik) what the preconditions of unsafe
methods are, or .. they change the documentation. The good news is that as of two days ago (https://github.com/TimelyDataflow/differential-dataflow/pull/481) the unsafe
code in consolidate_updates
was removed, so you shouldn't see this.
Though! Looking at the stack trace, it seems like you might be using a very old version (0.11) rather than only an old version (0.12). In 0.12, the code uses std::ptr::swap
, rather than the std::mem::swap
that shows up on your stack trace, and ptr::swap
is documented as allowing overlap.
I'll try out the quick start and see if I can tease out what is pointing you at the very old version of the code, and try and get this fixed. Thank you for the report!
So, the glitch is that the quick start tells you to put this in your Cargo.toml
:
[package]
name = "my_project"
version = "0.1.0"
authors = ["Your Name <your_name@you.ch>"]
[dependencies]
timely = "0.11.1"
differential-dataflow = "0.11.0"
and .. that's where you are picking up the several-years-old version of the code. :D If you change both to 0.12.0, probably should all work. Better yet (imo) pointing at the github repo might be the better approach (0.12 is several years old, though crates.io doesn't have anything newer). I'll ponder today what the "right" thing to do is, and get on that.
Thanks again for the report!
Should be fixed up in the linked PR. Also, a few other minor glitches fixed that might have caused you to get stuck.
I'm reading along the "Getting Started" guide and am not able to get the first program to work.
Steps to Reproduce:
Install the latest release of Rust.
Create a new Rust project
Copy/paste the source snippet from "Step 1: Write a Program" into
src/main.rs
.Run the source
I get the error:
It seems the timely-dataflow library violates some safe memory access polcies that newer versions of Rust may enforce as compared to previous versions of Rust as of when the article was written 🤷 ? What version of Rust should these examples be runnable on, and do you have any recommendations for how to resolve this?
I'm generally quite new to Rust, so that's part of this experience as well, and it may well be an issue here 😄