Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to rustc 1.0.0-nightly (4db0b3246 2015-02-25) (built 2015-02-26) #69

Merged
merged 3 commits into from
Feb 26, 2015

Conversation

SimonSapin
Copy link
Member

This makes it build again, but it have no idea what I’m doing. Please review for memory safety.

libcore now has impl<T> !Send for *mut T { }, which might be what causes:

src/atom/mod.rs:59:1: 59:42 error: conflicting implementations for trait `core::marker::Send` [E0119]
src/atom/mod.rs:59 unsafe impl Send for *mut StringCacheEntry { }
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/atom/mod.rs:59:1: 59:42 note: conflicting implementation in crate `core`
src/atom/mod.rs:59 unsafe impl Send for *mut StringCacheEntry { }
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@SimonSapin
Copy link
Member Author

It looks like this is failing on Travis because examples/summarize-events has a git dependency on string-cache from github, instead of a path dependency from its grand-parent directory. Should that be changed?

@kmcallister
Copy link
Contributor

examples/summarize-events has a git dependency on string-cache from github, instead of a path dependency from its grand-parent directory. Should that be changed?

Oops, it totally should, now that it's part of the Travis build.

@SimonSapin
Copy link
Member Author

What about examples/event-log?

kmcallister added a commit that referenced this pull request Feb 26, 2015
Upgrade to rustc 1.0.0-nightly (4db0b3246 2015-02-25) (built 2015-02-26)
@kmcallister kmcallister merged commit 96f539b into master Feb 26, 2015
@kmcallister
Copy link
Contributor

It seems like both buckets and next_in_bucket should use ptr::Unique<StringCacheEntry>. This expresses the ownership relationship and therefore enables StringCache to be Send without an unsafe impl.

I started making this change, and it's rather tricky! For one, Unique is non-nullable. That's solvable with Option but then I ran into the problem that Unique isn't Copy (nor should it be), which complicates the insert / remove code. I think it's pushing me towards a design with less aliasing and more clear ownership, but I didn't quite get there.

The unsafe impl is a reasonable fix for now. It avoids sweeping changes to unsafe code that by all indications is working correctly.

@SimonSapin SimonSapin deleted the conflicting-rawptr-mut-send branch July 24, 2015 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants