Commit graph

44871 commits

Author SHA1 Message Date
bors
5b72fa42d4 Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton
FreeBSD i386 snapshot is missing, failed tests (possibly spurious).
r? @alexcrichton
2015-07-28 08:51:21 +00:00
bors
79d5fefa25 Auto merge of #27275 - nrc:save-use, r=brson
r? @brson
2015-07-28 07:14:55 +00:00
bors
ff6c6ce917 Auto merge of #27280 - bluss:siphash-perf, r=alexcrichton
Improve siphash performance for longer data

Use `ptr::copy_nonoverlapping` (aka memcpy) to load an u64 from the
byte stream. This is correct for any alignment, and the compiler will
use the appropriate instruction to load the data.

Also contains small tweaks that should benefit hashing short data too,
both the commit that removes a variable and the autovectorization of
the hash state initialization (in SipHash::reset).

Benchmarks show that hashing longer data benefits for the improved word loading.

Before (using benchmarks from the first commit in the PR):

The before benchmark is a bit noisy.

```
test hash::sip::bench_bytes_4                              ... bench:          41 ns/iter (+/- 0) = 97 MB/s
test hash::sip::bench_bytes_7                              ... bench:          49 ns/iter (+/- 2) = 142 MB/s
test hash::sip::bench_bytes_8                              ... bench:          42 ns/iter (+/- 4) = 190 MB/s
test hash::sip::bench_bytes_a_16                           ... bench:          57 ns/iter (+/- 14) = 280 MB/s
test hash::sip::bench_bytes_b_32                           ... bench:          85 ns/iter (+/- 74) = 376 MB/s
test hash::sip::bench_bytes_c_128                          ... bench:         278 ns/iter (+/- 33) = 460 MB/s
test hash::sip::bench_long_str                             ... bench:         825 ns/iter (+/- 103)
test hash::sip::bench_str_of_8_bytes                       ... bench:         151 ns/iter (+/- 66)
test hash::sip::bench_str_over_8_bytes                     ... bench:          59 ns/iter (+/- 3)
test hash::sip::bench_str_under_8_bytes                    ... bench:          47 ns/iter (+/- 56)
test hash::sip::bench_u32                                  ... bench:          39 ns/iter (+/- 93) = 205 MB/s
test hash::sip::bench_u32_keyed                            ... bench:          40 ns/iter (+/- 88) = 200 MB/s
test hash::sip::bench_u64                                  ... bench:          54 ns/iter (+/- 96) = 148 MB/s
```

After:

```
test hash::sip::bench_bytes_4                              ... bench:          41 ns/iter (+/- 3) = 97 MB/s
test hash::sip::bench_bytes_7                              ... bench:          48 ns/iter (+/- 0) = 145 MB/s
test hash::sip::bench_bytes_8                              ... bench:          35 ns/iter (+/- 1) = 228 MB/s
test hash::sip::bench_bytes_a_16                           ... bench:          45 ns/iter (+/- 1) = 355 MB/s
test hash::sip::bench_bytes_b_32                           ... bench:          60 ns/iter (+/- 0) = 533 MB/s
test hash::sip::bench_bytes_c_128                          ... bench:         161 ns/iter (+/- 5) = 795 MB/s
test hash::sip::bench_long_str                             ... bench:         514 ns/iter (+/- 5)
test hash::sip::bench_str_of_8_bytes                       ... bench:          44 ns/iter (+/- 0)
test hash::sip::bench_str_over_8_bytes                     ... bench:          51 ns/iter (+/- 0)
test hash::sip::bench_str_under_8_bytes                    ... bench:          52 ns/iter (+/- 6)
test hash::sip::bench_u32                                  ... bench:          40 ns/iter (+/- 2) = 200 MB/s
test hash::sip::bench_u32_keyed                            ... bench:          39 ns/iter (+/- 1) = 205 MB/s
test hash::sip::bench_u64                                  ... bench:          36 ns/iter (+/- 1) = 222 MB/s
```
2015-07-28 05:38:53 +00:00
bors
9ca511cf63 Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturon
Many of these have long since reached their stage of being obsolete, so this
commit starts the removal process for all of them. The unstable features that
were deprecated are:

* box_heap
* cmp_partial
* fs_time
* hash_default
* int_slice
* iter_min_max
* iter_reset_fuse
* iter_to_vec
* map_in_place
* move_from
* owned_ascii_ext
* page_size
* read_and_zero
* scan_state
* slice_chars
* slice_position_elem
* subslice_offset
2015-07-28 01:12:39 +00:00
Alex Crichton
b3aa1a6d4a std: Deprecate a number of unstable features
Many of these have long since reached their stage of being obsolete, so this
commit starts the removal process for all of them. The unstable features that
were deprecated are:

* cmp_partial
* fs_time
* hash_default
* int_slice
* iter_min_max
* iter_reset_fuse
* iter_to_vec
* map_in_place
* move_from
* owned_ascii_ext
* page_size
* read_and_zero
* scan_state
* slice_chars
* slice_position_elem
* subslice_offset
2015-07-27 16:38:25 -07:00
bors
8b835572b9 Auto merge of #27250 - alexcrichton:ucrt, r=brson
Visual Studio 2015, recently released, includes the Universal CRT, a different
flavor than was provided before. The binaries and header files for this library
are included in new locations not previously known about by gcc-rs, and this
commit adds support for the necessary probing to find these.

Unfortunately there are no prior examples of this probing to be found in
frameworks like CMake or clang, so this is done is a bit of a sketchy method
today. It assumes that the installation is in a relatively standard format and
then blindly looks for the location of the UCRT. I'd love to switch this over to
using registry keys for probing, but I was currently unable to find such keys.

This should enable the compiler to work outside VS 2015 dev tools prompts.
2015-07-27 23:38:04 +00:00
bors
75e4a78d15 Auto merge of #26216 - azerupi:doc-experiments, r=steveklabnik
So I have tried to improve the rustbook engine:

- The sidebar now looks a lot more like gitbook (I thinks it cleaner)
- Added the Open Sans font, in my opinion more readable for prolonged periods of time
- Changed the style for code blocks a little

I encountered 1 problem. In `build.rs` I added this google font url (I commented out the non-relevant parts for clarity) 

```rust
let rustdoc_args: &[String] = &[
    //"".to_string(),
    //preprocessed_path.display().to_string(),
    //format!("-o{}", out_path.display()),
    //format!("--html-before-content={}", prelude.display()),
    //format!("--html-after-content={}", postlude.display()),
    //format!("--markdown-playground-url=http://play.rust-lang.org"),
    //format!("--markdown-css={}", item.path_to_root.join("rust-book.css").display()),
    format!("--markdown-css=http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700"),
    //"--markdown-no-toc".to_string(),
];
``` 
As you can see, I had to escape `=` with `=` because the string would get truncated if I didn't. Is that normal behaviour? Is that for security measures? If it is, isn't it a little weak if you can circumvent it by escaped characters? I don't know the reason behind, but I thought it was at least worth mentioning :)

Take your time for this PR, I still want to add multiple improvements:

- Like gitbook, possibility to change font by user
- Put `css` and `js` in their respective files (not hardcoded in rust)
- button to hide sidebar
- ...

So I'm not in a hurry to get this merged ;) But if you think it's good enough to be merged, go ahead. I will make another PR when I have other improvements.

In the image below is a screen of the improvements

![rustbook](https://cloud.githubusercontent.com/assets/7647338/8105345/bf545c74-1038-11e5-962e-b04ebfaf8257.png)
2015-07-27 21:20:11 +00:00
bors
3e6b03c2d8 Auto merge of #27230 - GuillaumeGomez:patch-1, r=brson
Part of #24407.
cc @Manishearth
2015-07-27 19:44:22 +00:00
Mathieu David
f6e9240a99 Fix the relative path issue by including the files using include_bytes! 2015-07-27 20:46:01 +02:00
bors
bbda6f9cca Auto merge of #27304 - alexcrichton:revert-picky-dllimport, r=brson
This reverts commit a0efd3a3d9.

This commit caused a lot of unintended breakage for many Cargo builds. The problem is that Cargo compiles build scripts with `-C prefer-dynamic`, so the standard library is always dynamically linked and hence any imports need to be marked with `dllimport`. Dependencies of build scripts, however, were compiled as rlibs and did not have their imports tagged with `dllimport`, so build scripts would fail to link.

While known that this situation would break, it was unknown that it was a common scenario in the wild. As a result I'm just reverting these heuristics for now.
2015-07-27 18:09:22 +00:00
bors
8988043da7 Auto merge of #27284 - lastorset:default-methods, r=Gankro
Instead of bar/baz, use valid/invalid as default methods. This
illustrates why you might want default methods, and shows that you can
call other trait methods from a default method.

r? @steveklabnik
2015-07-27 16:34:40 +00:00
Eduard Burtescu
cc09b1a08c Turn on box(PLACE) expr deprecation warning post-snapshot. 2015-07-27 18:11:43 +03:00
bors
dc6e3bbb75 Auto merge of #27317 - midinastasurazz:patch-1, r=Gankro
r? @steveklabnik
2015-07-27 14:59:27 +00:00
bors
eefd6b2c12 Auto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichton 2015-07-27 13:24:34 +00:00
bors
d019a49ac8 Auto merge of #27315 - eefriedman:improper-ctypes-void-ret, r=alexcrichton
Fixes issue #27302.
2015-07-27 11:49:45 +00:00
Eduard Burtescu
5720f7055a Register new snapshots (2015-07-26 a5c12f4). 2015-07-27 13:31:48 +03:00
bors
3351afeecf Auto merge of #27310 - akiss77:fix-aarch64-getrandom, r=alexcrichton 2015-07-27 09:34:05 +00:00
bors
57f7fb60a8 Auto merge of #27308 - sstewartgallus:standardize-nonzero-check, r=alexcrichton
It's odd that "! -z" was used instead of "-n" in some places.  Is perhaps, "! -z" more portable or something?
2015-07-27 05:55:25 +00:00
midinastasurazz
6e377fe5f3 Fix typo: yur -> your 2015-07-27 07:20:54 +02:00
bors
0469be1eb7 Auto merge of #26876 - liigo:patch-3, r=Gankro 2015-07-27 04:20:27 +00:00
bors
184267cac6 Auto merge of #27274 - tshepang:not-needed-word, r=steveklabnik
Also, join the 2 sentences to improve flow
2015-07-27 02:45:35 +00:00
Eli Friedman
21b514ff30 In improper-ctypes lint, handle functions which explicitly return ().
Fixes issue #27302.
2015-07-26 19:21:53 -07:00
bors
922aef0359 Auto merge of #27311 - kballard:thread-mod-desc-remove-scoped, r=huonw
It's deprecated and unsafe, so we shouldn't be encouraging people to use
it. Move it to `std:🧵:scoped` instead, since it's still useful
information to anyone who is using the API.
2015-07-27 01:10:32 +00:00
bors
6d288192d9 Auto merge of #27294 - eddyb:deep-unsize-hinting, r=nrc
`Rc::new(RefCell::new(x)): Rc<RefCell<Trait>>` should not mean `RefCell::new(x): RefCell<Trait>`.
The latter is impossible, as an rvalue can't have an unsized type.
We were already handling unsized argument hints, but not when dealing with unsized structures.
2015-07-26 23:35:38 +00:00
Kevin Ballard
11c22180a7 Remove the module-level documentation for thread::scoped
It's deprecated and unsafe, so we shouldn't be encouraging people to use
it. Move it to `std:🧵:scoped` instead, since it's still useful
information to anyone who is using the API.
2015-07-26 15:37:25 -07:00
bors
6d36798c89 Auto merge of #27267 - tamird:fix-ios-improper-ctypes, r=alexcrichton
Fixes #27263.
2015-07-26 22:00:53 +00:00
Akos Kiss
286b337de4 Fix getrandom syscall number for aarch64-unknown-linux-gnu 2015-07-26 23:46:26 +02:00
Eduard Burtescu
c46f913244 typeck: handle unsized structs in type hints by recursing into their last field. 2015-07-27 00:31:08 +03:00
Steven Stewart-Gallus
f3bfbda665 Standardize on non-zero checks for configure 2015-07-26 14:18:30 -07:00
bors
6232f958cd Auto merge of #27012 - pornel:master, r=Gankro
Fixes #26689

This PR tries to clarify uses of "character" where it means "code point" or "UTF-8 sequence", which are almost, but not quite the same. Edge cases added to some examples to demonstrate this.

However, I've kept use of the term "code point" instead of "Unicode scalar value", because in UTF-8 they're the same, and "code point" is more widely known.
2015-07-26 20:18:39 +00:00
bors
cf7e825ecd Auto merge of #27272 - eefriedman:closure-const-crash, r=nikomatsakis
Fixes issue #27268.

r? @nikomatsakis
2015-07-26 17:51:30 +00:00
Alex Crichton
316e1b0d41 Revert "trans: Be a little more picky about dllimport"
This reverts commit a0efd3a3d9.
2015-07-26 10:19:11 -07:00
bors
a42e21d66e Auto merge of #27297 - mitaa:cleanup_E0005, r=alexcrichton
This does two things:
* removes ast::LocalSource, where only one variant was used because for-loop expansion has changed. One reason that this slipped into here is because the code in `check_local` which checks for `LocalSource::LocalFor` would report the same error as in `check_exhaustive` while using the wrong error code (E0005 instead of E0297).
* silences the warning about already used diagnostic code E0005 (fixes #27279)

passes `make check` locally.
2015-07-26 15:17:24 +00:00
bors
a5c12f4e39 Auto merge of #26870 - jroesch:default-typaram-fallback, r=nikomatsakis
This PR completes [RFC 213](https://github.com/rust-lang/rfcs/blob/master/text/0213-defaulted-type-params.md) by allowing default type parameters to influence inference. This is almost certainly a breaking change due to interactions between default type parameters and the old fallback algorithm used for integral and floating point literals.

The error messages still require polish but I wanted to get early review and feedback from others on the the changes, error messages, and test cases. I also imagine we will want to run anywhere from 1-3 versions of this on crater and evaluate the impact, and it would be best to get that ball rolling. 

The only outstanding issue I'm aware of is that type alias defaults don't work. It seems this may require significant restructuring, since during inference type aliases have already been expanded. @nikomatsakis might be able to provide some clarity here.

r? @nikomatsakis 

cc @eddyb @Gankro @aturon @brson
2015-07-26 10:39:18 +00:00
bors
9a196aa173 Auto merge of #27283 - arielb1:free-self-2, r=eddyb
Fixes #27281

r? @eddyb
2015-07-26 07:58:43 +00:00
mitaa
19512be113 Sidestep warning about repeated E0005 span_err! invocation.
Fixes #27279
2015-07-26 09:56:28 +02:00
mitaa
adfdbc4bd7 Remove ast::LocalSource with only one used variant
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-26 08:56:29 +02:00
Jared Roesch
5ad36cb887 Add omitted trailing comma 2015-07-25 21:22:38 -07:00
Jared Roesch
8ea9672f82 Address nit 2015-07-25 20:05:42 -07:00
Jared Roesch
55621b6199 Add feature gate 2015-07-25 20:05:42 -07:00
Jared Roesch
9da04b2bd1 Make default error reporting deterministic 2015-07-25 19:57:59 -07:00
Jared Roesch
d732f7323b Add cross-crate error message tests 2015-07-25 19:57:59 -07:00
Jared Roesch
77165415b7 Address tidy 2015-07-25 19:57:59 -07:00
Jared Roesch
99a12933fb Rework cross crate error messages 2015-07-25 19:57:59 -07:00
Jared Roesch
ed3fbba797 Fix error message spans 2015-07-25 19:57:59 -07:00
Jared Roesch
fbfbdd7d14 Correctly subst defaults with the in-scope substs 2015-07-25 19:57:58 -07:00
Jared Roesch
b75f215e82 Remove second transaction 2015-07-25 19:57:58 -07:00
Jared Roesch
ee43920410 Rebase fixes 2015-07-25 19:57:58 -07:00
Jared Roesch
e85787102f Clean up test cases 2015-07-25 19:57:58 -07:00
Jared Roesch
01dcb3bdf0 Refactor the default type parameter algorithm
The algorithm was not correctly detecting conflicts after moving
defaults into TypeVariableValue. The updated algorithm
correctly detects and reports conflicts with information about
where the conflict occured and which items the defaults were
introduced by. The span's for said items are not being correctly
attached and still need to be patched.
2015-07-25 19:57:58 -07:00