Commit Graph

45709 Commits

Author SHA1 Message Date
bors
a03ec1a07a Auto merge of #27653 - Keruspe:master, r=alexcrichton 2015-08-22 03:45:14 +00:00
bors
8f1b0aa325 Auto merge of #27613 - GSam:binop, r=nrc
In the case where there are no paren in the AST, the pretty printer doesn't correctly print binary operations where precedence is concerned. Parenthesis may be missing due to some kind of expansion or manipulation of the AST. 

Example:
Pretty printer prints Expr(*, Expr(+, 1, 1), 2) as 1 + 1 * 2, as opposed to (1 + 1) * 2

r? @nrc
2015-08-21 17:42:19 +00:00
bors
b1d07bbe70 Auto merge of #27837 - Gankro:weaknique, r=aturon
This prepares both for the FCP of #27718

Arc:

* Add previously omitted function `Arc::try_unwrap(Self) -> Result<T, Self>`
* Move `arc.downgrade()` to `Arc::downgrade(&Self)` per conventions.
* Deprecate `Arc::weak_count` and `Arc::strong_count` for raciness. It is almost
  impossible to correctly act on these results without a CAS loop on the actual
  fields.
* Rename `Arc::make_unique` to `Arc::make_mut` to avoid uniqueness terminology 
  and to clarify relation to `Arc::get_mut`.
 

Rc:
* Add `Rc::would_unwrap(&Self) -> bool` to introspect whether try_unwrap would succeed, 
  because it's destructive (unlike get_mut).
* Move `rc.downgrade()` to `Rc::downgrade(&Self)` per conventions.
* Deprecate `Rc::weak_count` and `Rc::strong_count` for questionable utility.
* Deprecate `Rc::is_unique` for questionable semantics (there are two kinds of 
  uniqueness with Weak pointers in play).
* Rename `rc.make_unique()` to `Rc::make_mut(&mut Self)` per conventions, to
  avoid uniqueness terminology, and to clarify the relation to `Rc::get_mut`.

Notable omission:

* Arc::would_unwrap is not added due to the fact that it's racy, and therefore doesn't 
  provide much actionable information.

(note: rc_would_unwrap is not proposed for FCP as it is truly experimental)


r? @aturon (careful attention needs to be taken for the new Arc::try_unwrap, but intuitively it should "just work" by virtue of being semantically equivalent to Drop).
2015-08-21 05:04:32 +00:00
Alexis Beingessner
4c8d75fd9b don't do deprecations yet 2015-08-19 15:52:12 -07:00
Alexis Beingessner
5bbaa3c9ac fallout of reworking rc and arc APIs 2015-08-19 15:52:12 -07:00
Alexis Beingessner
dfa4bca889 Rework Arc for FCP of #27718
* Add previously omitted function `Arc::try_unwrap(Self) -> Result<T, Self>`
* Move `arc.downgrade()` to `Arc::downgrade(&Self)` per conventions.
* Deprecate `Arc::weak_count` and `Arc::strong_count` for raciness. It is almost
  impossible to correctly act on these results without a CAS loop on the actual
  fields.
* Rename `Arc::make_unique` to `Arc::make_mut` to avoid uniqueness terminology
  and to clarify relation to `Arc::get_mut`.
2015-08-19 15:52:12 -07:00
Alexis Beingessner
635f7360b6 Rework Rc for FCP of #27718
* Add `Rc::would_unwrap(&Self) -> bool` to introspect whether try_unwrap would succeed,
  because it's destructive (unlike get_mut).
* Move `rc.downgrade()` to `Rc::downgrade(&Self)` per conventions.
* Deprecate `Rc::weak_count` and `Rc::strong_count` for questionable utility.
* Deprecate `Rc::is_unique` for questionable semantics (there are two kinds of
  uniqueness with Weak pointers in play).
* Rename `rc.make_unique()` to `Rc::make_mut(&mut Self)` per conventions, to
  avoid uniqueness terminology, and to clarify the relation to `Rc::get_mut`.
2015-08-19 15:52:12 -07:00
bors
3a407b6c4e Auto merge of #27885 - steveklabnik:gh27637, r=alexcrichton
Hopefully make this distinction a little more clear.

Fixes #27637 
r? @alexcrichton /cc @havvy
2015-08-19 17:29:43 +00:00
Marc-Antoine Perennou
c977596992 rustc_back: add configure options for default linker and ar
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2015-08-19 18:06:34 +02:00
Steve Klabnik
7c06c5a900 Improve std::io::ErrorKind
Hopefully make this distinction a little more clear.

Fixes #27637
2015-08-19 10:22:18 -04:00
bors
aca2057ed5 Auto merge of #27677 - sylvestre:issue-27628, r=dotdash 2015-08-19 11:36:22 +00:00
Sylvestre Ledru
0fdc4a89f5 Issue #27628 - Also support the LLVM 3.6 IR format in two tests 2015-08-19 12:43:16 +02:00
bors
c8c14f207b Auto merge of #27875 - alexcrichton:msvc-f32-rem, r=nrc
Currently `f32 % f32` will generate a link error on 32-bit MSVC because LLVM
will lower the operation to a call to the nonexistent function `fmodf`. Work
around in this in the backend by lowering to a call to `fmod` instead with
necessary extension/truncation between floats/doubles.

Closes #27859
2015-08-19 07:14:43 +00:00
bors
e47eb7c2c8 Auto merge of #27493 - GSam:master, r=nrc
In order to test the validity of identifiers, exposing the name resolution module is necessary. Other changes mostly comprise of exposing modules publicly like parts of save-analysis, so they can be called appropriately.
2015-08-19 03:50:05 +00:00
bors
7e13faee17 Auto merge of #27849 - jonas-schievink:macro-errors, r=nikomatsakis
And some small indentation/code style fixes in the macro parser.
2015-08-19 00:54:38 +00:00
bors
4c1daeb7ad Auto merge of #27850 - alexcrichton:fix-musl, r=brson
Some new allocator tests require dynamic libraries to run the full test, but
dylibs aren't currently working on MUSL.
2015-08-18 23:20:52 +00:00
bors
2fb3fb24a3 Auto merge of #27836 - alexcrichton:rename-cstring-raw, r=bluss
This commit renames the `CString::{into_ptr, from_ptr}` methods to `into_raw`
and `from_raw` to mirror the corresponding methods on `Box` and the naming of
"raw" for `from_raw_parts` on slices and vectors.

cc #27769
2015-08-18 21:47:06 +00:00
bors
1d72d31448 Auto merge of #27891 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27881, #27882, #27883, #27884, #27888
- Failed merges:
2015-08-18 20:13:44 +00:00
Steve Klabnik
101ebe0bb0 Rollup merge of #27888 - steveklabnik:gh27686, r=alexcrichton
Fixes #27686
2015-08-18 15:03:11 -04:00
Steve Klabnik
d27dc3edd4 Rollup merge of #27884 - steveklabnik:gh27632, r=alexcrichton
Fixes #27632
2015-08-18 15:03:11 -04:00
Steve Klabnik
945603c85b Rollup merge of #27883 - steveklabnik:gh27587, r=alexcrichton
Fixes #27587
2015-08-18 15:03:11 -04:00
Steve Klabnik
572526be27 Rollup merge of #27882 - steveklabnik:gh27428, r=alexcrichton
This is where panic!() is introduced.
2015-08-18 15:03:11 -04:00
Steve Klabnik
a1f64c2204 Rollup merge of #27881 - jotomicron:patch-1, r=steveklabnik
Added the cost of the edge 3 -> 4 on the example in the module documentation
2015-08-18 15:03:10 -04:00
bors
6c11e4a48e Auto merge of #27624 - apasel422:issue-27620, r=Gankro
Closes #27620.
2015-08-18 18:41:17 +00:00
Steve Klabnik
288edec968 add cfg(target_env) to the reference
Fixes #27587
2015-08-18 14:24:25 -04:00
Steve Klabnik
dbbcb434b1 Add note about backtraces to TRPL
This is where panic!() is introduced.

Fixes #27428
2015-08-18 14:22:18 -04:00
Steve Klabnik
b2dc2ef709 Make distinction between -l and --extern more clear
Fixes #27686
2015-08-18 13:59:18 -04:00
Steve Klabnik
fd53ea28d8 Add notes about building documentation to the README.
Fixes #27632
2015-08-18 13:49:20 -04:00
bors
dc9b74f38d Auto merge of #27536 - steveklabnik:doc_object_safety, r=alexcrichton
Fixes #26938
2015-08-18 16:28:13 +00:00
Alex Crichton
3cf9e1086e std: Rename cstr_memory feature to use "raw"
This commit renames the `CString::{into_ptr, from_ptr}` methods to `into_raw`
and `from_raw` to mirror the corresponding methods on `Box` and the naming of
"raw" for `from_raw_parts` on slices and vectors.

cc #27769
2015-08-18 09:10:50 -07:00
Steve Klabnik
ce1bdc7293 Add object safety to TRPL
Fixes #26938
2015-08-18 11:27:02 -04:00
jotomicron
6f6ea4687e Fixed example in documentation
Added the cost of the edge 3 -> 4 on the example in the module documentation
2015-08-18 15:58:05 +01:00
bors
c6291e04cc Auto merge of #27880 - remram44:doc-seek-repetitions, r=steveklabnik
"Don't seek past end of stream" is mentioned twice in a row. This happened because seeking before offset 0 was previously mentioned there, and was moved to the "errors" section afterwards.

Somehow made it through [#26924](https://github.com/rust-lang/rust/pull/26924/files#diff-668f8f358d4a93474b396dcb3727399eR825).
2015-08-18 14:08:24 +00:00
Remi Rampin
f70faa91eb Remove repetition in Seek::seek() doc 2015-08-18 10:01:41 -04:00
bors
58e602b03f Auto merge of #27870 - durka:patch-5, r=steveklabnik
I just took out the sentences that were lies. I'm not sure if they need to be replaced.

r? steveklabnik
2015-08-18 10:26:35 +00:00
bors
a91f19f356 Auto merge of #27869 - alexcrichton:libtest-panic, r=brson
This commit removes the call to `panic!("Some tests failed")` at the end of all
tests run when running with libtest. The panic is replaced with
`std::process::exit` to have a nonzero error code, but this change both:

1. Makes the test runner no longer print out the extraneous panic message at the
   end of a failing test run that some tests failed. (this is already summarized
   in the output of the test run).
2. When running tests with `RUST_BACKTRACE` set it removes an extraneous
   backtrace from the output (only failing tests will have their backtraces in
   the output.
2015-08-18 08:51:02 +00:00
bors
16cacbe258 Auto merge of #27866 - arielb1:really-fast-reject, r=nikomatsakis
also, use the right caching logic for type_moves_by_default (this was
broken by @jroesch).

```
before:
593.10user 5.21system 7:51.41elapsed 126%CPU (0avgtext+0avgdata 1150016maxresident)k

after:
567.03user 4.00system 7:28.23elapsed 127%CPU (0avgtext+0avgdata 1133112maxresident)k
```

A nice 4.5% improvement. For reference, on the last run LLVM takes 429.267s, which is 75% - hopefully this can be reduced.

I think the regression since #27751 is because of the wf patch - need to investigate it through.

r? @nikomatsakis
2015-08-18 07:16:10 +00:00
Alex Crichton
8a7b0fad53 trans: Call fmod manually for 32-bit float rem
Currently `f32 % f32` will generate a link error on 32-bit MSVC because LLVM
will lower the operation to a call to the nonexistent function `fmodf`. Work
around in this in the backend by lowering to a call to `fmod` instead with
necessary extension/truncation between floats/doubles.

Closes #27859
2015-08-17 23:32:30 -07:00
bors
4c0ffc0e38 Auto merge of #27823 - eefriedman:float-dep-core, r=alexcrichton
There wasn't any particular reason the functions needed to be there
anyway, so just get rid of them, and adjust libstd to compensate.

With this change, libcore depends on exactly two floating-point functions:
fmod and fmodf.  They are implicitly referenced because they are used to
implement "%".

Dependencies of libcore on Linux x86-x64 with this patch:
```
0000000000000000         *UND*	0000000000000000 __powidf2
0000000000000000         *UND*	0000000000000000 __powisf2
0000000000000000         *UND*	0000000000000000 fmod
0000000000000000         *UND*	0000000000000000 fmodf
0000000000000000         *UND*	0000000000000000 memcmp
0000000000000000         *UND*	0000000000000000 memcpy
0000000000000000         *UND*	0000000000000000 memset
0000000000000000         *UND*	0000000000000000 rust_begin_unwind
0000000000000000         *UND*	0000000000000000 rust_eh_personality
```
2015-08-18 04:23:25 +00:00
bors
de67d62c6b Auto merge of #27474 - bluss:twoway-reverse, r=brson
StrSearcher: Implement the complete reverse case for the two way algorithm

Fix quadratic behavior in StrSearcher in reverse search with periodic
needles.

This commit adds the missing pieces for the "short period" case in
reverse search. The short case will show up when the needle is literally
periodic, for example "abababab".

Two way uses a "critical factorization" of the needle: x = u v.

Searching matches v first, if mismatch at character k, skip k forward.
Matching u, if mismatch, skip period(x) forward.

To avoid O(mn) behavior after mismatch in u, memorize the already
matched prefix.

The short period case requires that |u| < period(x).

For the reverse search we need to compute a different critical
factorization x = u' v' where |v'| < period(x), because we are searching
for the reversed needle. A short v' also benefits the algorithm in
general.

The reverse critical factorization is computed quickly by using the same
maximal suffix algorithm, but terminating as soon as we have a location
with local period equal to period(x).

This adds extra fields crit_pos_back and memory_back for the reverse
case. The new overhead for TwoWaySearcher::new is low, and additionally
I think the "short period" case is uncommon in many applications of
string search.

The maximal_suffix methods were updated in documentation and the
algorithms updated to not use !0 and wrapping add, variable left is now
1 larger, offset 1 smaller.

Use periodicity when computing byteset: in the periodic case, just
iterate over one period instead of the whole needle.

Example before (rfind) after (twoway_rfind) benchmark shows the removal
of quadratic behavior.

needle: "ab" * 100, haystack: ("bb" + "ab" * 100) * 100

```
test periodic::rfind           ... bench:   1,926,595 ns/iter (+/- 11,390) = 10 MB/s
test periodic::twoway_rfind    ... bench:      51,740 ns/iter (+/- 66) = 386 MB/s
```
2015-08-18 02:02:57 +00:00
bors
e35fd74811 Auto merge of #27169 - huonw:simd, r=alexcrichton
This implements https://github.com/rust-lang/rfcs/pull/1199 (except for doing all the platform intrinsics).

Things remaining for SIMD (not necessarily in this PR):

- [x] I (@huonw) am signed up to ensure the compiler matches the RFC, when it lands
- [x] the platform specific intrinsics aren't properly type checked at the moment (LLVM will throw a "random" assertion)
- [ ] there's a lot of useful intrinsics that are missing, including whole platforms (mips, powerpc)
- [ ] the target-feature `cfg` detection/adding is not so great at the moment
- [x] I think the platform specific intrinsics should go in their own `extern` ABI (i.e. not `"rust-intrinsic"`)

(I'm adjusting the RFC to reflect the latter.)

I think it would be very nice for this to land without requiring the RFC to land first, because of the first point, and because this is the only way for any further work to happen/be experimented with, without requiring people to build/install/multirust a compiler from a custom branch.

r? @alexcrichton
2015-08-17 23:41:36 +00:00
Huon Wilson
02e97342c1 Add AArch64 vrecpeq_... intrinsic (necessary for minimal API). 2015-08-17 14:48:44 -07:00
Huon Wilson
b067e4464b Clean up simd_cast translation. 2015-08-17 14:48:44 -07:00
Huon Wilson
502f9acbe9 Revamp SIMD intrinsic trans error handling.
Factor out common pieces, follow `expected ..., found ...` convention
everywhere.
2015-08-17 14:48:44 -07:00
Huon Wilson
891c91438d simd_shuffleNNN returns its type parameter directly.
I.e. the signature now must be

    fn simd_shuffleNNN<T, U>(x: T, y: T, idx: [u32; NNN]) -> U;

(modulo names.)
2015-08-17 14:48:44 -07:00
Huon Wilson
d792925b4d Shim some of the old std::simd functionality.
Overload the operators using the traits so that things mostly keep
working during the deprecation period.
2015-08-17 14:48:43 -07:00
Huon Wilson
62ba85b7aa Rebase cleanup: is_simd lost its parameter. 2015-08-17 14:41:40 -07:00
Huon Wilson
4b242497d3 Code style tweaks. 2015-08-17 14:41:40 -07:00
Huon Wilson
84de8caa87 Add tests for various intrinsic behaviours. 2015-08-17 14:41:40 -07:00
Huon Wilson
926b8351cf Tweak intrinsic error handling.
Better error messages, US spelling, more real checks.
2015-08-17 14:41:40 -07:00