]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoFix translation for all other discriminated ADTs
Simonas Kazlauskas [Thu, 14 Jan 2016 00:55:46 +0000 (02:55 +0200)]
Fix translation for all other discriminated ADTs

Again.

8 years agoAuto merge of #30773 - fhahn:test-fix, r=alexcrichton
bors [Fri, 15 Jan 2016 17:31:08 +0000 (17:31 +0000)]
Auto merge of #30773 - fhahn:test-fix, r=alexcrichton

In my PR for #21659 I accidentally used `// | help` as test annotation. This PR updates it to `//~| help`. I also found and updated 2 other tests with the same issue.

8 years agoTranslate zero-sized return types as void
Björn Steinbrink [Fri, 15 Jan 2016 16:34:38 +0000 (17:34 +0100)]
Translate zero-sized return types as void

The only way to get a value for a zero-sized type is `undef`, so
there's really no point in actually having a return type other than
void for such types. Also, while the comment in return_type_is_void
mentioned something about aiding C ABI support, @eddyb correctly
pointed out on IRC that there is no such thing as a zero-sized type in
C. And even with clang, which allows empty structs, those get
translated as void return types as well.

Fixes #28766

8 years agorustdoc: remove extraneous whitespace inserted in playpen links
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 21:40:23 +0000 (23:40 +0200)]
rustdoc: remove extraneous whitespace inserted in playpen links

8 years agoPreserve struct/variant kinds in metadata
Vadim Petrochenkov [Thu, 14 Jan 2016 11:26:50 +0000 (14:26 +0300)]
Preserve struct/variant kinds in metadata

Add tests for use of empty structs in cross-crate scenarios

8 years agoBTreeSet::insert returns false when key already exists
Jake Goulding [Fri, 15 Jan 2016 16:49:43 +0000 (11:49 -0500)]
BTreeSet::insert returns false when key already exists

8 years agolibbacktrace: Reapply Rust-specific changes
Vadim Petrochenkov [Fri, 15 Jan 2016 16:24:50 +0000 (19:24 +0300)]
libbacktrace: Reapply Rust-specific changes

New:
Fix for https://github.com/rust-lang/rust/issues/28447

Merged:
openbsd support: https://github.com/rust-lang/rust/commit/fcb30a0b67b1bd4acbc3422ff74fac5d031ae1ae
bitrig integration: https://github.com/rust-lang/rust/commit/cd8f31759fd04b9ce9c903fa00cae81dc5bba546

Not merged:
https://github.com/rust-lang/rust/commit/d4fc3ec208186f0a9de8d05a6802c95b07e058fd
@Diggsey says this change was unintended (https://github.com/rust-lang/rust/pull/30666#issuecomment-168616892)

8 years agoGenerate ADTs for tuple-like constructors instead
Simonas Kazlauskas [Thu, 14 Jan 2016 00:19:55 +0000 (02:19 +0200)]
Generate ADTs for tuple-like constructors instead

Previously we would generate regular calls for these, which is likely to result in worse LLVM code,
especially in presence of cleanups – we needn’t unecessarilly generate landing pads to construct an
ADT!

8 years agoAuto merge of #30898 - petrochenkov:tvarfstab, r=alexcrichton
bors [Fri, 15 Jan 2016 15:39:39 +0000 (15:39 +0000)]
Auto merge of #30898 - petrochenkov:tvarfstab, r=alexcrichton

This wasn't done in https://github.com/rust-lang/rust/pull/29083 because attributes weren't parsed on fields of tuple variant back then.

r? @alexcrichton

8 years agoRename is_positive argument in fmt::Formatter::pad_integral
Oliver Middleton [Fri, 15 Jan 2016 14:46:19 +0000 (14:46 +0000)]
Rename is_positive argument in fmt::Formatter::pad_integral

The function expects a value of true for zero but zero is not positive.

8 years agomove const block checks before lowering step
Oliver Schneider [Fri, 15 Jan 2016 12:16:54 +0000 (13:16 +0100)]
move const block checks before lowering step

this makes sure the checks run before typeck (which might use the constant or const
function to calculate an array length) and gives prettier error messages in case of for
loops and such (since they aren't expanded yet).

8 years agoAuto merge of #30929 - Manishearth:rollup, r=Manishearth
bors [Fri, 15 Jan 2016 11:59:11 +0000 (11:59 +0000)]
Auto merge of #30929 - Manishearth:rollup, r=Manishearth

- Successful merges: #30591, #30781, #30836, #30864, #30896, #30898, #30908, #30921, #30925
- Failed merges:

8 years agoRollup merge of #30925 - semarie:blksize_t, r=alexcrichton
Manish Goregaokar [Fri, 15 Jan 2016 11:58:29 +0000 (17:28 +0530)]
Rollup merge of #30925 - semarie:blksize_t, r=alexcrichton

make `os::raw::tests::unix` test to pass again

r? @alexcrichton

8 years agoRollup merge of #30864 - jseyfried:no_record_exports, r=nrc
Manish Goregaokar [Fri, 15 Jan 2016 11:58:29 +0000 (17:28 +0530)]
Rollup merge of #30864 - jseyfried:no_record_exports, r=nrc

8 years agoRollup merge of #30836 - Luke-Nukem:master, r=steveklabnik
Manish Goregaokar [Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)]
Rollup merge of #30836 - Luke-Nukem:master, r=steveklabnik

Ref issue [30825](https://github.com/rust-lang/rust/issues/30825)

This commit should suffice to add a concise introduction to the concept of crates.
My only worry, is that it is maybe too concise; but, the book seems to be written with the understanding that the new Rust user is coming from another language, and so will understand what a Library or Code Package is.

8 years agoRollup merge of #30787 - nikomatsakis:future-incompatible-lint, r=brson
Manish Goregaokar [Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)]
Rollup merge of #30787 - nikomatsakis:future-incompatible-lint, r=brson

There is now more structure to the report, so that you can specify e.g. an RFC/PR/issue number and other explanatory details.

Example message:

```
type-parameter-invalid-lint.rs:14:8: 14:9 error: defaults for type parameters are only allowed on type definitions, like `struct` or `enum`
type-parameter-invalid-lint.rs:14 fn avg<T=i32>(_: T) {}
                                         ^
type-parameter-invalid-lint.rs:14:8: 14:9 warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
type-parameter-invalid-lint.rs:14:8: 14:9 note: for more information, see PR 30742 <https://github.com/rust-lang/rust/pull/30724>
type-parameter-invalid-lint.rs:11:9: 11:28 note: lint level defined here
type-parameter-invalid-lint.rs:11 #![deny(future_incompatible)]
                                          ^~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
```

r? @brson

I would really like feedback also on the specific messages!

Fixes #30746

8 years agoRollup merge of #30781 - dhuseby:add_dragonflybsd_snapshot_3391630, r=alexcrichton
Manish Goregaokar [Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)]
Rollup merge of #30781 - dhuseby:add_dragonflybsd_snapshot_3391630, r=alexcrichton

@alexcrichton please upload the following snapshots:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-12-18-3391630-dragonfly-x86_64-e74d79488e88ac2de3bd03afd5959d2ae6e2b628.tar.bz2

thanks!

8 years agoRollup merge of #30776 - antonblanchard:powerpc64_merge, r=alexcrichton
Manish Goregaokar [Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)]
Rollup merge of #30776 - antonblanchard:powerpc64_merge, r=alexcrichton

This adds support for big endian and little endian PowerPC64.
make check runs clean apart from one big endian backtrace issue.

8 years agoRollup merge of #30591 - SimonSapin:patch-15, r=aturon
Manish Goregaokar [Fri, 15 Jan 2016 11:58:28 +0000 (17:28 +0530)]
Rollup merge of #30591 - SimonSapin:patch-15, r=aturon

The first line (paragraph?) of a doc-comment is what rustdoc shows when listing items of a module.

What makes `Instant` and `SystemTime` different is important enough to be there. (Though feel free to bikeshed the wording.)

8 years agoImplement Any for unsized types
Steven Fackler [Fri, 15 Jan 2016 07:02:32 +0000 (23:02 -0800)]
Implement Any for unsized types

This is a bit weird since unsized types can't be used in trait objects,
but Any is *also* used as pure marker trait since Reflect isn't stable.
There are many cases (e.g. TypeMap) where all you need is a TypeId.

8 years agoAuto merge of #30763 - gchp:issue/30033, r=nagisa
bors [Fri, 15 Jan 2016 06:38:26 +0000 (06:38 +0000)]
Auto merge of #30763 - gchp:issue/30033, r=nagisa

This is achieved by adding the scan_back method. This method looks back
through the source_text of the StringReader until it finds the target
char, returning it's offset in the source. We use this method to find
the offset of the opening single quote, and use that offset as the start
of the error.

Given this code:

```rust
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

8 years agoAuto merge of #30711 - nrc:json-errs, r=huonw
bors [Fri, 15 Jan 2016 01:52:01 +0000 (01:52 +0000)]
Auto merge of #30711 - nrc:json-errs, r=huonw

The compiler can emit errors and warning in JSON format. This is a more easily machine readable form then the usual error output.

Closes #10492, closes #14863.

8 years agoAddress reviewer comments
Nick Cameron [Wed, 6 Jan 2016 20:23:01 +0000 (09:23 +1300)]
Address reviewer comments

[breaking-change]

`OptLevel` variants are no longer `pub use`ed by rust::session::config. If you are using these variants, you must change your code to prefix the variant name with `OptLevel`.

8 years agoClarify what a crate is, within the "Getting Started" chapter.
Luke Jones [Tue, 12 Jan 2016 06:05:03 +0000 (19:05 +1300)]
Clarify what a crate is, within the "Getting Started" chapter.
* ref: Issue #30825
Small punctuation change in "Crates and Modules".

8 years agoresolve: Remove record_exports, fixes #4953
Jeffrey Seyfried [Tue, 12 Jan 2016 04:55:21 +0000 (04:55 +0000)]
resolve: Remove record_exports, fixes #4953

8 years agoSupport generic associated consts
Michael Wu [Tue, 4 Aug 2015 02:16:24 +0000 (22:16 -0400)]
Support generic associated consts

8 years agoAuto merge of #30916 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 14 Jan 2016 22:23:59 +0000 (22:23 +0000)]
Auto merge of #30916 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30712, #30895, #30902, #30903, #30909, #30910, #30911, #30912, #30914
- Failed merges:

8 years agorustc: Fix bugs in renamed and removed lints and re-add raw_pointer_derive
Brian Anderson [Wed, 13 Jan 2016 18:54:06 +0000 (18:54 +0000)]
rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_derive

cc #30346

8 years agoAdd a test
Nick Cameron [Tue, 5 Jan 2016 01:35:22 +0000 (14:35 +1300)]
Add a test

And fix bustage in make check

8 years agoImplement JSON error emission
Nick Cameron [Thu, 31 Dec 2015 05:47:14 +0000 (18:47 +1300)]
Implement JSON error emission

[breaking-change]

syntax::errors::Handler::new has been renamed to with_tty_emitter

Many functions which used to take a syntax::errors::ColorConfig, now take a rustc::session::config::ErrorOutputType. If you previously used ColorConfig::Auto as a default, you should now use ErrorOutputType::default().

8 years agoAdd an --output option for specifying an error emitter
Nick Cameron [Thu, 31 Dec 2015 03:50:06 +0000 (16:50 +1300)]
Add an --output option for specifying an error emitter

8 years agoAdd a JSON error emitter
Nick Cameron [Thu, 31 Dec 2015 01:43:42 +0000 (14:43 +1300)]
Add a JSON error emitter

8 years agoAuto merge of #30913 - brson:nogold, r=alexcrichton
bors [Thu, 14 Jan 2016 20:32:13 +0000 (20:32 +0000)]
Auto merge of #30913 - brson:nogold, r=alexcrichton

This reverts commit 34dc0e0739e19811850f82f1e45b61ba97adc96e.

cc #30783 #30784 #29974

r? @alexcrichton

8 years agoRollup merge of #30914 - tshepang:easier-description, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:35 +0000 (14:58 -0500)]
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.

8 years agoRollup merge of #30912 - tshepang:remove-distraction, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:35 +0000 (14:58 -0500)]
Rollup merge of #30912 - tshepang:remove-distraction, r=steveklabnik

8 years agoRollup merge of #30911 - tshepang:missing-word, r=Manishearth
Steve Klabnik [Thu, 14 Jan 2016 19:58:35 +0000 (14:58 -0500)]
Rollup merge of #30911 - tshepang:missing-word, r=Manishearth

Also, whitespace fixes

8 years agoRollup merge of #30910 - tshepang:improve-description, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:35 +0000 (14:58 -0500)]
Rollup merge of #30910 - tshepang:improve-description, r=steveklabnik

8 years agoRollup merge of #30909 - tshepang:a-better-name, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:34 +0000 (14:58 -0500)]
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`

8 years agoRollup merge of #30903 - steveklabnik:no_std_stable, r=alexcrichton
Steve Klabnik [Thu, 14 Jan 2016 19:58:34 +0000 (14:58 -0500)]
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.

8 years agoRollup merge of #30902 - tomaka:patch-1, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:34 +0000 (14:58 -0500)]
Rollup merge of #30902 - tomaka:patch-1, r=steveklabnik

8 years agoRollup merge of #30895 - gchp:contrib, r=alexcrichton
Steve Klabnik [Thu, 14 Jan 2016 19:58:34 +0000 (14:58 -0500)]
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

8 years agoRollup merge of #30712 - LawrenceWoodman:patch-3, r=steveklabnik
Steve Klabnik [Thu, 14 Jan 2016 19:58:34 +0000 (14:58 -0500)]
Rollup merge of #30712 - LawrenceWoodman:patch-3, r=steveklabnik

This also repeats the case analysis used.

8 years agodoc: this is more easy to read, and less prone mis-interpretation
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 19:37:43 +0000 (21:37 +0200)]
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.

8 years agoRevert "Link with ld.gold by default"
Brian Anderson [Thu, 14 Jan 2016 19:20:11 +0000 (19:20 +0000)]
Revert "Link with ld.gold by default"

This reverts commit 34dc0e0739e19811850f82f1e45b61ba97adc96e.

8 years agoupdate blksize_t in raw to reflect libc change under openbsd
Sébastien Marie [Thu, 14 Jan 2016 19:15:19 +0000 (20:15 +0100)]
update blksize_t in raw to reflect libc change under openbsd

8 years agodoc: that suffix serves as mere distraction
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 19:08:15 +0000 (21:08 +0200)]
doc: that suffix serves as mere distraction

8 years agodoc: add missing word
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 18:56:37 +0000 (20:56 +0200)]
doc: add missing word

Also, whitespace fixes

8 years agodoc: "x" is used as variable name on this API, so avoid using it here
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 18:54:49 +0000 (20:54 +0200)]
doc: "x" is used as variable name on this API, so avoid using it here

8 years agodoc: "moves" has a specific meaning in Rust, so avoid using it here
Tshepang Lekhonkhobe [Thu, 14 Jan 2016 18:52:51 +0000 (20:52 +0200)]
doc: "moves" has a specific meaning in Rust, so avoid using it here

8 years agoswitch the fulfillment context to use the new obligation forest;
Niko Matsakis [Wed, 23 Dec 2015 00:44:01 +0000 (19:44 -0500)]
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

8 years agoimplement the obligation forest data structure and add some unit tests
Niko Matsakis [Wed, 18 Nov 2015 19:44:24 +0000 (14:44 -0500)]
implement the obligation forest data structure and add some unit tests

8 years agomodify trait checker to track the variables on which trait resolution is
Niko Matsakis [Thu, 26 Nov 2015 11:46:00 +0000 (06:46 -0500)]
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

8 years agoUpdate libbacktrace to 11b1a9c476b2df514d620d479407f2cf217cb373
Vadim Petrochenkov [Thu, 14 Jan 2016 17:58:38 +0000 (20:58 +0300)]
Update libbacktrace to 11b1a9c476b2df514d620d479407f2cf217cb373

Source: https://github.com/gcc-mirror/gcc

8 years agoDisplay better snippet for invalid char literal
Greg Chapple [Thu, 7 Jan 2016 16:12:28 +0000 (16:12 +0000)]
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

8 years agoFix outdated comment
tomaka [Thu, 14 Jan 2016 15:44:15 +0000 (16:44 +0100)]
Fix outdated comment

8 years agoMove some #[no_std] info to stable book.
Steve Klabnik [Thu, 14 Jan 2016 15:45:40 +0000 (10:45 -0500)]
Move some #[no_std] info to stable book.

This feature is partially stabilized, so describe each part in the appropriate place.

8 years agoAuto merge of #30848 - nagisa:mir-no-store-zsts, r=nikomatsakis
bors [Thu, 14 Jan 2016 15:37:07 +0000 (15:37 +0000)]
Auto merge of #30848 - nagisa:mir-no-store-zsts, r=nikomatsakis

Fixes #30831

r? @nikomatsakis

8 years agoRequire stability annotations on fields of tuple variants
Vadim Petrochenkov [Thu, 14 Jan 2016 14:08:35 +0000 (17:08 +0300)]
Require stability annotations on fields of tuple variants

8 years agoUTF-8 validation: Add missing if conditional for short input
Ulrik Sverdrup [Tue, 12 Jan 2016 22:04:46 +0000 (23:04 +0100)]
UTF-8 validation: Add missing if conditional for short input

We need to guard that `len` is large enough for the fast skip loop.

8 years agoAuto merge of #30897 - Manishearth:rollup, r=Manishearth
bors [Thu, 14 Jan 2016 13:42:59 +0000 (13:42 +0000)]
Auto merge of #30897 - Manishearth:rollup, r=Manishearth

- Successful merges: #30821, #30869, #30871, #30874, #30879, #30886, #30892
- Failed merges: #30864

8 years agoRollup merge of #30892 - shepmaster:box-grammar, r=alexcrichton
Manish Goregaokar [Thu, 14 Jan 2016 13:42:29 +0000 (19:12 +0530)]
Rollup merge of #30892 - shepmaster:box-grammar, r=alexcrichton

8 years agoRollup merge of #30886 - ollie27:docs_links, r=steveklabnik
Manish Goregaokar [Thu, 14 Jan 2016 13:42:29 +0000 (19:12 +0530)]
Rollup merge of #30886 - ollie27:docs_links, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #30879 - durka:collections-range-tracking-issue, r=nagisa
Manish Goregaokar [Thu, 14 Jan 2016 13:42:29 +0000 (19:12 +0530)]
Rollup merge of #30879 - durka:collections-range-tracking-issue, r=nagisa

see #27711 and #30877

r? @alexcrichton

8 years agoRollup merge of #30874 - dhuseby:fixing_bitrig_tests, r=alexcrichton
Manish Goregaokar [Thu, 14 Jan 2016 13:42:28 +0000 (19:12 +0530)]
Rollup merge of #30874 - dhuseby:fixing_bitrig_tests, r=alexcrichton

fixes the failing bitrig unit tests.

8 years agoRollup merge of #30871 - oli-obk:fix/reference, r=steveklabnik
Manish Goregaokar [Thu, 14 Jan 2016 13:42:28 +0000 (19:12 +0530)]
Rollup merge of #30871 - oli-obk:fix/reference, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #30869 - D101101:patch-3, r=huonw
Manish Goregaokar [Thu, 14 Jan 2016 13:42:28 +0000 (19:12 +0530)]
Rollup merge of #30869 - D101101:patch-3, r=huonw

r? @steveklabnik

8 years agoRollup merge of #30821 - steveklabnik:gh30819, r=nikomatsakis
Manish Goregaokar [Thu, 14 Jan 2016 13:42:28 +0000 (19:12 +0530)]
Rollup merge of #30821 - steveklabnik:gh30819, r=nikomatsakis

Fixes #30819

8 years agoFix note about B-prefixed issue labels
Greg Chapple [Thu, 14 Jan 2016 10:47:04 +0000 (10:47 +0000)]
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

8 years agoAuto merge of #30883 - Manishearth:rollup, r=Manishearth
bors [Thu, 14 Jan 2016 06:45:26 +0000 (06:45 +0000)]
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:

8 years agoRollup merge of #30863 - jseyfried:no_rc, r=eddyb
Manish Goregaokar [Wed, 13 Jan 2016 22:52:20 +0000 (04:22 +0530)]
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`.
    }
}
```

8 years agoRollup merge of #30851 - jonas-schievink:unneeded-dropflags, r=pnkfelix
Manish Goregaokar [Wed, 13 Jan 2016 22:52:20 +0000 (04:22 +0530)]
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!

8 years agoRollup merge of #30850 - ranma42:cleanup-io, r=alexcrichton
Manish Goregaokar [Wed, 13 Jan 2016 22:52:20 +0000 (04:22 +0530)]
Rollup merge of #30850 - ranma42:cleanup-io, r=alexcrichton

In 8d90d3f36871a00023cc1f313f91e351c287ca15 `BufStream`, the only
consumer of `InternalBufWriter`, was removed. As implied by the name,
this type is private, hence it is currently dead code.

8 years agoRollup merge of #30839 - tomaka:debug-phantomdata, r=nikomatsakis
Manish Goregaokar [Wed, 13 Jan 2016 22:52:20 +0000 (04:22 +0530)]
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.

8 years agoRollup merge of #30837 - semarie:openbsd-libc, r=alexcrichton
Manish Goregaokar [Wed, 13 Jan 2016 22:52:19 +0000 (04:22 +0530)]
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

8 years agoRollup merge of #30835 - kraai:show-span, r=sanxiyn
Manish Goregaokar [Wed, 13 Jan 2016 22:52:19 +0000 (04:22 +0530)]
Rollup merge of #30835 - kraai:show-span, r=sanxiyn

I think this will fix #30656.

8 years agoRollup merge of #30828 - wheals:fix-dead-links, r=steveklabnik
Manish Goregaokar [Wed, 13 Jan 2016 22:52:19 +0000 (04:22 +0530)]
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.

8 years agoRollup merge of #30823 - pnkfelix:put-back-alloca-zeroing-for-issue-30530, r=dotdash
Manish Goregaokar [Wed, 13 Jan 2016 22:52:19 +0000 (04:22 +0530)]
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

8 years agoRollup merge of #30818 - sfackler:duration-hash, r=alexcrichton
Manish Goregaokar [Wed, 13 Jan 2016 22:52:19 +0000 (04:22 +0530)]
Rollup merge of #30818 - sfackler:duration-hash, r=alexcrichton

tikue pointed out in IRC that this was missing.

8 years agoRollup merge of #30801 - Amanieu:oom_print, r=alexcrichton
Manish Goregaokar [Wed, 13 Jan 2016 22:52:18 +0000 (04:22 +0530)]
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

8 years agoRollup merge of #30770 - steveklabnik:gh30345, r=brson
Manish Goregaokar [Wed, 13 Jan 2016 22:52:18 +0000 (04:22 +0530)]
Rollup merge of #30770 - steveklabnik:gh30345, r=brson

Fixes #30345

I'm not sure if there's anything else that belongs here. Thoughts?

8 years agoRollup merge of #30626 - steveklabnik:gh30618, r=luqmana
Manish Goregaokar [Wed, 13 Jan 2016 22:52:18 +0000 (04:22 +0530)]
Rollup merge of #30626 - steveklabnik:gh30618, r=luqmana

Fixes #30618

8 years agoAuto merge of #30662 - simartin:issue_30592, r=alexcrichton
bors [Thu, 14 Jan 2016 03:17:51 +0000 (03:17 +0000)]
Auto merge of #30662 - simartin:issue_30592, r=alexcrichton

Fixes https://github.com/rust-lang/rust/issues/30592, a fallout of https://github.com/rust-lang/rust/commit/cd1848a1a60f40f25019e455b1050efd69707604

8 years agoImprove grammar of Box::{into,from}_raw docs
Jake Goulding [Thu, 14 Jan 2016 02:23:07 +0000 (21:23 -0500)]
Improve grammar of Box::{into,from}_raw docs

8 years agoAuto merge of #30466 - alexcrichton:move-wrapping-and-fill-out, r=aturon
bors [Thu, 14 Jan 2016 01:26:54 +0000 (01:26 +0000)]
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

8 years agoFix some broken and missing links in the docs
Oliver Middleton [Wed, 13 Jan 2016 23:19:24 +0000 (23:19 +0000)]
Fix some broken and missing links in the docs

8 years agoAuto merge of #30870 - Eljay:issue-30477, r=alexcrichton
bors [Wed, 13 Jan 2016 22:27:46 +0000 (22:27 +0000)]
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

8 years agoimprove use of `,` vs `;`
Niko Matsakis [Wed, 13 Jan 2016 20:56:53 +0000 (15:56 -0500)]
improve use of `,` vs `;`

8 years agoAdd missing newline character to callers of dumb_print
Amanieu d'Antras [Sat, 9 Jan 2016 19:19:56 +0000 (19:19 +0000)]
Add missing newline character to callers of dumb_print

8 years agoAuto merge of #30813 - fhahn:fix-ice-semicolon-in-lifetime, r=nrc
bors [Wed, 13 Jan 2016 20:38:12 +0000 (20:38 +0000)]
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.

8 years agoIssue #30592: Restore build in --disable-jemalloc mode.
Simon Martin [Thu, 31 Dec 2015 17:13:39 +0000 (18:13 +0100)]
Issue #30592: Restore build in --disable-jemalloc mode.

8 years agoremoving the conditional compilation of the dynamic_lib reference
Dave Huseby [Wed, 13 Jan 2016 19:23:33 +0000 (11:23 -0800)]
removing the conditional compilation of the dynamic_lib reference

8 years agoFixes #30873
Dave Huseby [Wed, 13 Jan 2016 17:32:19 +0000 (09:32 -0800)]
Fixes #30873

8 years agoupdate tracking issue for collections_range
Alex Burka [Wed, 13 Jan 2016 18:50:41 +0000 (13:50 -0500)]
update tracking issue for collections_range

8 years agoAuto merge of #30509 - michaelsproul:string-box-error, r=alexcrichton
bors [Wed, 13 Jan 2016 18:46:29 +0000 (18:46 +0000)]
Auto merge of #30509 - michaelsproul:string-box-error, r=alexcrichton

Closes #30156.

8 years agoAuto merge of #30794 - joerg-krause:fix-arm-unknown-linux-gnueabi-float-abi, r=alexcr...
bors [Wed, 13 Jan 2016 16:57:01 +0000 (16:57 +0000)]
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.

8 years agos/HARD ERROR/hard error/ -- perhaps the warning is enough
Niko Matsakis [Wed, 13 Jan 2016 01:46:40 +0000 (20:46 -0500)]
s/HARD ERROR/hard error/ -- perhaps the warning is enough

8 years agoAuto merge of #30779 - michaelwoerister:closure-mir-in-metadata, r=nikomatsakis
bors [Wed, 13 Jan 2016 15:08:07 +0000 (15:08 +0000)]
Auto merge of #30779 - michaelwoerister:closure-mir-in-metadata, r=nikomatsakis

8 years agothe reference was inferring values that didn't fit into their target type
Oliver 'ker' Schneider [Mon, 28 Dec 2015 18:55:56 +0000 (19:55 +0100)]
the reference was inferring values that didn't fit into their target type

8 years agoadd doc for new `fn alloc_ty_init`.
Felix S. Klock II [Tue, 12 Jan 2016 16:24:00 +0000 (17:24 +0100)]
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.)

8 years agorevise lifetime handling for alloca's that are initialized as "dropped."
Felix S. Klock II [Tue, 12 Jan 2016 16:21:11 +0000 (17:21 +0100)]
revise lifetime handling for alloca's that are initialized as "dropped."

(This can/should be revisited when drop flags are stored out of band.)