Commit graph

41859 commits

Author SHA1 Message Date
Alex Crichton
dd12c8b46f rollup merge of #24931: jooert/patch-1
Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
2015-04-29 15:45:51 -07:00
Alex Crichton
416e4127e9 rollup merge of #24930: nrc/save-fn 2015-04-29 15:45:50 -07:00
Alex Crichton
62bd19fff2 rollup merge of #24929: tamird/unstub-some-tests
r? @alexcrichton
2015-04-29 15:45:49 -07:00
Alex Crichton
b9b1312f53 rollup merge of #24926: frewsxcv/patch-20 2015-04-29 15:45:49 -07:00
Alex Crichton
7510bfebb6 rollup merge of #24917: zecozephyr/nullptropt 2015-04-29 15:45:47 -07:00
Alex Crichton
fa661286db rollup merge of #24911: GBGamer/patch-4 2015-04-29 15:45:46 -07:00
Alex Crichton
0eaa811f4c rollup merge of #24908: inrustwetrust/once_memory_ordering
`call_once` guarantees that there is a happens-before relationship between its closure and code following it via the sequentially consistent atomic store/loads of `self.cnt`.
2015-04-29 15:45:45 -07:00
Alex Crichton
b0f920ace4 rollup merge of #24904: steveklabnik/remove_std_net_warning
This is served by stability markers.
2015-04-29 15:45:45 -07:00
Alex Crichton
91dfc38979 rollup merge of #24903: pnkfelix/fsk-enum-swapindrop
rename `schedule_drop_{enum,adt}_contents`.

addresses review nit from #24765 (it was my mistake for not doing this earlier before it landed).
2015-04-29 15:45:44 -07:00
Alex Crichton
4ff558cdba rollup merge of #24894: bguiz/diagnostic-E0267
This error indicates that a constant references itself.
All constants need to resolve to a value in an acyclic manner.

For example, neither of the following can be sensibly compiled:

```
const X: u32 = X;
```

```
const X: u32 = Y;
const Y: u32 = X;
```
2015-04-29 15:45:43 -07:00
Alex Crichton
783b4bbf69 rollup merge of #24886: GBGamer/master
These are useful when you want to catch the signals, like when you're making a kernel, or if you just don't want the overhead. (I don't know if there are any of the second kind of people, I don't think it's a good idea, but hey, choice is good).
2015-04-29 15:45:42 -07:00
Alex Crichton
8daf961a63 rollup merge of #24881: chris-morgan/issue-24872
Fixes #24872.
2015-04-29 15:45:41 -07:00
Alex Crichton
a24e036126 rollup merge of #24871: mbrubeck/doc-edit
r? @steveklabnik
2015-04-29 15:45:40 -07:00
Alex Crichton
18a0269d9d rollup merge of #24870: tshepang/reference-fix-brackets
Also, remove the other brackets, because they make the whole sentence look awkward.
2015-04-29 15:45:39 -07:00
Alex Crichton
256023a284 rollup merge of #24862: barometz/intro-push-err-fix
The error in the Brief Introduction shows the problematic line as "x.push(4)", while the example code uses a vector of strings.
2015-04-29 15:45:38 -07:00
Alex Crichton
41ee6df261 rollup merge of #24846: dotdash/fast_cttz8
Currently, LLVM lowers a cttz8 on x86_64 to these instructions:

```asm
    movzbl      %dil, %eax
    bsfl        %eax, %eax
    movl        $32, %ecx
    cmovnel     %eax, %ecx
    cmpl        $32, %ecx
    movl        $8, %eax
    cmovnel     %ecx, %eax
```

To improve the codegen, we can zero extend the 8 bit integer, then set
bit 8 and perform a cttz operation on the extended value. That way
there's no conditional operation involved at all.

This was discovered by  this benchmark: https://github.com/Kimundi/long_strings_without_repeats

Timings on my box with the current nightly:
```
running 4 tests
test bench_cpp_naive_big     ... bench:   5479222 ns/iter (+/- 254222)
test bench_noop_big          ... bench:    571405 ns/iter (+/- 111950)
test bench_rust_naive_big    ... bench:   7798102 ns/iter (+/- 148841)
test bench_rust_unsafe_big   ... bench:   6606488 ns/iter (+/- 67529)
```

Timings with the patch applied:
```
running 4 tests
test bench_cpp_naive_big     ... bench:   5470944 ns/iter (+/- 7109)
test bench_noop_big          ... bench:    568944 ns/iter (+/- 6895)
test bench_rust_naive_big    ... bench:   6795901 ns/iter (+/- 43806)
test bench_rust_unsafe_big   ... bench:   5584879 ns/iter (+/- 5291)
```
2015-04-29 15:45:37 -07:00
Alex Crichton
dfb60802c5 rollup merge of #24833: tari/rfc888
Closes #24118, implementing RFC 888.
2015-04-29 15:45:36 -07:00
Alex Crichton
3434469b51 rollup merge of #24762: nrc/mod-debug-2
Closes #20780

r? @michaelwoerister

I'm sure this could be done better with deeper knowledge of debuginfo, but this seems like a good start.
2015-04-29 15:45:35 -07:00
Alex Crichton
e14af089a4 rollup merge of #24711: alexcrichton/fs2.1
This commit is an implementation of [RFC 1044][rfc] which adds additional
surface area to the `std::fs` module. All new APIs are `#[unstable]` behind
assorted feature names for each one.

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

The new APIs added are:

* `fs::canonicalize` - bindings to `realpath` on unix and
  `GetFinalPathNameByHandle` on windows.
* `fs::symlink_metadata` - similar to `lstat` on unix
* `fs::FileType` and accessor methods as `is_{file,dir,symlink}`
* `fs::Metadata::file_type` - accessor for the raw file type
* `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows
  but requires a syscall on unix.
* `fs::DirEntry::file_type` - access the file type which may not require a
  syscall on most platforms.
* `fs::DirEntry::file_name` - access just the file name without leading
  components.
* `fs::PathExt::symlink_metadata` - convenience method for the top-level
  function.
* `fs::PathExt::canonicalize` - convenience method for the top-level
  function.
* `fs::PathExt::read_link` - convenience method for the top-level
  function.
* `fs::PathExt::read_dir` - convenience method for the top-level
  function.
* `std::os::raw` - type definitions for raw OS/C types available on all
  platforms.
* `std::os::$platform` - new modules have been added for all currently supported
  platforms (e.g. those more specific than just `unix`).
* `std::os::$platform::raw` - platform-specific type definitions. These modules
  are populated with the bare essentials necessary for lowing I/O types into
  their raw representations, and currently largely consist of the `stat`
  definition for unix platforms.

This commit also deprecates `Metadata::{modified, accessed}` in favor of
inspecting the raw representations via the lowering methods of `Metadata`.

Closes https://github.com/rust-lang/rust/issues/24796
2015-04-29 15:45:34 -07:00
Alex Crichton
b164f66172 rollup merge of #24610: nagisa/offset-docs 2015-04-29 15:45:34 -07:00
Peter Marheine
94c9bdeef6 Update SNAPs to latest snapshot. 2015-04-29 13:11:31 -06:00
Björn Steinbrink
36dccec2f3 Currently, LLVM lowers a cttz8 on x86_64 to these instructions:
```asm
    movzbl      %dil, %eax
    bsfl        %eax, %eax
    movl        $32, %ecx
    cmovnel     %eax, %ecx
    cmpl        $32, %ecx
    movl        $8, %eax
    cmovnel     %ecx, %eax
```

which has some unnecessary overhead, having two conditional moves.

To improve the codegen, we can zero extend the 8 bit integer, then set
bit 8 and perform a cttz operation on the extended value. That way
there's no conditional operation involved at all.
2015-04-29 14:45:23 +02:00
bors
551a74dddd Auto merge of #24932 - pnkfelix:fix-issue-24687, r=huonw
metdata: Fix zero-normalization of the pos of a `MultiByteChar`

Fix #24687

The source byte/character mappings for every crate track the collection of multi-characters from its source files specially.  When we import the source information for another file into the current compilation unit, we assign its byte-positions unique values by shifting them all by a fixed adjustment, tracked in the `start_pos` field.  But when we pull out the source span information for one function from one crate and into our own crate, we need to re-normalize the byte positions: subtracting the old `start_pos` and adding the new `start_pos`. The `new_imported_filemap(..)` method handles adding the new `start_pos`, so all `creader` needs to do is re-normalize each `pos` to zero.

It seems like it was indeed trying to do this, but it mistakenly added the old `start_pos` instead of subtracting it.
2015-04-29 10:40:03 +00:00
Felix S. Klock II
2ae82fcd95 Regression test for issue 24687.
use visible characters for the multibyte character filler.
2015-04-29 10:53:09 +02:00
jooert
f99658d7c7 Adapt benchmark tests to unit test guidelines
Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
2015-04-29 10:36:43 +02:00
Felix S. Klock II
ecd3572f49 Fix zero-normalization of the pos of a MultiByteChar.
Fix #24687
2015-04-29 10:21:29 +02:00
bors
26c7635ccf Auto merge of #24893 - robinst:issue-24407-E0013, r=nrc
Part of #24407.
2015-04-29 07:37:58 +00:00
Nick Cameron
de2a4c0113 save-analysis: fix impl functions 2015-04-29 19:21:18 +12:00
Nick Cameron
7bfb5ed826 Reviewer changes 2015-04-29 18:56:13 +12:00
Nick Cameron
bb26aadaf3 Tidy up 2015-04-29 17:26:22 +12:00
Nick Cameron
88f840bdea debuginfo: extract adt.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
9756349d11 debuginfo: extract metadata.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
024e86fad5 debuginfo: extract types.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
488694cf0d debuginfo: extract namespace.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
5b53de1775 debuginfo: extract create.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
a015547894 debuginfo: extract utils.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
5753c8d6ca debuginfo: extract gdb.rs 2015-04-29 17:23:36 +12:00
Nick Cameron
5993ae86b8 debuginfo: pull out docs 2015-04-29 17:23:36 +12:00
Nick Cameron
39e2e649cb Tidy up word-wrapping in debuginfo 2015-04-29 17:23:36 +12:00
Nick Cameron
3f025fe7b2 Move debuginfo.rs to its own directory 2015-04-29 17:23:36 +12:00
Tamir Duberstein
f7947bc936 Unstub some tests 2015-04-28 21:23:28 -07:00
Tamir Duberstein
8073af7399 Tests need not be public 2015-04-28 21:22:58 -07:00
Tamir Duberstein
cd5abe7635 Remove unused variable 2015-04-28 21:22:06 -07:00
bors
d4cedea80a Auto merge of #24681 - tamird:unignore-android, r=alexcrichton
There are still quite a few ignored Android tests kicking around, most of which were added in 445faca844, which has a pretty unfortunate commit message.

r? @alexcrichton
2015-04-29 04:09:45 +00:00
Corey Farwell
960f8006d2 Fix punctuation placement in doc-comment 2015-04-28 23:06:00 -04:00
bors
c48b499ea3 Auto merge of #24888 - tamird:snapshot, r=alexcrichton
r? @alexcrichton cc @brson
2015-04-29 02:16:01 +00:00
Nicholas Mazzuca
83814325b4 Add intrinsics for unchecked division and modulo
The "unchecked_" div and rem functions will give UB in case of rhs == 0, or,
in the signed versions, lhs == INT::min and rhs == -1
2015-04-28 18:20:30 -07:00
Tamir Duberstein
bd5afb406d Reference the correct issue 2015-04-28 17:52:38 -07:00
Tamir Duberstein
c6364abbc1 #10356: Warnings 2015-04-28 17:52:37 -07:00
Tamir Duberstein
54de911f35 #10381: Warnings 2015-04-28 17:51:43 -07:00