]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #24902 - bombless:configure, r=pnkfelix
bors [Thu, 30 Apr 2015 15:16:24 +0000 (15:16 +0000)]
Auto merge of #24902 - bombless:configure, r=pnkfelix

Closes #24840

9 years agoMention --enable-optimize for --enable-debug
York Xiang [Tue, 28 Apr 2015 14:24:44 +0000 (22:24 +0800)]
Mention --enable-optimize for --enable-debug

9 years agoAuto merge of #24892 - robinst:issue-24407-E0010, r=pnkfelix
bors [Thu, 30 Apr 2015 12:01:44 +0000 (12:01 +0000)]
Auto merge of #24892 - robinst:issue-24407-E0010, r=pnkfelix

Part of #24407.

9 years agoAuto merge of #24842 - GBGamer:patch-3, r=steveklabnik
bors [Thu, 30 Apr 2015 10:13:05 +0000 (10:13 +0000)]
Auto merge of #24842 - GBGamer:patch-3, r=steveklabnik

They now use the currently working syntax.

Also, I added two examples.

9 years agoAuto merge of #24970 - Hech:master, r=steveklabnik
bors [Thu, 30 Apr 2015 07:12:25 +0000 (07:12 +0000)]
Auto merge of #24970 - Hech:master, r=steveklabnik

9 years agoAuto merge of #24960 - tynopex:patch-doc, r=alexcrichton
bors [Thu, 30 Apr 2015 04:44:47 +0000 (04:44 +0000)]
Auto merge of #24960 - tynopex:patch-doc, r=alexcrichton

- Removed misleading comments about now-defunct CreatePipe
- Actually use std::process::Child in it's example
- Minor cleanups

9 years agoAuto merge of #24884 - michaelsproul:extended-errors, r=nrc
bors [Thu, 30 Apr 2015 02:03:27 +0000 (02:03 +0000)]
Auto merge of #24884 - michaelsproul:extended-errors, r=nrc

I've been working on improving the diagnostic registration system so that it can:

* Check uniqueness of error codes *across the whole compiler*. The current method using `errorck.py` is prone to failure as it relies on simple text search - I found that it breaks when referencing an error's ident within a string (e.g. `"See also E0303"`).
* Provide JSON output of error metadata, to eventually facilitate HTML output, as well as tracking of which errors need descriptions. The current schema is:

```
<error code>: {
    "description": <long description>,
    "use_site": {
        "filename": <filename where error is used>,
        "line": <line in file where error is used>
    }
}
```

[Here's][metadata-dump] a pretty-printed sample dump for `librustc`.

One thing to note is that I had to move the diagnostics arrays out of the diagnostics modules. I really wanted to be able to capture error usage information, which only becomes available as a crate is compiled. Hence all invocations of `__build_diagnostics_array!` have been moved to the ends of their respective `lib.rs` files. I tried to avoid moving the array by making a plugin that expands to nothing but couldn't invoke it in item position and gave up on hackily generating a fake item. I also briefly considered using a lint, but it seemed like it would impossible to get access to the data stored in the thread-local storage.

The next step will be to generate a web page that lists each error with its rendered description and use site. Simple mapping and filtering of the metadata files also allows us to work out which error numbers are absent, which errors are unused and which need descriptions.

[metadata-dump]: https://gist.github.com/michaelsproul/3246846ff1bea71bd049

9 years agoAdd error explanation for E0010
Robin Stocker [Tue, 28 Apr 2015 09:44:43 +0000 (19:44 +1000)]
Add error explanation for E0010

9 years agodocs: link fix
Hech [Thu, 30 Apr 2015 00:30:46 +0000 (17:30 -0700)]
docs: link fix

9 years agoAuto merge of #24967 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 30 Apr 2015 00:07:10 +0000 (00:07 +0000)]
Auto merge of #24967 - alexcrichton:rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts
Alex Crichton [Thu, 30 Apr 2015 00:05:20 +0000 (17:05 -0700)]
Test fixes and rebase conflicts

9 years agoAdd metadata output to the diagnostics system.
Michael Sproul [Tue, 28 Apr 2015 02:48:22 +0000 (12:48 +1000)]
Add metadata output to the diagnostics system.

Diagnostic errors are now checked for uniqueness across the compiler and
error metadata is written to JSON files.

9 years agorollup merge of #24921: tamird/bitflags-associated-const
Alex Crichton [Wed, 29 Apr 2015 22:49:07 +0000 (15:49 -0700)]
rollup merge of #24921: tamird/bitflags-associated-const

Conflicts:
src/librustc/lib.rs

9 years agorollup merge of #24873: alexcrichton/fix-windows-stdio
Alex Crichton [Wed, 29 Apr 2015 22:48:38 +0000 (15:48 -0700)]
rollup merge of #24873: alexcrichton/fix-windows-stdio

Conflicts:
src/libstd/sys/windows/fs2.rs

9 years agorollup merge of #24962: tamird/unignore-android-tests
Alex Crichton [Wed, 29 Apr 2015 22:45:58 +0000 (15:45 -0700)]
rollup merge of #24962: tamird/unignore-android-tests

r? @alexcrichton I've tested these locally, so they should all be good to go.

9 years agorollup merge of #24961: nham/net_docs_cleanup
Alex Crichton [Wed, 29 Apr 2015 22:45:57 +0000 (15:45 -0700)]
rollup merge of #24961: nham/net_docs_cleanup

Changes made include adding missing punctuation, adding missing words, and converting uses of "Gets" to "Returns" in libstd/net/addr.rs to make it more consistent with the other documentation.

Fixes #24925.

9 years agorollup merge of #24953: tamird/android-pie
Alex Crichton [Wed, 29 Apr 2015 22:45:56 +0000 (15:45 -0700)]
rollup merge of #24953: tamird/android-pie

This is OK to do given:
  - PIE is supported on Android starting with API 16.
  - The bots are running API 18.
  - API < 16 now has a 12.5% market share[0] as of 2015-04-29.

Closes #17437.

[0] https://developer.android.com/about/dashboards/index.html

r? @alexcrichton

9 years agorollup merge of #24952: pnkfelix/put-back-missing-dash-g-in-24687-test
Alex Crichton [Wed, 29 Apr 2015 22:45:55 +0000 (15:45 -0700)]
rollup merge of #24952: pnkfelix/put-back-missing-dash-g-in-24687-test

Add `-g` (to testcase) that I should have included in PR #24932.

Note it is safe, with respect to autobuilds, to land before #24945.

(In other words, landing this sooner won't break things for anyone any
worse than they were already broken, since there are *other* tests
that also add `-g` to their flags via `compile-flags: -g`.)

9 years agorollup merge of #24945: pnkfelix/fixes-for-dash-g-handling
Alex Crichton [Wed, 29 Apr 2015 22:45:54 +0000 (15:45 -0700)]
rollup merge of #24945: pnkfelix/fixes-for-dash-g-handling

Fixes for -g handling

First:
 * decouples our handling of `-g` for the test suite from our handling of `-g` for the rest of the compiler/stdlib building.
 * Namely, if you do `--enable-debug` or `--enable-debuginfo`, that should only affect `rustc` and the standard library crates; the tests should all continue to compile without `-g` unless:
   * you pass `--enable-debuginfo-tests`, or
   * the test itself requests the `-g` option (e.g. via a `// compile-flags: -g` embedded comment).

Second:
 * Makes `rustc` more flexible in that it now accepts multiple occurrences of `-g -g`
 * (as a drive-by, I gave `-O` the same treatment: multiple occurrences of `-O` are treated as synonymous as a single occurrence of `-O`.

Fix #24937

9 years agorollup merge of #24935: pnkfelix/lint-repr-c-drop
Alex Crichton [Wed, 29 Apr 2015 22:45:53 +0000 (15:45 -0700)]
rollup merge of #24935: pnkfelix/lint-repr-c-drop

Lint: warn when mixing `#[repr(C)]` with Drop

Fix #24585

9 years agorollup merge of #24933: oli-obk/patch-1
Alex Crichton [Wed, 29 Apr 2015 22:45:52 +0000 (15:45 -0700)]
rollup merge of #24933: oli-obk/patch-1

compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"

9 years agorollup merge of #24931: jooert/patch-1
Alex Crichton [Wed, 29 Apr 2015 22:45:51 +0000 (15:45 -0700)]
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.

9 years agorollup merge of #24930: nrc/save-fn
Alex Crichton [Wed, 29 Apr 2015 22:45:50 +0000 (15:45 -0700)]
rollup merge of #24930: nrc/save-fn

9 years agorollup merge of #24929: tamird/unstub-some-tests
Alex Crichton [Wed, 29 Apr 2015 22:45:49 +0000 (15:45 -0700)]
rollup merge of #24929: tamird/unstub-some-tests

r? @alexcrichton

9 years agorollup merge of #24926: frewsxcv/patch-20
Alex Crichton [Wed, 29 Apr 2015 22:45:49 +0000 (15:45 -0700)]
rollup merge of #24926: frewsxcv/patch-20

9 years agorollup merge of #24917: zecozephyr/nullptropt
Alex Crichton [Wed, 29 Apr 2015 22:45:47 +0000 (15:45 -0700)]
rollup merge of #24917: zecozephyr/nullptropt

9 years agorollup merge of #24911: GBGamer/patch-4
Alex Crichton [Wed, 29 Apr 2015 22:45:46 +0000 (15:45 -0700)]
rollup merge of #24911: GBGamer/patch-4

9 years agorollup merge of #24908: inrustwetrust/once_memory_ordering
Alex Crichton [Wed, 29 Apr 2015 22:45:45 +0000 (15:45 -0700)]
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`.

9 years agorollup merge of #24904: steveklabnik/remove_std_net_warning
Alex Crichton [Wed, 29 Apr 2015 22:45:45 +0000 (15:45 -0700)]
rollup merge of #24904: steveklabnik/remove_std_net_warning

This is served by stability markers.

9 years agorollup merge of #24903: pnkfelix/fsk-enum-swapindrop
Alex Crichton [Wed, 29 Apr 2015 22:45:44 +0000 (15:45 -0700)]
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).

9 years agorollup merge of #24894: bguiz/diagnostic-E0267
Alex Crichton [Wed, 29 Apr 2015 22:45:43 +0000 (15:45 -0700)]
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;
```

9 years agorollup merge of #24886: GBGamer/master
Alex Crichton [Wed, 29 Apr 2015 22:45:42 +0000 (15:45 -0700)]
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).

9 years agorollup merge of #24881: chris-morgan/issue-24872
Alex Crichton [Wed, 29 Apr 2015 22:45:41 +0000 (15:45 -0700)]
rollup merge of #24881: chris-morgan/issue-24872

Fixes #24872.

9 years agorollup merge of #24871: mbrubeck/doc-edit
Alex Crichton [Wed, 29 Apr 2015 22:45:40 +0000 (15:45 -0700)]
rollup merge of #24871: mbrubeck/doc-edit

r? @steveklabnik

9 years agorollup merge of #24870: tshepang/reference-fix-brackets
Alex Crichton [Wed, 29 Apr 2015 22:45:39 +0000 (15:45 -0700)]
rollup merge of #24870: tshepang/reference-fix-brackets

Also, remove the other brackets, because they make the whole sentence look awkward.

9 years agorollup merge of #24862: barometz/intro-push-err-fix
Alex Crichton [Wed, 29 Apr 2015 22:45:38 +0000 (15:45 -0700)]
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.

9 years agorollup merge of #24846: dotdash/fast_cttz8
Alex Crichton [Wed, 29 Apr 2015 22:45:37 +0000 (15:45 -0700)]
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)
```

9 years agorollup merge of #24833: tari/rfc888
Alex Crichton [Wed, 29 Apr 2015 22:45:36 +0000 (15:45 -0700)]
rollup merge of #24833: tari/rfc888

Closes #24118, implementing RFC 888.

9 years agorollup merge of #24762: nrc/mod-debug-2
Alex Crichton [Wed, 29 Apr 2015 22:45:35 +0000 (15:45 -0700)]
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.

9 years agorollup merge of #24711: alexcrichton/fs2.1
Alex Crichton [Wed, 29 Apr 2015 22:45:34 +0000 (15:45 -0700)]
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

9 years agorollup merge of #24610: nagisa/offset-docs
Alex Crichton [Wed, 29 Apr 2015 22:45:34 +0000 (15:45 -0700)]
rollup merge of #24610: nagisa/offset-docs

9 years agoUpdate process.rs
tynopex [Wed, 29 Apr 2015 22:21:23 +0000 (18:21 -0400)]
Update process.rs

Make whitespace consistent

9 years agoRe-enable tests on Android
Tamir Duberstein [Wed, 22 Apr 2015 05:00:47 +0000 (22:00 -0700)]
Re-enable tests on Android

Addresses part of #10381.

9 years agoRe-enable test on Android
Tamir Duberstein [Wed, 22 Apr 2015 05:05:01 +0000 (22:05 -0700)]
Re-enable test on Android

Closes #9116.

9 years agoReference the correct issue
Tamir Duberstein [Wed, 29 Apr 2015 21:22:54 +0000 (14:22 -0700)]
Reference the correct issue

The problem here is that this test doesn't even compile for Android.

See #24958.

9 years agoImprove libstd/net/addr.rs documentation.
Nick Hamann [Wed, 29 Apr 2015 21:24:44 +0000 (16:24 -0500)]
Improve libstd/net/addr.rs documentation.

This adds some missing punctuation and converts uses of "Gets" to
"Returns". This sounds better to my ear, but more importantly is
more consistent with the documentation from other files.

9 years agoAdd some missing punctuation in the libstd/net/tcp.rs docs.
Nick Hamann [Wed, 29 Apr 2015 21:21:39 +0000 (16:21 -0500)]
Add some missing punctuation in the libstd/net/tcp.rs docs.

9 years agoAdd some missing punctuation in the libstd/net/ip.rs docs.
Nick Hamann [Wed, 29 Apr 2015 21:19:35 +0000 (16:19 -0500)]
Add some missing punctuation in the libstd/net/ip.rs docs.

9 years agotests for lint that warns about mixing #[repr(C)] with Drop.
Felix S. Klock II [Wed, 29 Apr 2015 10:08:53 +0000 (12:08 +0200)]
tests for lint that warns about mixing #[repr(C)] with Drop.

THis includes tests for struct and enum. (I suspect the closure case
is actually unreachable, but i see no harm in including it.)

9 years agolint for mixing `#[repr(C)]` with an impl of `Drop`.
Felix S. Klock II [Wed, 29 Apr 2015 09:37:19 +0000 (11:37 +0200)]
lint for mixing `#[repr(C)]` with an impl of `Drop`.

9 years agostd: Fixup docs for std::process
tynopex [Wed, 29 Apr 2015 21:00:10 +0000 (17:00 -0400)]
std: Fixup docs for std::process

9 years agoImprove libstd/net/udp.rs documentation.
Nick Hamann [Wed, 29 Apr 2015 20:57:17 +0000 (15:57 -0500)]
Improve libstd/net/udp.rs documentation.

This adds some missing punctuation, adds a missing word, and
corrects a bug in the description of `send_to`, which actually
returns the number of bytes written on success.

Fixes #24925.

9 years agoUse PIE on Android
Tamir Duberstein [Wed, 29 Apr 2015 18:12:25 +0000 (11:12 -0700)]
Use PIE on Android

This is OK to do given:
  - PIE is supported on Android starting with API 16.
  - The bots are running API 18.
  - API < 16 now has a 12.5% market share[0] as of 2015-04-29.

Unfortunately, this breaks backtrace support. See #17520.

Closes #17437.

[0] https://developer.android.com/about/dashboards/index.html

9 years agoUpdate SNAPs to latest snapshot.
Peter Marheine [Wed, 29 Apr 2015 19:11:31 +0000 (13:11 -0600)]
Update SNAPs to latest snapshot.

9 years agoDRY Android targets
Tamir Duberstein [Wed, 29 Apr 2015 17:53:01 +0000 (10:53 -0700)]
DRY Android targets

9 years agoAdd `-g` that I should have included in PR #24932.
Felix S. Klock II [Wed, 29 Apr 2015 16:58:42 +0000 (18:58 +0200)]
Add `-g` that I should have included in PR #24932.

Note it is safe, with respect to autobuilds, to land before #24945.

(In other words, landing this sooner won't break things for anyone any
worse than they were already broken, since there are *other* tests
that also add `-g` to their flags via `compile-flags: -g`.)

9 years agoUnit test ensuring we accept repeated `-g` and `-O`.
Felix S. Klock II [Wed, 29 Apr 2015 16:54:20 +0000 (18:54 +0200)]
Unit test ensuring we accept repeated `-g` and `-O`.

9 years agoAllow `-g` and `-O` options to be specified multiple times at command line.
Felix S. Klock II [Wed, 29 Apr 2015 15:20:36 +0000 (17:20 +0200)]
Allow `-g` and `-O` options to be specified multiple times at command line.

9 years agoFallout
Tamir Duberstein [Tue, 28 Apr 2015 23:36:22 +0000 (16:36 -0700)]
Fallout

9 years ago`bitflags!` uses associated constants
Tamir Duberstein [Tue, 28 Apr 2015 23:02:13 +0000 (16:02 -0700)]
`bitflags!` uses associated constants

9 years ago`bitflags!` is no longer used in `std`
Tamir Duberstein [Tue, 28 Apr 2015 18:41:08 +0000 (11:41 -0700)]
`bitflags!` is no longer used in `std`

9 years agoadd `--enable-debuginfo-tests`, analogous to `--disable-optimize-tests`.
Felix S. Klock II [Wed, 29 Apr 2015 15:18:44 +0000 (17:18 +0200)]
add `--enable-debuginfo-tests`, analogous to `--disable-optimize-tests`.

Then, decouple the question of whether the compiler/stdlib carry
debuginfo (which is controlled via `--enable-debuginfo` and implied by
`--enable-debug`) from the question of whether the tests carry
debuginfo (which now no longer is implied by `--enable-debug` nor
`--enable-debuginfo`, and is off by default).

9 years agostd: Fix inheriting standard handles on windows
Alex Crichton [Mon, 27 Apr 2015 20:44:20 +0000 (13:44 -0700)]
std: Fix inheriting standard handles on windows

Currently if a standard I/O handle is set to inherited on Windows, no action is
taken and the slot in the process information description is set to
`INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however,
this means that the handle is actually set to nothing and if a child tries to
print it will generate an error.

This commit fixes this behavior by explicitly creating stdio handles to be
placed in these slots by duplicating the current process's I/O handles. This is
presumably what previously happened silently by using a file-descriptor-based
implementation instead of a `HANDLE`-centric implementation.

Along the way this cleans up a lot of code in `Process::spawn` for Windows by
ensuring destructors are always run, using more RAII, and limiting the scope of
`unsafe` wherever possible.

9 years agoCurrently, LLVM lowers a cttz8 on x86_64 to these instructions:
Björn Steinbrink [Sun, 26 Apr 2015 22:18:02 +0000 (00:18 +0200)]
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.

9 years agoAuto merge of #24932 - pnkfelix:fix-issue-24687, r=huonw
bors [Wed, 29 Apr 2015 10:40:03 +0000 (10:40 +0000)]
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.

9 years agofix broken link
Oliver Schneider [Wed, 29 Apr 2015 09:41:00 +0000 (11:41 +0200)]
fix broken link

compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"

9 years agoRegression test for issue 24687.
Felix S. Klock II [Wed, 29 Apr 2015 08:21:47 +0000 (10:21 +0200)]
Regression test for issue 24687.

use visible characters for the multibyte character filler.

9 years agoAdapt benchmark tests to unit test guidelines
jooert [Wed, 29 Apr 2015 08:36:43 +0000 (10:36 +0200)]
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.

9 years agoFix zero-normalization of the pos of a `MultiByteChar`.
Felix S. Klock II [Wed, 29 Apr 2015 08:21:29 +0000 (10:21 +0200)]
Fix zero-normalization of the pos of a `MultiByteChar`.

Fix #24687

9 years agoAuto merge of #24893 - robinst:issue-24407-E0013, r=nrc
bors [Wed, 29 Apr 2015 07:37:58 +0000 (07:37 +0000)]
Auto merge of #24893 - robinst:issue-24407-E0013, r=nrc

Part of #24407.

9 years agosave-analysis: fix impl functions
Nick Cameron [Wed, 29 Apr 2015 07:21:18 +0000 (19:21 +1200)]
save-analysis: fix impl functions

9 years agoReviewer changes
Nick Cameron [Wed, 29 Apr 2015 06:14:37 +0000 (18:14 +1200)]
Reviewer changes

9 years agoTidy up
Nick Cameron [Fri, 24 Apr 2015 05:25:35 +0000 (17:25 +1200)]
Tidy up

9 years agodebuginfo: extract adt.rs
Nick Cameron [Fri, 24 Apr 2015 05:20:13 +0000 (17:20 +1200)]
debuginfo: extract adt.rs

9 years agodebuginfo: extract metadata.rs
Nick Cameron [Fri, 24 Apr 2015 04:48:10 +0000 (16:48 +1200)]
debuginfo: extract metadata.rs

9 years agodebuginfo: extract types.rs
Nick Cameron [Fri, 24 Apr 2015 04:08:11 +0000 (16:08 +1200)]
debuginfo: extract types.rs

9 years agodebuginfo: extract namespace.rs
Nick Cameron [Fri, 24 Apr 2015 04:00:47 +0000 (16:00 +1200)]
debuginfo: extract namespace.rs

9 years agodebuginfo: extract create.rs
Nick Cameron [Fri, 24 Apr 2015 03:49:20 +0000 (15:49 +1200)]
debuginfo: extract create.rs

9 years agodebuginfo: extract utils.rs
Nick Cameron [Fri, 24 Apr 2015 03:36:43 +0000 (15:36 +1200)]
debuginfo: extract utils.rs

9 years agodebuginfo: extract gdb.rs
Nick Cameron [Fri, 24 Apr 2015 03:25:42 +0000 (15:25 +1200)]
debuginfo: extract gdb.rs

9 years agodebuginfo: pull out docs
Nick Cameron [Fri, 24 Apr 2015 01:20:54 +0000 (13:20 +1200)]
debuginfo: pull out docs

9 years agoTidy up word-wrapping in debuginfo
Nick Cameron [Thu, 23 Apr 2015 23:38:53 +0000 (11:38 +1200)]
Tidy up word-wrapping in debuginfo

9 years agoMove debuginfo.rs to its own directory
Nick Cameron [Thu, 23 Apr 2015 23:31:13 +0000 (11:31 +1200)]
Move debuginfo.rs to its own directory

9 years agoUnstub some tests
Tamir Duberstein [Wed, 29 Apr 2015 04:23:28 +0000 (21:23 -0700)]
Unstub some tests

9 years agoTests need not be public
Tamir Duberstein [Wed, 29 Apr 2015 04:22:58 +0000 (21:22 -0700)]
Tests need not be public

9 years agoRemove unused variable
Tamir Duberstein [Wed, 29 Apr 2015 04:22:06 +0000 (21:22 -0700)]
Remove unused variable

9 years agoAuto merge of #24681 - tamird:unignore-android, r=alexcrichton
bors [Wed, 29 Apr 2015 04:09:45 +0000 (04:09 +0000)]
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 445faca8441aae34c91318b6ad9e2049885af8dc, which has a pretty unfortunate commit message.

r? @alexcrichton

9 years agoFix punctuation placement in doc-comment
Corey Farwell [Wed, 29 Apr 2015 03:06:00 +0000 (23:06 -0400)]
Fix punctuation placement in doc-comment

9 years agoAuto merge of #24888 - tamird:snapshot, r=alexcrichton
bors [Wed, 29 Apr 2015 02:16:01 +0000 (02:16 +0000)]
Auto merge of #24888 - tamird:snapshot, r=alexcrichton

r? @alexcrichton cc @brson

9 years agoAdd intrinsics for unchecked division and modulo
Nicholas Mazzuca [Wed, 29 Apr 2015 01:20:30 +0000 (18:20 -0700)]
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

9 years agoReference the correct issue
Tamir Duberstein [Wed, 22 Apr 2015 05:10:47 +0000 (22:10 -0700)]
Reference the correct issue

9 years ago#10356: Warnings
Tamir Duberstein [Wed, 22 Apr 2015 05:10:22 +0000 (22:10 -0700)]
#10356: Warnings

9 years ago#10381: Warnings
Tamir Duberstein [Wed, 22 Apr 2015 04:53:07 +0000 (21:53 -0700)]
#10381: Warnings

9 years agoReference the correct issue and clarify failure
Tamir Duberstein [Wed, 22 Apr 2015 04:28:46 +0000 (21:28 -0700)]
Reference the correct issue and clarify failure

9 years ago#10393 & #13206: Warnings
Tamir Duberstein [Wed, 22 Apr 2015 04:27:29 +0000 (21:27 -0700)]
#10393 & #13206: Warnings

9 years agostd: Implement fs::DirBuilder
Alex Crichton [Tue, 28 Apr 2015 00:29:35 +0000 (17:29 -0700)]
std: Implement fs::DirBuilder

This is the last remaining portion of #24796

9 years agoRegister new snapshots
Tamir Duberstein [Mon, 27 Apr 2015 21:10:49 +0000 (14:10 -0700)]
Register new snapshots

9 years agoAuto merge of #24865 - bluss:range-size, r=alexcrichton
bors [Wed, 29 Apr 2015 00:15:22 +0000 (00:15 +0000)]
Auto merge of #24865 - bluss:range-size, r=alexcrichton

core: Fix size_hint for signed integer `Range<T>` iterators

There was an overflow bug in .size_hint() for signed iterators, which
produced an hilariously incorrect size or an overflow panic.

Incorrect size is a serious bug since the iterators are marked
ExactSizeIterator. (And leads to abort() on (-1i8..127).collect() when
the collection tries to preallocate too much).

> (-1i8..127).size_hint()
(18446744073709551488, Some(18446744073709551488))

Bug found using quickcheck.

Fixes #24851

9 years agoExtend the nullable pointer optimization to captured vars of closures
J Bailey [Tue, 28 Apr 2015 23:24:16 +0000 (19:24 -0400)]
Extend the nullable pointer optimization to captured vars of closures

9 years agoAuto merge of #24781 - bluss:vec-drain-range, r=alexcrichton
bors [Tue, 28 Apr 2015 22:13:42 +0000 (22:13 +0000)]
Auto merge of #24781 - bluss:vec-drain-range, r=alexcrichton

Implement Vec::drain(\<range type\>) from rust-lang/rfcs#574, tracking issue #23055.

This is a big step forward for vector usability. This is an introduction of an API for removing a range of *m* consecutive elements from a vector, as efficently as possible.

New features:

- Introduce trait `std::collections::range::RangeArgument` implemented by all four built-in range types.
- Change `Vec::drain()` to use `Vec::drain<R: RangeArgument>(R)`

Implementation notes:

- Use @Gankro's idea for memory safety: Use `set_len` on the source vector when creating the iterator, to make sure that the part of the vector that will be modified is unreachable. Fix up things in Drain's destructor — but even if it doesn't run, we don't expose any moved-out-from slots of the vector.
- This `.drain<R>(R)` very close to how it is specified in the RFC.
- Introduced as unstable
- Drain reuses the slice iterator — copying and pasting the same iterator pointer arithmetic again felt very bad
- The `usize` index as a range argument in the RFC is not included. The ranges trait would have to change to accomodate it.

Please help me with:

- Name and location of the new ranges trait.
- Design of the ranges trait
- Understanding Niko's comments about variance (Note: for a long time I was using a straight up &mut Vec in the iterator, but I changed this to permit reusing the slice iterator).

Previous PR and discussion: #23071