Commit Graph

49569 Commits

Author SHA1 Message Date
Manish Goregaokar
7893031d92 Rollup merge of #30869 - D101101:patch-3, r=huonw
r? @steveklabnik
2016-01-14 19:12:28 +05:30
Manish Goregaokar
07aaca3a07 Rollup merge of #30821 - steveklabnik:gh30819, r=nikomatsakis
Fixes #30819
2016-01-14 19:12:28 +05:30
Greg Chapple
a5836fa48f Fix note about B-prefixed issue labels
'B' labels are for blockers, not issues which belong elsewhere.

Prompted by this comment on Reddit:
https://www.reddit.com/r/rust/comments/40nzkd/contributing_to_the_rust_compiler_a_short_guide/cyxcjtd
2016-01-14 10:47:04 +00:00
bors
5b3a75fe56 Auto merge of #30883 - Manishearth:rollup, r=Manishearth
- Successful merges: #30626, #30662, #30770, #30801, #30818, #30823, #30828, #30835, #30837, #30839, #30845, #30848, #30850, #30851, #30863
- Failed merges:
2016-01-14 06:45:26 +00:00
Manish Goregaokar
1246f43bf9 Rollup merge of #30863 - jseyfried:no_rc, r=eddyb
Use arena allocation instead of reference counting for `Module`s to fix memory leaks from `Rc` cycles.

A module references its module children and its import resolutions, and an import resolution references the module defining the imported name, so there is a cycle whenever a module imports something from an ancestor module.

For example,
```rust
mod foo { // `foo` references `bar`.
    fn baz() {}
    mod bar { // `bar` references the import.
        use foo::baz; // The import references `foo`.
    }
}
```
2016-01-14 11:04:43 +05:30
Manish Goregaokar
e51de045ef Rollup merge of #30851 - jonas-schievink:unneeded-dropflags, r=pnkfelix
Apparently we allocate and maintain non-working dropflag hints since June... In anticipation of a working implementation of on-stack drop flag hints, let's not spend even more time on types that don't even need to be dropped.

```rust
fn main() {
    let (i,j,k,l) = (0,0,0,0);
}
```
used to translate to (unoptimized only, of course):
```llvm
define internal void @_ZN4main20ha8deb085c47920d8eaaE() unnamed_addr #0 {
entry-block:
  %dropflag_hint_10 = alloca i8
  %dropflag_hint_11 = alloca i8
  %dropflag_hint_12 = alloca i8
  %dropflag_hint_13 = alloca i8
  %const = alloca { i32, i32, i32, i32 }
  %i = alloca i32
  %j = alloca i32
  %k = alloca i32
  %l = alloca i32
  store i8 61, i8* %dropflag_hint_10
  store i8 61, i8* %dropflag_hint_11
  store i8 61, i8* %dropflag_hint_12
  store i8 61, i8* %dropflag_hint_13
  %0 = bitcast { i32, i32, i32, i32 }* %const to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ({ i32, i32, i32, i32 }* @const2752 to i8*), i64 16, i32 4, i1 false)
  %1 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 0
  %2 = load i32, i32* %1, align 4
  store i32 %2, i32* %i, align 4
  %3 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 1
  %4 = load i32, i32* %3, align 4
  store i32 %4, i32* %j, align 4
  %5 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 2
  %6 = load i32, i32* %5, align 4
  store i32 %6, i32* %k, align 4
  %7 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 3
  %8 = load i32, i32* %7, align 4
  store i32 %8, i32* %l, align 4
  ret void
}
```

Now it gives:
```llvm
define internal void @_ZN4main20ha8deb085c47920d8eaaE() unnamed_addr #0 {
entry-block:
  %const = alloca { i32, i32, i32, i32 }
  %i = alloca i32
  %j = alloca i32
  %k = alloca i32
  %l = alloca i32
  %0 = bitcast { i32, i32, i32, i32 }* %const to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ({ i32, i32, i32, i32 }* @const2748 to i8*), i64 16, i32 4, i1 false)
  %1 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 0
  %2 = load i32, i32* %1, align 4
  store i32 %2, i32* %i, align 4
  %3 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 1
  %4 = load i32, i32* %3, align 4
  store i32 %4, i32* %j, align 4
  %5 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 2
  %6 = load i32, i32* %5, align 4
  store i32 %6, i32* %k, align 4
  %7 = getelementptr inbounds { i32, i32, i32, i32 }, { i32, i32, i32, i32 }* %const, i32 0, i32 3
  %8 = load i32, i32* %7, align 4
  store i32 %8, i32* %l, align 4
  ret void
}
```

Let's hope I didn't break anything!
2016-01-14 11:04:43 +05:30
Manish Goregaokar
6ceaa2f77a Rollup merge of #30850 - ranma42:cleanup-io, r=alexcrichton
In 8d90d3f368 `BufStream`, the only
consumer of `InternalBufWriter`, was removed. As implied by the name,
this type is private, hence it is currently dead code.
2016-01-14 11:04:43 +05:30
Manish Goregaokar
24848846cc Rollup merge of #30839 - tomaka:debug-phantomdata, r=nikomatsakis
All the trait implementations of `PhantomData` use `impl<T: ?Sized>` except for `Debug`
https://doc.rust-lang.org/nightly/std/marker/struct.PhantomData.html#implementations

This PR fixes this.
2016-01-14 11:04:42 +05:30
Manish Goregaokar
837a8decb6 Rollup merge of #30837 - semarie:openbsd-libc, r=alexcrichton
The following PR updates libc version to latest commits for correctly support openbsd.
It corrects several points in rustc to be compatible with libc changes.

r? @alexcrichton
2016-01-14 11:04:42 +05:30
Manish Goregaokar
4ff1d20ad7 Rollup merge of #30835 - kraai:show-span, r=sanxiyn
I think this will fix #30656.
2016-01-14 11:04:41 +05:30
Manish Goregaokar
98c7519826 Rollup merge of #30828 - wheals:fix-dead-links, r=steveklabnik
See [the intrinsics page](https://doc.rust-lang.org/nightly/core/intrinsics/index.html) for example.
2016-01-14 11:04:41 +05:30
Manish Goregaokar
9036c82781 Rollup merge of #30823 - pnkfelix:put-back-alloca-zeroing-for-issue-30530, r=dotdash
Put back alloca zeroing for issues #29092, #30018, #30530; inject zeroing for #30822.

----

Background context: `fn alloca_zeroed` was removed in PR #22969, so we haven't been "zero'ing" (\*) the alloca's since at least that point, but the logic behind that PR seems sound, so its not entirely obvious how *long* the underlying bug has actually been present.  In other words, I have not yet done a survey to see when the new `alloc_ty` and `lvalue_scratch_datum` calls were introduced that should have had "zero'ing" the alloca's.

----

I first fixed #30018, then decided to do a survey of `alloc_ty` calls to see if they needed similar treatment, which quickly led to a rediscovery of #30530.

While making the regression test for the latter, I discovered #30822, which is a slightly different bug (in terms of where the "zero'ing" needs to go), but still relevant.

I haven't finished the aforementioned survey of `fn alloc_ty` calls, but I decided I wanted to get this up for review in its current state (namely to see if my attempt to force developers to include a justification for passing `Uninit` can possibly fly, or if I should abandon that path of action).

----

(*): I am putting quotation marks around "zero'ing" because we no longer use zero as our "dropped" marker value.

Fix #29092
Fix #30018
Fix #30530
Fix #30822
2016-01-14 11:04:41 +05:30
Manish Goregaokar
3e248aa09f Rollup merge of #30818 - sfackler:duration-hash, r=alexcrichton
tikue pointed out in IRC that this was missing.
2016-01-14 11:04:40 +05:30
Manish Goregaokar
6f4ede44de Rollup merge of #30801 - Amanieu:oom_print, r=alexcrichton
This adds the ability to override the default OOM behavior by setting a handler function. This is used by libstd to print a message when running out of memory instead of crashing with an obscure "illegal hardware instruction" error (at least on Linux).

Fixes #14674
2016-01-14 11:04:40 +05:30
Manish Goregaokar
6581563f7a Rollup merge of #30770 - steveklabnik:gh30345, r=brson
Fixes #30345

I'm not sure if there's anything else that belongs here. Thoughts?
2016-01-14 11:04:40 +05:30
Manish Goregaokar
40f06b4bb1 Rollup merge of #30626 - steveklabnik:gh30618, r=luqmana
Fixes #30618
2016-01-14 11:04:39 +05:30
bors
e1f550ebc2 Auto merge of #30662 - simartin:issue_30592, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/30592, a fallout of cd1848a1a6
2016-01-14 03:17:51 +00:00
Jake Goulding
6a4f3b2335 Improve grammar of Box::{into,from}_raw docs 2016-01-13 21:23:56 -05:00
bors
9f6917d426 Auto merge of #30466 - alexcrichton:move-wrapping-and-fill-out, r=aturon
This commit migrates all of the methods on `num::wrapping::OverflowingOps` onto
inherent methods of the integer types. This also fills out some missing gaps in
the saturating and checked departments such as:

* `saturating_mul`
* `checked_{neg,rem,shl,shr}`

This is done in preparation for stabilization,

cc #27755
2016-01-14 01:26:54 +00:00
Oliver Middleton
01cbdf4481 Fix some broken and missing links in the docs 2016-01-13 23:19:24 +00:00
bors
1447ce78fb Auto merge of #30870 - Eljay:issue-30477, r=alexcrichton
Fixes #30477, #30213.

The loop over reexports used to be a closure before #30043 but it's an iterator now so it should just continue instead of exiting the loop and skipping stuff.

r? @brson
2016-01-13 22:27:46 +00:00
Niko Matsakis
0704279dd3 improve use of , vs ; 2016-01-13 15:56:53 -05:00
Amanieu d'Antras
98bef2b818 Add missing newline character to callers of dumb_print 2016-01-13 20:40:25 +00:00
bors
6089ebaddb Auto merge of #30813 - fhahn:fix-ice-semicolon-in-lifetime, r=nrc
This PR fixes an ICE due to an DiagnosticsBuilder not being canceld or emitted.

Ideally it would use `Handler::cancel`, but I did not manage to get a `&mut` reference to the diagnostics handler.
2016-01-13 20:38:12 +00:00
Simon Martin
c5da16012d Issue #30592: Restore build in --disable-jemalloc mode. 2016-01-13 21:15:00 +01:00
Dave Huseby
5ecccb1094 removing the conditional compilation of the dynamic_lib reference 2016-01-13 11:25:02 -08:00
Dave Huseby
a933526fc4 Fixes #30873 2016-01-13 11:25:01 -08:00
Alex Burka
33b12be8b5 update tracking issue for collections_range 2016-01-13 13:50:41 -05:00
bors
ac9be00ecc Auto merge of #30509 - michaelsproul:string-box-error, r=alexcrichton
Closes #30156.
2016-01-13 18:46:29 +00:00
bors
b0eec55c3f Auto merge of #30794 - joerg-krause:fix-arm-unknown-linux-gnueabi-float-abi, r=alexcrichton
gnueabi indicates soft whereas gnueabihf indicates hard floating-point ABI.
2016-01-13 16:57:01 +00:00
Niko Matsakis
5580b90392 s/HARD ERROR/hard error/ -- perhaps the warning is enough 2016-01-13 10:11:09 -05:00
bors
7aed245d69 Auto merge of #30779 - michaelwoerister:closure-mir-in-metadata, r=nikomatsakis 2016-01-13 15:08:07 +00:00
Oliver 'ker' Schneider
3ae71b1b69 the reference was inferring values that didn't fit into their target type 2016-01-13 14:50:04 +01:00
Felix S. Klock II
decc286757 add doc for new fn alloc_ty_init.
(Note that it might be a good idea to replace *all* calls of
`alloc_ty` with calls to `alloc_ty_init`, to encourage programmers to
consider the appropriate value for the `init` flag when creating
temporary values.)
2016-01-13 14:29:50 +01:00
Felix S. Klock II
7706e2333e revise lifetime handling for alloca's that are initialized as "dropped."
(This can/should be revisited when drop flags are stored out of band.)
2016-01-13 14:29:50 +01:00
Felix S. Klock II
8168765d43 Factored out private routine for emitting LLVM lifetime intrinsic calls.
(The reason this is not factored as far as possible because a
subsequent commit is going to need to do construction without having
access to a `cx`.)
2016-01-13 14:29:50 +01:00
Felix S. Klock II
df1283cd1a Unit/regression tests for issues #29092, #30018, #30530, #30822.
Note that the test for #30822 is folded into the test for #30530 (but
the file name mentions only 30530).
2016-01-13 14:29:25 +01:00
Felix S. Klock II
f251ff4081 bug fixes for issues 30018 and 30822.
includes bugfixes pointed out during review:

 * Only `call_lifetime_start` for an alloca if the function entry does
   not itself initialize it to "dropped."

 * Remove `schedule_lifetime_end` after writing an *element* into a
   borrowed slice. (As explained by [dotdash][irc], "the lifetime end
   that is being removed was for an element in the slice, which is not
   an alloca of its own and has no lifetime start of its own")

[irc]: https://botbot.me/mozilla/rust-internals/2016-01-13/?msg=57844504&page=3
2016-01-13 14:02:06 +01:00
Lee Jeffery
42acf89e1f Fix rustdoc reexports. 2016-01-13 13:01:14 +00:00
bors
d3c83fef24 Auto merge of #30684 - tshepang:rustfmt-lexer-part2, r=nrc 2016-01-13 12:22:51 +00:00
bors
8796e012cb Auto merge of #29498 - wthrowe:replace-pattern, r=alexcrichton
It appears this was left out of RFC rust-lang/rfcs#528 because it might be useful to
also generalize the second argument in some way.  That doesn't seem to
prevent generalizing the first argument now, however.

This is a [breaking-change] because it could cause type-inference to
fail where it previously succeeded.

Also update docs for a few other methods that still referred to `&str` instead of patterns.
2016-01-13 08:15:45 +00:00
Sergey Veselkov
b986698bc4 Fix typo in bibliography.md 2016-01-13 09:14:21 +03:00
bors
f1bcfdd8e4 Auto merge of #30639 - rkruppe:dec2flt-fastpath-tables, r=alexcrichton
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path.

Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference.

[benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
2016-01-13 02:05:02 +00:00
Anton Blanchard
12aec073a8 Simplify some uses of cfg in test cases
While adding PowerPC64 support it was noticed that some testcases should
just use target_pointer_width, and others should select between
x86 and !x86.
2016-01-13 01:39:01 +00:00
Anton Blanchard
7ff64b20f9 Incorrect getrandom() system call for PowerPC Linux
Michael Ellerman pointed out that the system call for getrandom()
on PowerPC Linux is incorrect. This bug was in the powerpc32 port,
and was carried over to the powerpc64 port too.
2016-01-13 01:39:01 +00:00
Anton Blanchard
b372910476 Add powerpc64 and powerpc64le support
This adds support for big endian and little endian PowerPC64.
make check runs clean apart from one big endian backtrace issue.
2016-01-13 01:39:00 +00:00
Jeffrey Seyfried
a8514d3ecc resolve: use arena allocation instead of reference counting for Modules to fix memory leaks from Rc cycles 2016-01-13 00:54:16 +00:00
Niko Matsakis
0254f69d74 use fileline_ and not full span_ for the followon messages 2016-01-12 19:38:12 -05:00
Michael Sproul
c1e527f11d Add an impl for Box<Error> from &str. 2016-01-13 10:38:44 +11:00
bors
49c3827790 Auto merge of #30601 - tamird:delegate-libc, r=alexcrichton
See: http://developer.android.com/ndk/downloads/revision_history.html

Also, use `libc`'s `posix_memalign`.
2016-01-12 22:49:02 +00:00