Conversation
|
cc me |
|
I'm glad to see this. Can you make the followup change that converts some |
|
@brson the PR is not ready but I added a new commit that replaces |
src/libstd/rc.rs
Outdated
There was a problem hiding this comment.
This style is more commonly found as:
Structure {
field1: value1,
field2: value2,
}|
Travis seems to have a legitimate problem |
|
This is ready to go and looks awesome. @nikomatsakis can you review? |
|
I'm not sure what the effect of using |
|
Do we still intend to add a |
|
@flaper87 r+ modulo nits. I see some Travis CI failures, though? Didn't investigate. |
There was a problem hiding this comment.
This doesn't seem quite right. What about something like:
struct Wrap<T> { field: T }
static UNSAFE: Unsafe<int> = ...;
static WRAPPED_UNSAFE: Wrap<&'static Unsafe<int>> = Wrap { field: &UNSAFE };
|
I think I would give r+ just to get this landed (and do the cleanups I suggested as a follow-up), except that Travis reporting a 100+ character line error. |
The interner uses `RefCell` internally which opted out from Share.
We currently gather loans for static items that are defined within functions. This change enables loan gathering on static items declared globally.
`Share` implies that all *reachable* content is *threadsafe*. Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)... Fixes #11781 cc #12577 What this PR will do ================ - [x] Add Share kind and - [x] Replace usages of Freeze with Share in bounds. - [x] Add Unsafe<T> #12577 - [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior What's left to do in a separate PR (after the snapshot)? =========================================== - Remove `Freeze` completely
Shareimplies that all reachable content is threadsafe.Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)...
Fixes #11781
cc #12577
What this PR will do
Unsafe<T>type to be used as the basis forCell,RefCell,Atomic, etc and removeFreeze#12577Unsafe<T>interiorWhat's left to do in a separate PR (after the snapshot)?
Freezecompletely