Commit Graph

43808 Commits

Author SHA1 Message Date
Manish Goregaokar
3afc385ae1 Rollup merge of #26349 - petrochenkov:bitwise, r=steveklabnik
I'm surprised that bitwise operators `&`, `|` and `^` are implemented for `bool` arguments, because inspection of boolean's bits is not something that should be encouraged and because `&&` -> `&` is a common typo, but if they are implemented, then their behavior should be documented.
2015-06-18 13:38:10 +05:30
Manish Goregaokar
b5f2b098d7 Rollup merge of #26348 - eefriedman:unused-interiorsafety, r=luqmana 2015-06-18 13:38:09 +05:30
Manish Goregaokar
39e4d03e35 Rollup merge of #26342 - steveklabnik:quix_reference_fix, r=alexcrichton
https://github.com/rust-lang/rust/pull/26323/files#r32503568
2015-06-18 13:38:09 +05:30
Manish Goregaokar
b780bc513c Rollup merge of #26314 - steveklabnik:gh26312, r=bluss
Fixes #26312
2015-06-18 13:38:09 +05:30
bors
b20728c0de Auto merge of #26364 - frewsxcv:regression-tests-22864, r=bluss
Fixes https://github.com/rust-lang/rust/issues/22864
2015-06-18 07:19:32 +00:00
bors
a19ed8ad15 Auto merge of #26340 - bluss:bench-sigfix, r=alexcrichton
test: Fix a bug in bench result formatting

It would skip the middle part if it was 0, displaying a number a 1000
times too small. The MB/s number next to it gave it away.

Fixed it looks like this:

```
test h ... bench:   1,000,129 ns/iter (+/- 4,730)
```
2015-06-18 04:52:28 +00:00
bors
1d33318018 Auto merge of #26336 - dotdash:raw_ptr_coercions, r=nrc
Unlike coercing from reference to unsafe pointer, coercing between two
unsafe pointers doesn't need an AutoDerefRef, because there is no region
that regionck would need to know about.

In unoptimized libcore, this reduces the number of "auto_deref" allocas
from 174 to 4.
2015-06-18 03:16:40 +00:00
Corey Farwell
c680f08182 Add regression test for #21622
Closes #21622
2015-06-17 19:46:33 -07:00
Corey Farwell
fba9cecab7 Add regression test for #25180
Closes #25180
2015-06-17 19:37:27 -07:00
Nick Hamann
b637f6b1bd Fix the E0252 error message to use better names for things.
Currently in the E0252 message, traits and modules are all called types
(as in "a type named `Foo` has already been imported", even when `Foo` was
a trait or module). This commit changes that to additionally detect when
the import in question is a trait or module and report it accordingly.

Fixes #25396.
2015-06-17 19:41:55 -05:00
Alex Crichton
fcd99aae0a rustc_driver: Frob the global PATH less
Environment variables are global state so this can lead to surprising results if
the driver is called in a multithreaded environment (e.g. doctests). There
shouldn't be any memory corruption that's possible, but a lot of the bots have
been failing because they can't find `cc` or `gcc` in the path during doctests,
and I highly suspect that it is due to the compiler modifying `PATH` in a
multithreaded fashion.

This commit moves the logic for appending to `PATH` to only affect the child
process instead of also affecting the parent, at least for the linking stage.
When loading dynamic libraries the compiler still modifies `PATH` on Windows,
but this may be more difficult to fix than spawning off a new process.
2015-06-17 17:38:03 -07:00
Alex Crichton
2e63604e2a mk: Fix reconfiguring top-level ./configure
In #26252 support was added to have prettier paths printed out on failure by not
passing the full path to the source file to the compiler, but instead just a
small relative path. To preserve this relative path across configurations, the
`SREL` variable was used for reconfiguring, but if `SREL` is empty then it will
attempt to run the command `configure` which is distinct from running
`./configure` (e.g. doesn't run the local script).

This commit modifies the `SREL` value to re-run the configure script by setting
it to `./` in the case where `SREL` is empty.
2015-06-17 17:32:11 -07:00
bors
20d23d8e57 Auto merge of #26347 - nagisa:macro-exp, r=nrc
r? @nrc, because breakage was caused by https://github.com/rust-lang/rust/pull/25318
2015-06-18 00:26:23 +00:00
Brian Anderson
ff207f1c91 Update AUTHORS.txt for 1.1 2015-06-17 16:32:02 -07:00
Brian Anderson
2b78d9aa84 Update .mailmap 2015-06-17 16:32:02 -07:00
Brian Anderson
13bba763f5 Add src/etc/add-authors.sh script for managing the AUTHORS.txt file
This is the kind of dumb task that gets done a different way every
time and is easily automated.
2015-06-17 16:32:01 -07:00
Brian Anderson
bc8d862e59 Resort AUTHORS.txt using unix sort 2015-06-17 16:32:01 -07:00
bors
713d9176ad Auto merge of #26326 - nikomatsakis:optimize-fulfillment-cache-in-tcx, r=pcwalton
When we successfully resolve a trait reference with no type/lifetime parameters, like `i32: Foo` or `Box<u32>: Sized`, this is in fact globally true. This patch adds a simple global to the tcx to cache such cases. The main advantage of this is really about caching things like `Box<Vec<Foo>>: Sized`. It also points to the need to revamp our caching infrastructure -- the current caches make selection cost cheaper, but we still wind up paying a high cost in the confirmation process, and in particular unrolling out dependent obligations. Moreover, we should probably do caching more uniformly and with a key that takes the where-clauses into account. But that's for later.

For me, this shows up as a reasonably nice win (20%) on Servo's script crate (when built in dev mode). This is not as big as my initial measurements suggested, I think because I was building my rustc with more debugging enabled at the time. I've not yet done follow-up profiling and so forth to see where the new hot spots are. Bootstrap times seem to be largely unaffected.

cc @pcwalton 

This is technically a [breaking-change] in that functions with unsatisfiable where-clauses may now yield errors where before they may have been accepted. Even before, these functions could never have been *called* by actual code. In the future, such functions will probably become illegal altogether, but in this commit they are still accepted, so long as they do not rely on the unsatisfiable where-clauses. As before, the functions still cannot be called in any case.
2015-06-17 22:50:17 +00:00
bors
8af39cebc5 Auto merge of #26321 - srwalter:remove-i386-textrel, r=alexcrichton
This prevents a relocation in the text section.  Text relocations are
incompatible with hardened kernels.

https://github.com/rust-lang/rust/issues/5714
2015-06-17 20:04:19 +00:00
Brian Anderson
9b29cbe1ea Remove unused emit_feature_warn function 2015-06-17 11:31:43 -07:00
bors
37cc79f81c Auto merge of #26315 - steveklabnik:gh26287, r=alexcrichton
The font can make this hard to read, and we don't even strictly need
the annotation, so let's just remove it

Fixes #26287
2015-06-17 18:09:10 +00:00
bors
6065bed37b Auto merge of #26062 - eefriedman:cleanup-cached, r=nikomatsakis
Using the wrong landing pad has obvious bad effects, like dropping a value
twice.

Testcase written by Alex Crichton.

Fixes #25089.
2015-06-17 16:14:30 +00:00
Alex Crichton
913c2273eb Add comment about stabilizing CString::from_ptr
This naming needs to consider the raw vs ptr naming of
Box/CStr/CString/slice/etc.
2015-06-17 09:07:17 -07:00
Alex Crichton
c9b40a30c0 std: Stabilize vec_map::Entry::or_insert{,_with}
These functions mirror the other Entry APIs of other maps, and were mistakenly
just not stabilized the first time around.
2015-06-17 09:07:17 -07:00
Alex Crichton
edf933538b std: Hide some internal functions more aggressively
* Add `#[doc(hidden)]`
* Rename away from `Error::description`
2015-06-17 09:07:17 -07:00
Alex Crichton
252ef28593 std: Update stable since for core::char
Also add `#[doc(hidden)]` to a few internal functions.
2015-06-17 09:07:17 -07:00
Alex Crichton
b4a2823cd6 More test fixes and fallout of stability changes 2015-06-17 09:07:17 -07:00
Alex Crichton
aa931e9c6f std: Move free-functions to associated functions
This commit moves the free functions in the `rc`, `arc`, and `boxed` modules to
associated functions on their respective types, following the recent trend
towards this pattern. The previous free functions are all left in-place with
`#[deprecated]` pointers towards the new locations.

This commit also deprecates `arc::get_mut` and `Arc::make_unique` with no
replacement as they are racy in the face of weak pointers.
2015-06-17 09:07:17 -07:00
Alex Crichton
3346fb0442 std: Deprecate the thunk module
This has been replaced with `FnBox`
2015-06-17 09:07:17 -07:00
Alex Crichton
d645f8fc28 std: Deprecate the scoped feature
The `thread::scoped` function will never be stabilized as-is and the API will
likely change significantly if it does, so this function is deprecated for
removal.
2015-06-17 09:07:17 -07:00
Alex Crichton
04f7eba909 std: Deprecate the future feature
This commit deprecates the `sync::Future` type to be developed outside in
crates.io instead.
2015-06-17 09:07:17 -07:00
Alex Crichton
96cce02924 std: Deprecate the exit_status feature
These two functions should be replaceable with the `process::exit` function.
2015-06-17 09:07:17 -07:00
Alex Crichton
0d818b4ee4 std: Deprecate the io::BufStream type
Questions about the utility of this type has caused it to move to crates.io in
the `bufstream` crate, so this type can be deprecated.
2015-06-17 09:07:16 -07:00
Alex Crichton
2d389c125e std: Stabilize the str_matches feature
This commit stabilizes the `str::{matches, rmatches}` functions and iterators,
but renames the unstable feature for the `str::{matches,rmatches}_indices`
function to `str_match_indices` due to the comment present on the functions
about the iterator's return value.
2015-06-17 09:07:16 -07:00
Alex Crichton
17a1059d83 std: Stabilize the iter_{once,empty} features
This commit stabilizes these two iterator primitives as they have gone through
the RFC process and had some time to bake now.
2015-06-17 09:07:16 -07:00
Alex Crichton
f3580879b9 std: Stabilize the once_new feature
This function follows the well-established "constructor" pattern and the
initialization constant will likely be deprecated in favor of it once `const_fn`
is stabilized.
2015-06-17 09:07:16 -07:00
Alex Crichton
c032d6fd39 std: Stabilize the sync_poison feature
These accessor/constructor methods for a `PoisonError` are quite standard for a
wrapper type and enable manipulation of the underlying type.
2015-06-17 09:07:16 -07:00
Alex Crichton
68b628b165 std: Deprecate Vec::from_raw_buf
This function is more naturally expressed as slice::from_raw_buf plus a call to
to_vec.
2015-06-17 09:07:16 -07:00
Alex Crichton
f85c4f62d8 std: Deprecate all permutation-related slice methods
These methods have been unstable for quite some time, and it's not clear that
these should remain in the standard library.
2015-06-17 09:07:16 -07:00
Alex Crichton
cdb69e2747 std: Stabilize the remaining wrapping_* functions
This commit stabilizes the remaining `wrapping_*` functions on the primitive
integer types as they follow the same conventions as other wrapping methods are
were likely just initially unstable to be conservative.
2015-06-17 09:07:16 -07:00
Alex Crichton
8797c9ec6e std: Deprecate f{32,64}::consts::PI_2
These constants have been unstable for some time now already
2015-06-17 09:07:16 -07:00
Alex Crichton
a05ed9936d std: Remove two internal str_internals functions
These were just exposed to be used elsewhere at some point, but neither is
currently being used so just make them private again.
2015-06-17 09:07:16 -07:00
Alex Crichton
f55c366a8a std: Deprecate the IntSliceExt trait
This trait has seen very little usage and while safe, may not belong in the
standard library.
2015-06-17 09:07:16 -07:00
Alex Crichton
c72e01ef7f std: Deprecate result::fold
This function has seen very little use and it seems better to explore this
functionality through iterator adaptors instead of specialized functions.
2015-06-17 09:07:16 -07:00
Alex Crichton
153de4c5d9 std: Deprecate the copy_{,mut_}lifetime functions
Unsafe patterns such as `slice::from_raw_parts` and `CStr::from_ptr` have shown
that dealing with lifetimes, while useful, is often a hindrance. Consequently
these functions are rarely called today and are being deprecated.
2015-06-17 09:07:16 -07:00
Alex Crichton
669d1cd9e2 std: Deprecate iter::{Unfold, Iterate}
Neither of these iterators has seen enough usage to justify their position in
the standard library, so these unstable iterators are being slated for deletion.
2015-06-17 09:07:16 -07:00
Alex Crichton
02a8d5b570 std: Deprecate the RandomAccessIterator trait
This trait has not proven itself over time as being core and fundamentally
useful to iterators, so it's being deprecated to allow time to iterate on it out
of tree.
2015-06-17 09:07:16 -07:00
Alex Crichton
ce1a965cf5 Fallout in tests and docs from feature renamings 2015-06-17 09:07:16 -07:00
Alex Crichton
6895311e85 std: Split the std_misc feature 2015-06-17 09:06:59 -07:00
Alex Crichton
d444d0c357 collections: Split the collections feature
This commit also deprecates the `as_string` and `as_slice` free functions in the
`string` and `vec` modules.
2015-06-17 09:06:59 -07:00