]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agostd: Fix sub-second Condvar::wait_timeout_ms
Alex Crichton [Wed, 29 Jul 2015 04:13:02 +0000 (21:13 -0700)]
std: Fix sub-second Condvar::wait_timeout_ms

The API we're calling requires us to pass an absolute point in time as an
argument (`pthread_cond_timedwait`) so we call `gettimeofday` ahead of time to
then add the specified duration to. Unfortuantely the current "add the duration"
logic forgot to take into account the current time's sub-second precision (e.g.
the `tv_usec` field was ignored), causing sub-second duration waits to return
spuriously.

9 years agoAuto merge of #27260 - alexcrichton:cap-lints, r=nrc
bors [Wed, 29 Jul 2015 02:04:38 +0000 (02:04 +0000)]
Auto merge of #27260 - alexcrichton:cap-lints, r=nrc

This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: https://github.com/rust-lang/rfcs/pull/1193

Closes #27259

9 years agorustc: Add a --cap-lints flag to the compiler
Alex Crichton [Fri, 24 Jul 2015 05:19:12 +0000 (22:19 -0700)]
rustc: Add a --cap-lints flag to the compiler

This commit is an implementation of [RFC 1193][rfc] which adds the ability to
the compiler to cap the lint level for the entire compilation session. This flag
will ensure that no lints will go above this level, and Cargo will primarily use
this flag passing `--cap-lints allow` to all upstream dependencies.

[rfc]: https://github.com/rust-lang/rfcs/pull/1193

Closes #27259

9 years agoAuto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix
bors [Wed, 29 Jul 2015 00:28:55 +0000 (00:28 +0000)]
Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix

`EmitterWriter::print_maybe_styled` was basically always used with `format!`, so this macro makes some code cleaner. It should also remove some unnecessary allocations (most `print_maybe_styled` invocations allocated a `String` previously, whereas the new macro uses `write_fmt` to write the formatted string directly to the terminal).

This probably could have been part of #26838, but it’s too late now. It’s also rebased on #26838’s branch because otherwise pretty much all of the changes in this PR would conflict with the other PR’s changes.

9 years agoAuto merge of #27318 - soon:E0391_explanation, r=nrc
bors [Tue, 28 Jul 2015 22:51:53 +0000 (22:51 +0000)]
Auto merge of #27318 - soon:E0391_explanation, r=nrc

Part of #24407

9 years agoAuto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb
bors [Tue, 28 Jul 2015 21:14:28 +0000 (21:14 +0000)]
Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb

this has quite some fallout. but also made lots of stuff more readable imo

[breaking-change] for plugin authors

9 years agoAuto merge of #26934 - reem:boxed-slice-clone, r=Gankro
bors [Tue, 28 Jul 2015 19:36:26 +0000 (19:36 +0000)]
Auto merge of #26934 - reem:boxed-slice-clone, r=Gankro

Closes #25097

9 years agoAuto merge of #27173 - mark-buer:split-android-ndks, r=alexcrichton
bors [Tue, 28 Jul 2015 17:58:18 +0000 (17:58 +0000)]
Auto merge of #27173 - mark-buer:split-android-ndks, r=alexcrichton

Allows a multi-Android-target Rust compiler to be built.
Without these (or similar) changes, only a single-Android-target Rust compiler is possible.
Please see https://internals.rust-lang.org/t/dual-target-android-rust-compiler/2382/3 for additional context.

9 years agoremove `get_ident` and `get_name`, make `as_str` sound
Oliver Schneider [Tue, 28 Jul 2015 16:07:20 +0000 (18:07 +0200)]
remove `get_ident` and `get_name`, make `as_str` sound

9 years agoAuto merge of #26173 - pnkfelix:fsk-trans-nzmove-take3, r=nikomatsakis
bors [Tue, 28 Jul 2015 15:15:00 +0000 (15:15 +0000)]
Auto merge of #26173 - pnkfelix:fsk-trans-nzmove-take3, r=nikomatsakis

Add dropflag hints (stack-local booleans) for unfragmented paths in trans.  Part of #5016.

Added code to maintain these hints at runtime, and to conditionalize drop-filling and calls to destructors.

In this early stage of my incremental implementation strategy, we are using hints, so we are always free to leave out a flag for a path -- then we just pass `None` as the dropflag hint in the corresponding schedule cleanup call. But, once a path has a hint, we must at least maintain it: i.e. if the hint exists, we must ensure it is never set to "moved" if the data in question might actually have been initialized. It remains sound to conservatively set the hint to "initialized" as long as the true drop-flag embedded in the value itself is up-to-date.

I hope the commit series has been broken up to be readable; most of the commits in the series should build (though I did not always check this).

----

Oh, I think this technically qualifies as a:
[breaking-change]
because it removes drop-filling in some cases where one could previously observe it. That should only affect `unsafe` code; no safe code should be able to inspect whether the drop-fill was present or not. For an example of code that needed to change to account for this, see commit a81c24ae0216ab47df59acd724f8a33124fb6d97 (a unit test of the `move_val_init` intrinsic).  I have not encountered actual code that needed to be updated to account for the change, since this should only be skipping the drop-filling on *moved* values, not on dropped one, and so even types that use `unsafe_no_drop_flag` should be unchanged by this particular PR. (Their time will come later.)

9 years agocomments and code-cleanup in response to reviews.
Felix S. Klock II [Tue, 28 Jul 2015 14:07:05 +0000 (16:07 +0200)]
comments and code-cleanup in response to reviews.

9 years agobuild fragmented map earlier to make its dependencies clearer.
Felix S. Klock II [Tue, 30 Jun 2015 12:09:25 +0000 (08:09 -0400)]
build fragmented map earlier to make its dependencies clearer.

9 years agoReduced the Lvalue constructors to a kernel of three constructors.
Felix S. Klock II [Wed, 10 Jun 2015 09:42:48 +0000 (11:42 +0200)]
Reduced the Lvalue constructors to a kernel of three constructors.

Updated all call sites that used the other contructors to uniformly
call `Lvalue::new_with_hint`, passing along the appropriate kind
of hint for each context.

Placated tidy in a few other places in datum.rs.

9 years agoRevise intrinsic-move-val test to not require knowledge of whether filling drop is...
Felix S. Klock II [Mon, 8 Jun 2015 10:30:58 +0000 (12:30 +0200)]
Revise intrinsic-move-val test to not require knowledge of whether filling drop is in use.

9 years agoDuring my own review, I convinced myself this was indeed a bug.
Felix S. Klock II [Wed, 10 Jun 2015 08:40:32 +0000 (10:40 +0200)]
During my own review, I convinced myself this was indeed a bug.

Testing indicates bug would have been caught, albeit later than one
might hope, during `sync::mpsc::tests::smoke_shared_port_gone2` test.

9 years agoAdd dropflag hints (stack-local booleans) for unfragmented paths in trans.
Felix S. Klock II [Sun, 7 Jun 2015 07:25:14 +0000 (09:25 +0200)]
Add dropflag hints (stack-local booleans) for unfragmented paths in trans.

Added code to maintain these hints at runtime, and to conditionalize
drop-filling and calls to destructors.

In this early stage, we are using hints, so we are always free to
leave out a flag for a path -- then we just pass `None` as the
dropflag hint in the corresponding schedule cleanup call. But, once a
path has a hint, we must at least maintain it: i.e. if the hint
exists, we must ensure it is never set to "moved" if the data in
question might actually have been initialized. It remains sound to
conservatively set the hint to "initialized" as long as the true
drop-flag embedded in the value itself is up-to-date.

----

Here are some high-level details I want to point out:

 * We maintain the hint in Lvalue::post_store, marking the lvalue as
   moved. (But also continue drop-filling if necessary.)

 * We update the hint on ExprAssign.

 * We pass along the hint in once closures that capture-by-move.

 * You only call `drop_ty` for state that does not have an associated hint.
   If you have a hint, you must call `drop_ty_core` instead.
   (Originally I passed the hint into `drop_ty` as well, to make the
   connection to a hint more apparent, but the vast majority of
   current calls to `drop_ty` are in contexts where no hint is
   available, so it just seemed like noise in the resulting diff.)

9 years agorustc and rustc::borrowck: pass fragment info down into trans.
Felix S. Klock II [Sun, 7 Jun 2015 07:16:55 +0000 (09:16 +0200)]
rustc and rustc::borrowck: pass fragment info down into trans.

9 years agoExtend `trans::datum::Lvalue` so that it carrys an optional dropflag hint.
Felix S. Klock II [Fri, 5 Jun 2015 19:34:03 +0000 (21:34 +0200)]
Extend `trans::datum::Lvalue` so that it carrys an optional dropflag hint.

Instrumented calls sites that construct Lvalues to ease tracking down
cases that we might need to change whether or not they carry a hint.

Note that this commit does not do anything to actually *construct*
the `lldropflag_hints` map, nor does it change anything about codegen
itself. Those parts are in follow-on commits.

9 years agodebugflag to turn off nonzeroing move hint optimization.
Felix S. Klock II [Fri, 5 Jun 2015 19:29:18 +0000 (21:29 +0200)]
debugflag to turn off nonzeroing move hint optimization.

(already thumbs-upped pre-rebase by nikomatsakis)

9 years agoPrep for dropflag hints: refactor `trans:_match` to pass around `MatchInput` rather...
Felix S. Klock II [Fri, 5 Jun 2015 12:38:49 +0000 (14:38 +0200)]
Prep for dropflag hints: refactor `trans:_match` to pass around `MatchInput` rather than `ValueRef`.

(already thumbs-upped pre-rebase by nikomatsakis)

The refactoring here is trivial because `trans::datum::Lvalue`
currently carries no payload. However, future commits will start
adding a payload to `Lvalue`, and thus will force us either

 1. to thread the payload through the `_match` code (a long term goal), or

 2. to ensure the payload has some reasonable default value.

9 years agoPrep for dropflag-hints: Clarify trans bindings MoveByRef and MoveIntoCopy.
Felix S. Klock II [Fri, 5 Jun 2015 11:30:41 +0000 (13:30 +0200)]
Prep for dropflag-hints: Clarify trans bindings MoveByRef and MoveIntoCopy.

9 years agoAuto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonw
bors [Tue, 28 Jul 2015 12:53:28 +0000 (12:53 +0000)]
Auto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonw

The functionality this was testing was removed somewhere along the line, and
this commit restores what it was testing.

Closes #20586

9 years agoAuto merge of #27319 - diaphore:pr_debug_osstr_escape, r=alexcrichton
bors [Tue, 28 Jul 2015 10:28:45 +0000 (10:28 +0000)]
Auto merge of #27319 - diaphore:pr_debug_osstr_escape, r=alexcrichton

I had to modify some tests : since `wtf8buf_show` and `wtf8_show` were doing the exact same thing, I repurposed `wtf8_show` to `wtf8buf_show_str` which ensures `Wtf8Buf` `Debug`-formats the same as `str`.

`write_str_escaped` might also be shared amongst other `fmt` but I just left it there within `Wtf8::fmt` for review.

9 years agoAuto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton
bors [Tue, 28 Jul 2015 08:51:21 +0000 (08:51 +0000)]
Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichton

FreeBSD i386 snapshot is missing, failed tests (possibly spurious).
r? @alexcrichton

9 years agoImplement Clone for Box<[T]> where T: Clone
Jonathan Reem [Mon, 27 Jul 2015 05:12:00 +0000 (22:12 -0700)]
Implement Clone for Box<[T]> where T: Clone

Closes #25097

9 years agoSplits Android NDK path configuration.
Mark Buer [Mon, 20 Jul 2015 23:39:47 +0000 (11:39 +1200)]
Splits Android NDK path configuration.

9 years agoAuto merge of #27275 - nrc:save-use, r=brson
bors [Tue, 28 Jul 2015 07:14:55 +0000 (07:14 +0000)]
Auto merge of #27275 - nrc:save-use, r=brson

r? @brson

9 years agoAuto merge of #27280 - bluss:siphash-perf, r=alexcrichton
bors [Tue, 28 Jul 2015 05:38:53 +0000 (05:38 +0000)]
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
```

9 years agoAuto merge of #26914 - alexcrichton:deprecate-easy, r=aturon
bors [Tue, 28 Jul 2015 01:12:39 +0000 (01:12 +0000)]
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

9 years agostd: Deprecate a number of unstable features
Alex Crichton [Wed, 8 Jul 2015 15:33:13 +0000 (08:33 -0700)]
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

9 years agoAuto merge of #27250 - alexcrichton:ucrt, r=brson
bors [Mon, 27 Jul 2015 23:38:04 +0000 (23:38 +0000)]
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.

9 years agoAuto merge of #26216 - azerupi:doc-experiments, r=steveklabnik
bors [Mon, 27 Jul 2015 21:20:11 +0000 (21:20 +0000)]
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&#61;Open+Sans:400italic,700italic,400,700"),
    //"--markdown-no-toc".to_string(),
];
```
As you can see, I had to escape `=` with `&#61;` 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)

9 years agoAuto merge of #27230 - GuillaumeGomez:patch-1, r=brson
bors [Mon, 27 Jul 2015 19:44:22 +0000 (19:44 +0000)]
Auto merge of #27230 - GuillaumeGomez:patch-1, r=brson

Part of #24407.
cc @Manishearth

9 years agoFix the relative path issue by including the files using include_bytes!
Mathieu David [Mon, 27 Jul 2015 18:46:01 +0000 (20:46 +0200)]
Fix the relative path issue by including the files using include_bytes!

9 years agoAuto merge of #27304 - alexcrichton:revert-picky-dllimport, r=brson
bors [Mon, 27 Jul 2015 18:09:22 +0000 (18:09 +0000)]
Auto merge of #27304 - alexcrichton:revert-picky-dllimport, r=brson

This reverts commit a0efd3a3d99a98e3399a4f07abe6a67cf0660335.

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.

9 years agoFix escaping of characters in Debug for OsStr
diaphore [Sun, 26 Jul 2015 17:32:13 +0000 (19:32 +0200)]
Fix escaping of characters in Debug for OsStr

Fixes #27211

Fix Debug for {char, str} in core::fmt

9 years agotest: Fix lto-syntax-extension
Alex Crichton [Mon, 27 Jul 2015 17:14:48 +0000 (10:14 -0700)]
test: Fix lto-syntax-extension

The functionality this was testing was removed somewhere along the line, and
this commit restores what it was testing.

Closes #20586

9 years agoAuto merge of #27284 - lastorset:default-methods, r=Gankro
bors [Mon, 27 Jul 2015 16:34:40 +0000 (16:34 +0000)]
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

9 years agoTurn on `box(PLACE) expr` deprecation warning post-snapshot.
Eduard Burtescu [Mon, 27 Jul 2015 15:11:43 +0000 (18:11 +0300)]
Turn on `box(PLACE) expr` deprecation warning post-snapshot.

9 years agoAuto merge of #27317 - midinastasurazz:patch-1, r=Gankro
bors [Mon, 27 Jul 2015 14:59:27 +0000 (14:59 +0000)]
Auto merge of #27317 - midinastasurazz:patch-1, r=Gankro

r? @steveklabnik

9 years agoAuto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichton
bors [Mon, 27 Jul 2015 13:24:34 +0000 (13:24 +0000)]
Auto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichton

9 years agoAuto merge of #27315 - eefriedman:improper-ctypes-void-ret, r=alexcrichton
bors [Mon, 27 Jul 2015 11:49:45 +0000 (11:49 +0000)]
Auto merge of #27315 - eefriedman:improper-ctypes-void-ret, r=alexcrichton

Fixes issue #27302.

9 years agoRegister new snapshots (2015-07-26 a5c12f4).
Eduard Burtescu [Mon, 27 Jul 2015 10:31:48 +0000 (13:31 +0300)]
Register new snapshots (2015-07-26 a5c12f4).

9 years agoAuto merge of #27310 - akiss77:fix-aarch64-getrandom, r=alexcrichton
bors [Mon, 27 Jul 2015 09:34:05 +0000 (09:34 +0000)]
Auto merge of #27310 - akiss77:fix-aarch64-getrandom, r=alexcrichton

9 years agoFixed grammar
Andrew [Mon, 27 Jul 2015 09:26:35 +0000 (14:26 +0500)]
Fixed grammar

9 years agoAuto merge of #27308 - sstewartgallus:standardize-nonzero-check, r=alexcrichton
bors [Mon, 27 Jul 2015 05:55:25 +0000 (05:55 +0000)]
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?

9 years agoFix typo: yur -> your
midinastasurazz [Mon, 27 Jul 2015 05:20:54 +0000 (07:20 +0200)]
Fix typo: yur -> your

9 years agoAuto merge of #26876 - liigo:patch-3, r=Gankro
bors [Mon, 27 Jul 2015 04:20:27 +0000 (04:20 +0000)]
Auto merge of #26876 - liigo:patch-3, r=Gankro

9 years agoAdded explanation for E0391
Andrew Kuchev [Mon, 27 Jul 2015 03:38:06 +0000 (08:38 +0500)]
Added explanation for E0391

9 years agoAuto merge of #27274 - tshepang:not-needed-word, r=steveklabnik
bors [Mon, 27 Jul 2015 02:45:35 +0000 (02:45 +0000)]
Auto merge of #27274 - tshepang:not-needed-word, r=steveklabnik

Also, join the 2 sentences to improve flow

9 years agoIn improper-ctypes lint, handle functions which explicitly return `()`.
Eli Friedman [Mon, 27 Jul 2015 00:51:03 +0000 (17:51 -0700)]
In improper-ctypes lint, handle functions which explicitly return `()`.

Fixes issue #27302.

9 years agoAuto merge of #27311 - kballard:thread-mod-desc-remove-scoped, r=huonw
bors [Mon, 27 Jul 2015 01:10:32 +0000 (01:10 +0000)]
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::thread::scoped` instead, since it's still useful
information to anyone who is using the API.

9 years agoAuto merge of #27294 - eddyb:deep-unsize-hinting, r=nrc
bors [Sun, 26 Jul 2015 23:35:38 +0000 (23:35 +0000)]
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.

9 years agoRemove the module-level documentation for thread::scoped
Kevin Ballard [Sun, 26 Jul 2015 22:26:47 +0000 (15:26 -0700)]
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::thread::scoped` instead, since it's still useful
information to anyone who is using the API.

9 years agoAuto merge of #27267 - tamird:fix-ios-improper-ctypes, r=alexcrichton
bors [Sun, 26 Jul 2015 22:00:53 +0000 (22:00 +0000)]
Auto merge of #27267 - tamird:fix-ios-improper-ctypes, r=alexcrichton

Fixes #27263.

9 years agoFix getrandom syscall number for aarch64-unknown-linux-gnu
Akos Kiss [Sun, 26 Jul 2015 10:19:35 +0000 (10:19 +0000)]
Fix getrandom syscall number for aarch64-unknown-linux-gnu

9 years agotypeck: handle unsized structs in type hints by recursing into their last field.
Eduard Burtescu [Sun, 26 Jul 2015 00:55:35 +0000 (03:55 +0300)]
typeck: handle unsized structs in type hints by recursing into their last field.

9 years agoStandardize on non-zero checks for configure
Steven Stewart-Gallus [Sun, 26 Jul 2015 21:18:30 +0000 (14:18 -0700)]
Standardize on non-zero checks for configure

9 years agoAuto merge of #27012 - pornel:master, r=Gankro
bors [Sun, 26 Jul 2015 20:18:39 +0000 (20:18 +0000)]
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.

9 years agoAuto merge of #27272 - eefriedman:closure-const-crash, r=nikomatsakis
bors [Sun, 26 Jul 2015 17:51:30 +0000 (17:51 +0000)]
Auto merge of #27272 - eefriedman:closure-const-crash, r=nikomatsakis

Fixes issue #27268.

r? @nikomatsakis

9 years agoRevert "trans: Be a little more picky about dllimport"
Alex Crichton [Sun, 26 Jul 2015 17:19:11 +0000 (10:19 -0700)]
Revert "trans: Be a little more picky about dllimport"

This reverts commit a0efd3a3d99a98e3399a4f07abe6a67cf0660335.

9 years agoAuto merge of #27297 - mitaa:cleanup_E0005, r=alexcrichton
bors [Sun, 26 Jul 2015 15:17:24 +0000 (15:17 +0000)]
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.

9 years agoAuto merge of #26870 - jroesch:default-typaram-fallback, r=nikomatsakis
bors [Sun, 26 Jul 2015 10:39:18 +0000 (10:39 +0000)]
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

9 years agoAuto merge of #27283 - arielb1:free-self-2, r=eddyb
bors [Sun, 26 Jul 2015 07:58:43 +0000 (07:58 +0000)]
Auto merge of #27283 - arielb1:free-self-2, r=eddyb

Fixes #27281

r? @eddyb

9 years agoSidestep warning about repeated E0005 `span_err!` invocation.
mitaa [Sat, 25 Jul 2015 22:01:28 +0000 (00:01 +0200)]
Sidestep warning about repeated E0005 `span_err!` invocation.

Fixes #27279

9 years agoRemove `ast::LocalSource` with only one used variant
mitaa [Sat, 25 Jul 2015 20:43:35 +0000 (22:43 +0200)]
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`.

9 years agoAdd omitted trailing comma
Jared Roesch [Sun, 26 Jul 2015 04:22:38 +0000 (21:22 -0700)]
Add omitted trailing comma

9 years agoAddress nit
Jared Roesch [Sun, 26 Jul 2015 02:27:15 +0000 (19:27 -0700)]
Address nit

9 years agoAdd feature gate
Jared Roesch [Fri, 24 Jul 2015 20:39:11 +0000 (13:39 -0700)]
Add feature gate

9 years agoMake default error reporting deterministic
Jared Roesch [Tue, 21 Jul 2015 21:52:21 +0000 (14:52 -0700)]
Make default error reporting deterministic

9 years agoAdd cross-crate error message tests
Jared Roesch [Mon, 20 Jul 2015 19:49:03 +0000 (12:49 -0700)]
Add cross-crate error message tests

9 years agoAddress tidy
Jared Roesch [Mon, 20 Jul 2015 19:48:24 +0000 (12:48 -0700)]
Address tidy

9 years agoRework cross crate error messages
Jared Roesch [Mon, 20 Jul 2015 19:39:34 +0000 (12:39 -0700)]
Rework cross crate error messages

9 years agoFix error message spans
Jared Roesch [Thu, 16 Jul 2015 18:26:02 +0000 (11:26 -0700)]
Fix error message spans

9 years agoCorrectly subst defaults with the in-scope substs
Jared Roesch [Tue, 14 Jul 2015 01:12:18 +0000 (18:12 -0700)]
Correctly subst defaults with the in-scope substs

9 years agoRemove second transaction
Jared Roesch [Mon, 13 Jul 2015 08:49:13 +0000 (01:49 -0700)]
Remove second transaction

9 years agoRebase fixes
Jared Roesch [Mon, 13 Jul 2015 04:43:13 +0000 (21:43 -0700)]
Rebase fixes

9 years agoClean up test cases
Jared Roesch [Mon, 13 Jul 2015 04:02:16 +0000 (21:02 -0700)]
Clean up test cases

9 years agoRefactor the default type parameter algorithm
Jared Roesch [Mon, 13 Jul 2015 03:33:17 +0000 (20:33 -0700)]
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.

9 years agoFix bug with defaults not being restored
Jared Roesch [Thu, 9 Jul 2015 23:04:37 +0000 (16:04 -0700)]
Fix bug with defaults not being restored

9 years agoRemove defaults table and attach defaults directly to tyvars
Jared Roesch [Thu, 9 Jul 2015 19:15:48 +0000 (12:15 -0700)]
Remove defaults table and attach defaults directly to tyvars

9 years agoCorrectly collect defaults from type alises in astconv
Jared Roesch [Wed, 8 Jul 2015 20:42:46 +0000 (13:42 -0700)]
Correctly collect defaults from type alises in astconv

9 years agoFix tidy
Jared Roesch [Tue, 7 Jul 2015 23:06:35 +0000 (16:06 -0700)]
Fix tidy

9 years agoImplement Default TyParam fallback
Jared Roesch [Tue, 7 Jul 2015 22:50:02 +0000 (15:50 -0700)]
Implement Default TyParam fallback

This patch allows type parameter defaults to influence type inference. This is a possible breaking change since it effects the way type inference works and will have different behavior when mixing defaults and literal fallback.

9 years agoDefault methods example: Show "(in)valid" case
Leif Arne Storset [Sat, 25 Jul 2015 16:18:47 +0000 (18:18 +0200)]
Default methods example: Show "(in)valid" case

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.

9 years agoSubstitute free lifetimes in `Self::T`
Ariel Ben-Yehuda [Sat, 25 Jul 2015 18:25:51 +0000 (21:25 +0300)]
Substitute free lifetimes in `Self::T`

Fixes #27281

9 years agoAuto merge of #27258 - nikomatsakis:issue-26952, r=eddyb
bors [Sat, 25 Jul 2015 18:16:51 +0000 (18:16 +0000)]
Auto merge of #27258 - nikomatsakis:issue-26952, r=eddyb

Correct regression in type-inference caused by failing to reconfirm that
the object trait matches the required trait during trait selection.  The
existing code was checking that the object trait WOULD match (in a
probe), but never executing the match outside of a probe.

This corrects various regressions observed in the wild, including
issue #26952. Fixes #26952.

r? @eddyb
cc @frankmcsherry

9 years agoDocument Unicode complications in chars iterator
Kornel Lesiński [Sat, 25 Jul 2015 15:01:48 +0000 (16:01 +0100)]
Document Unicode complications in chars iterator

9 years agoAuto merge of #26630 - eefriedman:recursive-static, r=pnkfelix
bors [Sat, 25 Jul 2015 14:50:13 +0000 (14:50 +0000)]
Auto merge of #26630 - eefriedman:recursive-static, r=pnkfelix

***Edit: Fixed now.*** I'm pretty sure the way I'm using LLVMReplaceAllUsesWith here is
unsafe... but before I figure out how to fix that, I'd like a
reality-check: is this actually useful?

9 years agoAuto merge of #27253 - bossmc:unbalanced-delimiters-cause-ice, r=nikomatsakis
bors [Sat, 25 Jul 2015 11:20:15 +0000 (11:20 +0000)]
Auto merge of #27253 - bossmc:unbalanced-delimiters-cause-ice, r=nikomatsakis

This introduces a test for #23389 and improves the error behaviour to treat the malformed LHS as an error, not a compiler bug.

The parse phase that precedes the call to `check_lhs_nt_follows` could possibly be enhanced to police the format itself (which the old code suggests was the original intention), but I'm not sure that's any nicer than just parsing the matcher as generic rust code and then policing the specific requirements for being a macro matcher afterwards (as this does).

Fixes #23389

9 years agosiphash: Reorder hash state in the struct
Ulrik Sverdrup [Sat, 25 Jul 2015 09:59:06 +0000 (11:59 +0200)]
siphash: Reorder hash state in the struct

If they are ordered v0, v2, v1, v3, the compiler can find just a few
simd optimizations itself.

The new optimization I could observe on x86-64 was using 128 bit
registers for the v = key ^ constant operations in new / reset.

9 years agosiphash: Remove one variable
Ulrik Sverdrup [Sat, 25 Jul 2015 09:57:02 +0000 (11:57 +0200)]
siphash: Remove one variable

Without this temporary variable, codegen improves slightly and less
registers are spilled to the stack in SipHash::write.

9 years agosiphash: Use ptr::copy_nonoverlapping for efficient data loading
Ulrik Sverdrup [Sat, 25 Jul 2015 09:55:26 +0000 (11:55 +0200)]
siphash: Use ptr::copy_nonoverlapping for efficient data loading

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.

Use unchecked indexing.

This results in a large improvement of throughput (hashed bytes
/ second) for long data. Maximum improvement benches at a 70% increase
in throughput for large values (> 256 bytes) but already values of 16
bytes or larger improve.

Introducing unchecked indexing is motivated to reach as good throughput
as possible. Using ptr::copy_nonoverlapping without unchecked indexing
would land the improvement some 20-30 pct units lower.

We use a debug assertion so that the test suite checks our use of
unchecked indexing.

9 years agosiphash: Add more benchmarks
Ulrik Sverdrup [Sat, 25 Jul 2015 09:52:58 +0000 (11:52 +0200)]
siphash: Add more benchmarks

9 years agoAuto merge of #26960 - Manishearth:wrapper-types, r=steveklabnik
bors [Sat, 25 Jul 2015 07:54:48 +0000 (07:54 +0000)]
Auto merge of #26960 - Manishearth:wrapper-types, r=steveklabnik

@steveklabnik had suggested I do this.

This needs much review -- I tried reducing the informal tone but there's room for improvement.

r? @steveklabnik

9 years agoReference issue #27277 on Result::expect
John Hodge [Sat, 25 Jul 2015 07:02:21 +0000 (15:02 +0800)]
Reference issue #27277 on Result::expect

9 years agosave-analysis: return an Option from get_path_data
Nick Cameron [Sat, 25 Jul 2015 05:47:26 +0000 (17:47 +1200)]
save-analysis: return an Option from get_path_data

9 years agoMove wrapper types blog post into trpl
Manish Goregaokar [Sat, 11 Jul 2015 07:08:50 +0000 (12:38 +0530)]
Move wrapper types blog post into trpl

9 years agosave-analysis: add references to paths to get_path_data
Nick Cameron [Sat, 25 Jul 2015 05:05:34 +0000 (17:05 +1200)]
save-analysis: add references to paths to get_path_data

9 years agoreference: "those" feels misplaced there
Tshepang Lekhonkhobe [Sat, 25 Jul 2015 04:56:21 +0000 (06:56 +0200)]
reference: "those" feels misplaced there

Also, join the 2 sentences to improve flow