Commit Graph

45218 Commits

Author SHA1 Message Date
Felix S. Klock II
e25427a2b2 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.
2015-07-28 16:15:05 +02:00
Felix S. Klock II
dce1c61e97 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.)
2015-07-28 16:14:58 +02:00
Felix S. Klock II
d3d552b71b rustc and rustc::borrowck: pass fragment info down into trans. 2015-07-28 16:12:32 +02:00
Felix S. Klock II
a0f3f2ac53 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.
2015-07-28 16:12:32 +02:00
Felix S. Klock II
20aa27b7bc debugflag to turn off nonzeroing move hint optimization.
(already thumbs-upped pre-rebase by nikomatsakis)
2015-07-28 16:12:32 +02:00
Felix S. Klock II
9ef61f1ee0 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.
2015-07-28 16:12:27 +02:00
Felix S. Klock II
3eb7dd7f74 Prep for dropflag-hints: Clarify trans bindings MoveByRef and MoveIntoCopy. 2015-07-28 15:52:34 +02:00
bors
ec49d01c88 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
2015-07-28 12:53:28 +00:00
bors
4c371bb6de 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.
2015-07-28 10:28:45 +00:00
Björn Steinbrink
218eccfa4e Fix de-deduplication for closure debuginfo
Closure variables represent the closure environment, not the closure
function, so the identifier used to ensure that the debuginfo is unique
for each kind of closure needs to be based on the closure upvars and not
the function signature.
2015-07-28 10:58:22 +02:00
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
Jonathan Reem
e24423091f Implement Clone for Box<[T]> where T: Clone
Closes #25097
2015-07-28 01:43:17 -07:00
Pascal Hertleif
8c6ec5d72c IO Docs: Fix Link in Cursor description
The first paragraph of the docs of the Cursor struct contains a Markdown
link. In listings, this won't get rendered. (Rustdoc seems to split off the
first paragraph and after that convert Markdown to HTML.)
2015-07-28 09:39:15 +02:00
Mark Buer
33a7e67904 Splits Android NDK path configuration. 2015-07-28 19:21:04 +12: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
Steve Klabnik
02c1351fa3 remove incorrect statement from TRPL: crates and modules 2015-07-27 23:04:42 -04:00
Steve Klabnik
54d05f3cef fix two links
How embarassing 😭
2015-07-27 22:25:06 -04:00
Steve Klabnik
ad44a7fbc0 Remove warning header for consistency
This isn't a standard header, and the other docs don't use it, so let's remove it.
2015-07-27 22:20:37 -04: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
Alex Crichton
cf1ff56f3c std: Remove msvc/valgrind headers
These aren't really used for anything any more, so there doesn't seem to be much
reason to leave them around in the `rt` directory. There was some limiting of
threads spawned or tests when run under valgrind, but very little is run under
valgrind nowadays so there's also no real use keeping these around.
2015-07-27 16:21:15 -07:00
Alexis Beingessner
05bb1dbc43 OBRM for aturon 2015-07-27 16:01:22 -07:00
Alexis Beingessner
fd13bdf626 vec fixes for huonw 2015-07-27 15:03:38 -07:00
Alexis Beingessner
b53406f824 fixups for aturon 2015-07-27 14:42:04 -07: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&#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)
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
diaphore
aa8950427e Fix escaping of characters in Debug for OsStr
Fixes #27211

Fix Debug for {char, str} in core::fmt
2015-07-27 19:57:28 +02:00
Alex Crichton
f01119c221 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
2015-07-27 10:42:04 -07: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
Steve Klabnik
ba5fcb726f Show appropriate feature flags in docs 2015-07-27 12:28:13 -04:00
Steve Klabnik
e88ee957ed Fix buffer length in std::io::take
This only reads five bytes, so don't use a ten byte buffer, that's confusing.
2015-07-27 11:43:15 -04: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
midinastasurazz
2449823268 Fix misrendered HTML character entities 2015-07-27 16:18:50 +02: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
Andrew
9125400e48 Fixed grammar 2015-07-27 14:26:35 +05: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
Andrew Kuchev
ecfe58e53c Added explanation for E0391 2015-07-27 08:38:06 +05: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
Alexis Beingessner
8c7111da07 fixup atomics 2015-07-26 18:19:50 -07:00