Commit Graph

49553 Commits

Author SHA1 Message Date
Nick Cameron
acfccc515b Add a JSON error emitter 2016-01-15 10:20:30 +13:00
bors
c12c42de0a Auto merge of #30913 - brson:nogold, r=alexcrichton
This reverts commit 34dc0e0739.

cc #30783 #30784 #29974

r? @alexcrichton
2016-01-14 20:32:13 +00:00
Steve Klabnik
6ab39ff098 Rollup merge of #30914 - tshepang:easier-description, r=steveklabnik
This function returns the size on the stack, not that of the value
that may be allocated on the heap.
2016-01-14 14:58:35 -05:00
Steve Klabnik
9ffb84a784 Rollup merge of #30912 - tshepang:remove-distraction, r=steveklabnik 2016-01-14 14:58:35 -05:00
Steve Klabnik
9b10d0e1e5 Rollup merge of #30911 - tshepang:missing-word, r=Manishearth
Also, whitespace fixes
2016-01-14 14:58:35 -05:00
Steve Klabnik
958bff100a Rollup merge of #30910 - tshepang:improve-description, r=steveklabnik 2016-01-14 14:58:35 -05:00
Steve Klabnik
b3950b7ca5 Rollup merge of #30909 - tshepang:a-better-name, r=steveklabnik
For a moment, I got confused by thinking the summary was referring to the same `x`
2016-01-14 14:58:34 -05:00
Steve Klabnik
f1a0fd127a Rollup merge of #30903 - steveklabnik:no_std_stable, r=alexcrichton
This feature is partially stabilized, so describe each part in the appropriate place.

r? @alexcrichton @brson

It would be nice to backport this to beta, since this is the first release where this is true. I try really hard to not do doc backports, but this isn't very large, and might be worth making an exception, I dunno.
2016-01-14 14:58:34 -05:00
Steve Klabnik
72ebb193a9 Rollup merge of #30902 - tomaka:patch-1, r=steveklabnik 2016-01-14 14:58:34 -05:00
Steve Klabnik
c88574a32b Rollup merge of #30895 - gchp:contrib, r=alexcrichton
'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 14:58:34 -05:00
Steve Klabnik
e26279db48 Rollup merge of #30712 - LawrenceWoodman:patch-3, r=steveklabnik
This also repeats the case analysis used.
2016-01-14 14:58:34 -05:00
Tshepang Lekhonkhobe
dfdbbd005a doc: this is more easy to read, and less prone mis-interpretation
This function returns the size on the stack, not that of the value
that may be allocated on the heap.
2016-01-14 21:38:18 +02:00
Brian Anderson
4bcca8bcf7 Revert "Link with ld.gold by default"
This reverts commit 34dc0e0739.
2016-01-14 19:20:11 +00:00
Sébastien Marie
b1d8554698 update blksize_t in raw to reflect libc change under openbsd 2016-01-14 20:15:19 +01:00
Tshepang Lekhonkhobe
f7fb0af729 doc: that suffix serves as mere distraction 2016-01-14 21:08:15 +02:00
Tshepang Lekhonkhobe
049b9e4e80 doc: add missing word
Also, whitespace fixes
2016-01-14 20:56:38 +02:00
Tshepang Lekhonkhobe
80d2be947e doc: "x" is used as variable name on this API, so avoid using it here 2016-01-14 20:54:49 +02:00
Tshepang Lekhonkhobe
7d446ce555 doc: "moves" has a specific meaning in Rust, so avoid using it here 2016-01-14 20:52:51 +02:00
Niko Matsakis
43756934d2 switch the fulfillment context to use the new obligation forest;
this commit won't build because, as of this version, no coinductive
reasoning at all is really supported
2016-01-14 13:00:10 -05:00
Niko Matsakis
0defb158aa implement the obligation forest data structure and add some unit tests 2016-01-14 12:59:50 -05:00
Niko Matsakis
82c43432e0 modify trait checker to track the variables on which trait resolution is
stalled rather than keeping this annoying mark; I checked that the
original compile-time regression that the mark was intended to
fix (https://github.com/rust-lang/rust/issues/18208) was still
reasonable, but I've not done exhaustive measurements to see how
important this "optimization" really is anymore
2016-01-14 12:59:50 -05:00
Vadim Petrochenkov
5f57121fb3 Update libbacktrace to 11b1a9c476b2df514d620d479407f2cf217cb373
Source: https://github.com/gcc-mirror/gcc
2016-01-14 20:58:38 +03:00
Greg Chapple
acc9428c6a Display better snippet for invalid char literal
Given this code:

    fn main() {
        let _ = 'abcd';
    }

The compiler would give a message like:

    error: character literal may only contain one codepoint: ';
    let _ = 'abcd';
                 ^~

With this change, the message now displays:

    error: character literal may only contain one codepoint: 'abcd'
    let _ = 'abcd'
            ^~~~~~

Fixes #30033
2016-01-14 17:34:42 +00:00
tomaka
729e566020 Fix outdated comment 2016-01-14 16:47:29 +01:00
Steve Klabnik
0394418752 Move some #[no_std] info to stable book.
This feature is partially stabilized, so describe each part in the appropriate place.
2016-01-14 10:45:40 -05:00
bors
e5bab5dd00 Auto merge of #30848 - nagisa:mir-no-store-zsts, r=nikomatsakis
Fixes #30831

r? @nikomatsakis
2016-01-14 15:37:07 +00:00
Vadim Petrochenkov
8ea7b88c9b Require stability annotations on fields of tuple variants 2016-01-14 17:08:35 +03:00
Ulrik Sverdrup
cadcd70775 UTF-8 validation: Add missing if conditional for short input
We need to guard that `len` is large enough for the fast skip loop.
2016-01-14 14:59:55 +01:00
bors
02fbf31fb2 Auto merge of #30897 - Manishearth:rollup, r=Manishearth
- Successful merges: #30821, #30869, #30871, #30874, #30879, #30886, #30892
- Failed merges: #30864
2016-01-14 13:42:59 +00:00
Manish Goregaokar
a964c86d45 Rollup merge of #30892 - shepmaster:box-grammar, r=alexcrichton 2016-01-14 19:12:29 +05:30
Manish Goregaokar
92aa326920 Rollup merge of #30886 - ollie27:docs_links, r=steveklabnik
r? @steveklabnik
2016-01-14 19:12:29 +05:30
Manish Goregaokar
f28a43102b Rollup merge of #30879 - durka:collections-range-tracking-issue, r=nagisa
see #27711 and #30877

r? @alexcrichton
2016-01-14 19:12:29 +05:30
Manish Goregaokar
74458cf42a Rollup merge of #30874 - dhuseby:fixing_bitrig_tests, r=alexcrichton
fixes the failing bitrig unit tests.
2016-01-14 19:12:28 +05:30
Manish Goregaokar
9cb4350e63 Rollup merge of #30871 - oli-obk:fix/reference, r=steveklabnik
r? @steveklabnik
2016-01-14 19:12:28 +05:30
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