| Age | Commit message (Collapse) | Author | Lines |
|
This PR removes the `Freeze` kind and the `NoFreeze` marker completely.
Fixes #12577
cc @nikomatsakis r?
|
|
These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.
|
|
|
|
This commit removes the `get()` method from `Ref` and `RefMut` in favor of the `*` operator, and removes all usage of the `deref()` function manually from rustc, favoring using `*` instead.
Some of the code is a little wacky, but that's due to either #13044 or #13042
|
|
I've found a common use case being to fill a slice (not an owned vector)
completely with bytes. It's posible for short reads to happen, and if you're
trying to get an exact number of bytes then this helper will be useful.
|
|
Favor using '*' instead
|
|
This method has been entirely obsoleted by autoderef, so there's no reason for
its existence.
|
|
`FormatMessageW()` is called by `std::os::last_os_error()` to convert
errno into string, but the function may fail on non-english locale.
I don't know why it fails, but anyway it's better to return errno
than to `fail!()` in the case.
Fixes #13075
Fixes #13073
|
|
|
|
|
|
|
|
These are superfluous now that we have fixed rvalue lifetimes and Deref.
I'd also like to kill off `get` and `set`, but that'll be a large change so I want to make sure that we actually want to do that first.
|
|
These methods can be mistaken for general "read some bytes" utilities when
they're actually only meant for reading an exact number of bytes. By renaming
them it's much clearer about what they're doing without having to read the
documentation.
Closes #12892
|
|
It's useful for structures which use deriving(Clone), even though it's
implicitly copyable.
Closes #13047
|
|
Closes #11583, rebasing of #12430 now that we've got `Share` and better analysis with statics.
|
|
Replace syntax::opt_vec with syntax::owned_slice
The `owned_slice::OwnedSlice` is `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`).
This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
|
|
syntax::opt_vec is now entirely unused, and so can go.
|
|
The compiler will no longer inject libgreen as the default runtime for rust
programs, this commit switches it over to libnative by default. Now that
libnative has baked for some time, it is ready enough to start getting more
serious usage as the default runtime for rustc generated binaries.
We've found that there isn't really a correct decision in choosing a 1:1 or M:N
runtime as a default for all applications, but it seems that a larger number of
programs today would work more reasonable with a native default rather than a
green default.
With this commit come a number of bugfixes:
* The main native task is now named "<main>"
* The main native task has the stack bounds set up properly
* #[no_uv] was renamed to #[no_start]
* The core-run-destroy test was rewritten for both libnative and libgreen and
one of the tests was modified to be more robust.
* The process-detach test was locked to libgreen because it uses signal handling
|
|
test: Remove all `~[T]` from tests, libgetopts, compiletest, librustdoc, and libnum
And most from libtest, libflate, and adds `deny(deprecated_owned_vector)`s to the smaller modules with that have zero (or nearly zero) uses of `~[T]`.
Revival of #12837
|
|
Since `Arc` has been using `Atomic`, this closes 12625.
Closes #12625.
|
|
|
|
|
|
It's useful for structures which use deriving(Clone, TotalEq), even though it's
implicitly copyable.
Closes #13047
|
|
These are superfluous now that we have fixed rvalue lifetimes and Deref.
|
|
These methods can be mistaken for general "read some bytes" utilities when
they're actually only meant for reading an exact number of bytes. By renaming
them it's much clearer about what they're doing without having to read the
documentation.
Closes #12892
|
|
It's all no longer necessary
|
|
Support for this is less universal than for word-size things;
it has no users; i'd rather play it safe.
|
|
I'm not comfortable exposing public functions that purport to do
atomic operations on arbitrary T.
|
|
These mutate values behind references that are Freeze, which is not
allowed.
|
|
|
|
In Rust, the strongest guarantee that `&mut` provides is that the memory
pointed to is *not aliased*, whereas `&`'s guarantees are much weaker:
that the value can be aliased, and may be mutated under proper precautions
(interior mutability).
Our atomics though use `&mut` for mutation even while creating multiple
aliases, so this changes them to use 'interior mutability', mutating
through immutable references.
|
|
It's now in the prelude.
|
|
This is an incredibly common type, and it is expected to be used in many many
places. This type should be in the prelude.
|
|
Remove std::cast::transmute_immut_unsafe.
It can be done in safe code using `as *T`.
|
|
`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
|
|
this comes from a discussion on IRC where the split between stdin and stdout
seemed unnatural, and the fact that reading on stdin won't flush stdout, which
is unlike every other language (including C's stdio).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #11781
|
|
Closes #12771
|
|
Closes #12702
|
|
|
|
It can be done in safe code using `as *T`.
|
|
Various improvements. There's a lot more that can be done.
|
|
I also removed a couple of methods that were silly and added sort.
|
|
I also removed a couple of methods that were silly and added sort.
|