]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertj
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:48 +0000 (12:17 +0200)]
Rollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertj

Document the -Z flag to the rustc book

# Description

Changes:
- Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book.

If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version.

closes #41142

5 years agoAuto merge of #59536 - Zoxc:the-arena, r=eddyb
bors [Fri, 12 Apr 2019 06:10:19 +0000 (06:10 +0000)]
Auto merge of #59536 - Zoxc:the-arena, r=eddyb

Introduce an arena type which may be used to allocate a list of types with destructors

You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena.

Based on https://github.com/rust-lang/rust/pull/59517 and https://github.com/rust-lang/rust/pull/59533. Look at the last commit for the interesting changes.

An alternative to https://github.com/rust-lang/rust/pull/56448. cc @michaelwoerister @eddyb

r? @oli-obk

5 years agoAuto merge of #59886 - mati865:musl_toolchain, r=alexcrichton
bors [Fri, 12 Apr 2019 02:24:16 +0000 (02:24 +0000)]
Auto merge of #59886 - mati865:musl_toolchain, r=alexcrichton

musl: do not compress debug section

This should be beta nominated.

Fixes https://github.com/rust-lang/rust/issues/59411 (this time for real).

Test with `DEPLOY=1 ./src/ci/docker/run.sh dist-x86_64-musl`, without `DEPLOY=1` libs are built without debuginfo.

r? @alexcrichton

5 years agoAuto merge of #59227 - Zoxc:fix-get, r=eddyb
bors [Thu, 11 Apr 2019 23:36:13 +0000 (23:36 +0000)]
Auto merge of #59227 - Zoxc:fix-get, r=eddyb

Fix lifetime on LocalInternedString::get function

cc @eddyb @nnethercote

5 years agomusl: do not compress debug section
Mateusz Mikuła [Thu, 11 Apr 2019 16:57:13 +0000 (18:57 +0200)]
musl: do not compress debug section

Old linkers are unable to decompress them and fail to link binaries

5 years agoAuto merge of #59780 - RalfJung:miri-unsized, r=oli-obk
bors [Thu, 11 Apr 2019 15:44:22 +0000 (15:44 +0000)]
Auto merge of #59780 - RalfJung:miri-unsized, r=oli-obk

Miri: unsized locals and by-value dyn traits

r? @oli-obk
Cc @eddyb

Fixes https://github.com/rust-lang/miri/issues/449

5 years agoAuto merge of #59211 - nox:refcell-borrow-state, r=KodrAus
bors [Thu, 11 Apr 2019 12:49:49 +0000 (12:49 +0000)]
Auto merge of #59211 - nox:refcell-borrow-state, r=KodrAus

Introduce RefCell::try_borrow_unguarded

*Come sit next to the fireplace with me, this is going to be a long story.*

So, you may already be aware that Servo has weird design constraints that forces us developers working on it to do weird things. The thing that interests us today is that we do layout on a separate thread with its own thread pool to do some things in parallel, whereas the data it uses comes from the script thread, which implements the entire DOM and related pieces, with `!Sync` data types such as `RefCell<T>`.

The invariant we maintain is that script does not do anything ever with the DOM data as long as layout is doing its job. That's all nice and all, but one thing we don't ensure is that we don't actually know if script was currently mutably borrowing some `RefCell<T>` prior to starting layout, which may lead to aliasing mutable memory and obviously undefined behaviour.

This PR reinstates `RefCell::borrow_state` so that [this method](https://github.com/servo/servo/blob/master/components/script/dom/bindings/cell.rs#L23-L30) can make use of it and return `None` if the cell was mutably borrowed.

Cc @SimonSapin

5 years agoAuto merge of #58972 - QuietMisdreavus:intra-doc-link-imports, r=GuillaumeGomez
bors [Thu, 11 Apr 2019 08:48:26 +0000 (08:48 +0000)]
Auto merge of #58972 - QuietMisdreavus:intra-doc-link-imports, r=GuillaumeGomez

rustdoc: don't process `Crate::external_traits` when collecting intra-doc links

Part of https://github.com/rust-lang/rust/issues/58745, closes https://github.com/rust-lang/rust/pull/58917

The `collect-intra-doc-links` pass keeps track of the modules it recurses through as it processes items. This is used to know what module to give the resolver when looking up links. When looking through the regular items of the crate, this works fine, but the `DocFolder` trait as written doesn't just process the main crate hierarchy - it also processes the trait items in the `external_traits` map. This is useful for other passes (so they can strip out `#[doc(hidden)]` items, for example), but here it creates a situation where we're processing items "outside" the regular module hierarchy. Since everything in `external_traits` is defined outside the current crate, we can't fall back to finding its module scope like we do with local items.

Skipping this collection saves us from emitting some spurious warnings. We don't even lose anything by skipping it, either - the docs loaded from here are only ever rendered through `html::render::document_short` which strips any links out, so the fact that the links haven't been loaded doesn't matter. Hopefully this removes most of the remaining spurious resolution warnings from intra-doc links.

r? @GuillaumeGomez

5 years agoAuto merge of #59799 - Zoxc:vs2019, r=alexcrichton
bors [Thu, 11 Apr 2019 05:56:11 +0000 (05:56 +0000)]
Auto merge of #59799 - Zoxc:vs2019, r=alexcrichton

Update cmake, cc and compiler_builtins for VS 2019 support

r? @alexcrichton

5 years agoUpdate Cargo.lock
John Kåre Alsaker [Wed, 10 Apr 2019 19:18:35 +0000 (21:18 +0200)]
Update Cargo.lock

5 years agoDon't build test helpers for wasm32
John Kåre Alsaker [Wed, 10 Apr 2019 08:23:09 +0000 (10:23 +0200)]
Don't build test helpers for wasm32

5 years agoDon't require a C compiler on wasm32
John Kåre Alsaker [Tue, 9 Apr 2019 14:29:50 +0000 (16:29 +0200)]
Don't require a C compiler on wasm32

5 years agoUpdate cmake, cc and compiler_builtins for VS 2019 support
John Kåre Alsaker [Sat, 6 Apr 2019 08:37:00 +0000 (10:37 +0200)]
Update cmake, cc and compiler_builtins for VS 2019 support

5 years agoAuto merge of #59810 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Wed, 10 Apr 2019 15:54:39 +0000 (15:54 +0000)]
Auto merge of #59810 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy, rls and miri

Let's give this another try.
r? @Manishearth
cc @Xanewok

5 years agoUpdated the description of -Z in the rustc book.
Christian [Wed, 10 Apr 2019 10:20:47 +0000 (12:20 +0200)]
Updated the description of -Z in the rustc book.

5 years agoUpdated the documentation, now claiming the -Z is associated to unstable compiler...
Christian [Wed, 10 Apr 2019 10:10:25 +0000 (12:10 +0200)]
Updated the documentation, now claiming the -Z is associated to unstable compiler flags, instead of flags for debugging.

5 years agoRemove useless ?Sized bound
John Kåre Alsaker [Wed, 10 Apr 2019 01:58:13 +0000 (03:58 +0200)]
Remove useless ?Sized bound

5 years agoFix a typo
John Kåre Alsaker [Tue, 9 Apr 2019 15:07:36 +0000 (17:07 +0200)]
Fix a typo

5 years agoupdate Cargo.lock
Matthias Krüger [Tue, 9 Apr 2019 08:50:08 +0000 (10:50 +0200)]
update Cargo.lock

5 years agosubmodules: update rls from 90f7ab0 to 49efc06
Matthias Krüger [Tue, 9 Apr 2019 08:49:44 +0000 (10:49 +0200)]
submodules: update rls from 90f7ab0 to 49efc06

Changes:
````
Account for changed format range in a test
Adapt format integration test to use new range
Add unit tests for Rustfmt::calc_text_edits
Prefer saturating_sub
Return only partial text edits on formatting request
Redo errors in format.rs
Rephrase unstable features helper function
Work around Rustfmt bug
Adjust range-formatting test
Update Rustfmt to 1.2
Allow unstable features under "dev" channel
Updated clippy_lints in to rev c81e43b92c83bca75337ac26a296b909a6a98ab1 to fix build breaking
Fix lint pass API changes
Remove a redundant import
Bump Clippy
Add more helpful compiler messages when the features are improperly specified
Silence some flaky tests.
Update Cargo.
Rename read_analysis to decode_buf
Update Clippy
Fix pointer to pointer silliness
Add serde implementation to complement rustc-serialize
````

5 years agosubmodules: update miri from 0e4f963 to 28f2e5b
Matthias Krüger [Tue, 9 Apr 2019 08:49:39 +0000 (10:49 +0200)]
submodules: update miri from 0e4f963 to 28f2e5b

Changes:
````
Update src/fn_call.rs
Fix calloc test
Add calloc test
Tidy up calloc code
Update compiletest
Fix tagging order
Add `calloc`
rename MIRI_TARGET -> MIRI_COMPILETEST_TARGET to clarify that this affects compiletest only
compiletest can just propagate MIRI_SYSROOT from the outside
````

5 years agosubmodules: update clippy from 92612c9d to 37f5c1ec
Matthias Krüger [Tue, 9 Apr 2019 08:49:33 +0000 (10:49 +0200)]
submodules: update clippy from 92612c9d to 37f5c1ec

Changes:
````
Remove force-host and explain no-prefer-dynamic
Escape a single quote in single_char_pattern hint
cargo fmt
Re-add tmp feature to compiletest
Remove libtest from deps
Re-allow clippy::identity_conversion in compiletest
Use latest compiletest-rs
Revert tests/compile-test.rs to 61aa5c957c219abe1fb2d1b5e51db8b365b4f565
Fix ICE in suspicious_else_formatting
use a multispan for MANY_SINGLE_CHAR_NAMES
Add missing `// run-pass` annotations to ICE tests
Remove clippy_dev as dev-dependency
NFC: fix typos
rustup https://github.com/rust-lang/rust/pull/59657
Add TransmutingNull Lint * Late Lint pass, catches:   * One liner: 0 -> null -> transmute   * One liner: std:null() -> transmute   * Const (which resolves to null) -> transmute * UI Test case for Lint * Updated test for issue 3849, because now the lint that code generated is in Clippy. * Expanded `const.rs` miri-based Constant Folding code, to cover   raw pointers
Run rustfmt
Set level of identity_conversion FP to warn
Rustup to https://github.com/rust-lang/rust/pull/58805
rustup 41316f0449025394fdca6606d3fdb3b8f37a9872
Updated source to match with recent rustc `master` toolchain changes
Fix dogfood error of question_mark lint fix
Fix question_mark lint+test
use `span_lint_and_sugg` in `explicit_counter_loop`
Fix some test failures
Hacky rustup
run cargo fmt
rustup https://github.com/rust-lang/rust/pull/59096/
Change explicit_counter_loop's message to add parentheses if necessary
Change explicit_counter_loop's message to reflect original variable name
cargo fmt
Add rustfix tests for mistyped_literal_suffix lint
Move some `unreadable_literal` ui tests to correct file
Add implementation for the EarlyLintPass trait into the Adding Lints documentation.
Add rust-toolchain for clippy_dev
````

5 years agoavoid reading from ZST locals
Ralf Jung [Mon, 8 Apr 2019 11:28:51 +0000 (13:28 +0200)]
avoid reading from ZST locals

5 years agoApply suggestions from code review
Ralf Jung [Mon, 8 Apr 2019 08:29:22 +0000 (10:29 +0200)]
Apply suggestions from code review

typos

Co-Authored-By: RalfJung <post@ralfj.de>
5 years agoAuto merge of #59724 - oli-obk:const_arg_ice, r=eddyb
bors [Mon, 8 Apr 2019 01:18:12 +0000 (01:18 +0000)]
Auto merge of #59724 - oli-obk:const_arg_ice, r=eddyb

Function arguments should never get promoted

fixes https://github.com/rust-lang/rust/issues/59469

5 years agoOnly run SIMD tests on x86
Oliver Scherer [Sun, 7 Apr 2019 19:46:39 +0000 (21:46 +0200)]
Only run SIMD tests on x86

5 years agoAuto merge of #59765 - lzutao:patch-1, r=Centril
bors [Sun, 7 Apr 2019 18:06:01 +0000 (18:06 +0000)]
Auto merge of #59765 - lzutao:patch-1, r=Centril

Add reference to cfg attr

r? @QuietMisdreavus

5 years agoimplement by-value object safety
Ralf Jung [Sun, 7 Apr 2019 17:54:43 +0000 (19:54 +0200)]
implement by-value object safety

5 years agoinitialize unsized locals when copying to the for the first time
Ralf Jung [Sun, 7 Apr 2019 17:54:29 +0000 (19:54 +0200)]
initialize unsized locals when copying to the for the first time

5 years agoAuto merge of #59766 - xales:revertlibtest, r=Manishearth
bors [Sun, 7 Apr 2019 15:23:49 +0000 (15:23 +0000)]
Auto merge of #59766 - xales:revertlibtest, r=Manishearth

Revert "Auto merge of #57842 - gnzlbg:extract_libtest, r=gnzlbg"

This reverts commit 3eb4890dfe6db0279fdd3cda19f9643873ae3db9, reversing
changes made to 7a4df3b53da369110984a2b57419c05a53e33b38.

This is, as best I can tell, a clean revert of #57842. It retains some interim changes, like moving `black_box`, and otherwise brings libtest back in as it was before removal.

5 years agoAuto merge of #59770 - pietroalbini:pin-android-emulator, r=kennytm
bors [Sun, 7 Apr 2019 12:33:01 +0000 (12:33 +0000)]
Auto merge of #59770 - pietroalbini:pin-android-emulator, r=kennytm

ci: pin android emulator to 28.0.23

Apparently Android Emulator 28.0.25 (the latest one) is broken for us, and `sdkmanager` doesn't have a way to pin a package to a specific version. This PR stops downloading the emulator from `sdkmanager`, downloading it manually instead.

Tested this locally and confirmed it works. I'll open an issue on Google's issue tracker later today.

Fixes https://github.com/rust-lang/rust/issues/59757
r? @kennytm

5 years agoci: pin android emulator to 28.0.23
Pietro Albini [Sun, 7 Apr 2019 11:52:33 +0000 (13:52 +0200)]
ci: pin android emulator to 28.0.23

5 years agofix miri engine debug output for uninitialized locals
Ralf Jung [Sun, 7 Apr 2019 10:52:56 +0000 (12:52 +0200)]
fix miri engine debug output for uninitialized locals

5 years agomake StorageLive lazy as well
Ralf Jung [Sun, 7 Apr 2019 10:27:48 +0000 (12:27 +0200)]
make StorageLive lazy as well

5 years agoAuto merge of #59119 - cramertj:cx-back, r=withoutboats
bors [Sun, 7 Apr 2019 09:48:12 +0000 (09:48 +0000)]
Auto merge of #59119 - cramertj:cx-back, r=withoutboats

Future-proof the Futures API

cc https://github.com/rust-lang/rust/issues/59113, @carllerche, @rust-lang/libs

r? @withoutboats

5 years agoRevert "Auto merge of #57842 - gnzlbg:extract_libtest, r=gnzlbg"
Jacob Greenfield [Sun, 7 Apr 2019 05:48:59 +0000 (01:48 -0400)]
Revert "Auto merge of #57842 - gnzlbg:extract_libtest, r=gnzlbg"

This reverts commit 3eb4890dfe6db0279fdd3cda19f9643873ae3db9, reversing
changes made to 7a4df3b53da369110984a2b57419c05a53e33b38.

5 years agoUpdate comment
Oliver Scherer [Fri, 5 Apr 2019 15:00:21 +0000 (17:00 +0200)]
Update comment

5 years agoAdd more regression tests for accidental promotion
Oliver Scherer [Fri, 5 Apr 2019 11:56:52 +0000 (13:56 +0200)]
Add more regression tests for accidental promotion

5 years agoFunction arguments should never get promoted
Oliver Scherer [Fri, 5 Apr 2019 11:53:43 +0000 (13:53 +0200)]
Function arguments should never get promoted

5 years agoAdd reference to cfg attr
lzutao [Sun, 7 Apr 2019 04:48:14 +0000 (11:48 +0700)]
Add reference to cfg attr

5 years agoAuto merge of #58739 - matthewjasper:more-restrictive-tpb, r=pnkfelix
bors [Sun, 7 Apr 2019 00:57:13 +0000 (00:57 +0000)]
Auto merge of #58739 - matthewjasper:more-restrictive-tpb, r=pnkfelix

More restrictive 2 phase borrows - take 2

Signal lint diagnostic `mutable_borrow_reservation_conflict` when borrow-check finds a 2-phase borrow's reservation overlapping with a shared borrow.

(pnkfelix updated description)

cc #56254 , #59159

blocks PR #59114

r? @pnkfelix

cc @RalfJung @nikomatsakis

5 years agomiri engine: lazily allocate memory for locals on first write
Ralf Jung [Sat, 6 Apr 2019 21:58:59 +0000 (23:58 +0200)]
miri engine: lazily allocate memory for locals on first write

5 years agoAuto merge of #59760 - Centril:rollup-4b9x7ue, r=Centril
bors [Sat, 6 Apr 2019 21:34:12 +0000 (21:34 +0000)]
Auto merge of #59760 - Centril:rollup-4b9x7ue, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #59738 (Move match_path from DefId to lint::LateContext)
 - #59740 (Use for_each to extend collections)
 - #59751 (Tiny docs fix)
 - #59754 (Update books)
 - #59755 (Update miri)

Failed merges:

r? @ghost

5 years agoRollup merge of #59755 - matthewjasper:update-miri, r=RalfJung
Mazdak Farrokhzad [Sat, 6 Apr 2019 20:52:49 +0000 (22:52 +0200)]
Rollup merge of #59755 - matthewjasper:update-miri, r=RalfJung

Update miri

r? @RalfJung

5 years agoRollup merge of #59754 - ehuss:update-books, r=frewsxcv
Mazdak Farrokhzad [Sat, 6 Apr 2019 20:52:48 +0000 (22:52 +0200)]
Rollup merge of #59754 - ehuss:update-books, r=frewsxcv

Update books

## nomicon

1 commits in f1ff93b66844493a7b03101c7df66ac958c62418..c02e0e7754a76886e55b976a3a4fac20100cd35d
2019-02-26 13:37:28 -0500 to 2019-03-25 16:52:56 -0400
- dropck: The drop order is now defined (rust-lang-nursery/nomicon#113)

## reference

3 commits in 27ad493a10364e907ec476e2ad61e8a1614b57e1..98f90ff4de8e588f651f0fb493b5c7496551cd59
2019-03-26 02:06:15 +0100 to 2019-04-06 09:29:08 -0700
- Document repr packed(N). (rust-lang-nursery/reference#553)
- Fix broken link in glossary. (rust-lang-nursery/reference#558)
- Typo fixes (rust-lang-nursery/reference#556)

## embedded-book

2 commits in 07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a..7989c723607ef5b13b57208022259e6c771e11d0
2019-03-27 15:40:52 +0000 to 2019-04-04 12:14:37 +0000
- fix rust-embedded/book#182  (rust-embedded/book#183)
- Add openocd to list of installable packages  (rust-embedded/book#179)

5 years agoRollup merge of #59751 - tbu-:pr_doc_fix_format, r=Centril
Mazdak Farrokhzad [Sat, 6 Apr 2019 20:52:47 +0000 (22:52 +0200)]
Rollup merge of #59751 - tbu-:pr_doc_fix_format, r=Centril

Tiny docs fix

5 years agoRollup merge of #59740 - cuviper:folded-extend, r=scottmcm
Mazdak Farrokhzad [Sat, 6 Apr 2019 20:52:46 +0000 (22:52 +0200)]
Rollup merge of #59740 - cuviper:folded-extend, r=scottmcm

Use for_each to extend collections

This updates the `Extend` implementations to use `for_each` for many
collections: `BinaryHeap`, `BTreeMap`, `BTreeSet`, `LinkedList`, `Path`,
`TokenStream`, `VecDeque`, and `Wtf8Buf`.

Folding with `for_each` enables better performance than a `for`-loop for
some iterators, especially if they can just forward to internal
iterators, like `Chain` and `FlatMap` do.

5 years agoRollup merge of #59738 - flip1995:match_path_move, r=eddyb,Manishearth
Mazdak Farrokhzad [Sat, 6 Apr 2019 20:52:45 +0000 (22:52 +0200)]
Rollup merge of #59738 - flip1995:match_path_move, r=eddyb,Manishearth

Move match_path from DefId to lint::LateContext

cc https://github.com/rust-lang/rust/pull/59316#discussion_r272351353

r? @eddyb

5 years agoUpdate miri
Matthew Jasper [Sat, 6 Apr 2019 17:34:06 +0000 (18:34 +0100)]
Update miri

5 years agoUpdate books
Eric Huss [Sat, 6 Apr 2019 17:06:51 +0000 (10:06 -0700)]
Update books

5 years agoTiny docs fix
Tobias Bucher [Sat, 6 Apr 2019 15:27:00 +0000 (17:27 +0200)]
Tiny docs fix

5 years agoAuto merge of #59710 - alexcrichton:llvm-9-compat, r=sanxiyn
bors [Sat, 6 Apr 2019 13:14:23 +0000 (13:14 +0000)]
Auto merge of #59710 - alexcrichton:llvm-9-compat, r=sanxiyn

rustc: Start implementing compat with LLVM 9

This commit doesn't actually migrate to LLVM 9, but it brings our own
C++ bindings in line with LLVM 9 and able to compile against tip of
tree. The changes made were:

* The `MainSubprogram` flag for debuginfo moved between flag types.
* Iteration of archive members was tweaked slightly and we have to
  construct the two iterators before constructing the returned
  `RustArchiveIterator` value.
* The `getOrInsertFunction` binding now returns a wrapper which we use
  `getCallee()` on to get the value we're interested in.

5 years agoAuto merge of #59745 - cwhakes:master, r=sanxiyn
bors [Sat, 6 Apr 2019 10:03:38 +0000 (10:03 +0000)]
Auto merge of #59745 - cwhakes:master, r=sanxiyn

Change `copytest` parameter name from `y` to `sign`

This should help clarify ambiguity with whether `a.copysign(b)` applies the sign of `a` to `b` or `b` to `a`.

r? @Centril

5 years agoAuto merge of #59744 - cuviper:output-errors, r=sanxiyn
bors [Sat, 6 Apr 2019 07:21:41 +0000 (07:21 +0000)]
Auto merge of #59744 - cuviper:output-errors, r=sanxiyn

Show better errors for LLVM IR output

I was trying to output LLVM IR directly to the console:

    $ rustc hello.rs --emit=llvm-ir -o /dev/stdout
    LLVM ERROR: IO failure on output stream: Bad file descriptor

Now `LLVMRustPrintModule` returns an error, and we print:

    error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied

... which is more informative.

5 years agoAuto merge of #59723 - Zoxc:rem-noforce, r=michaelwoerister
bors [Sat, 6 Apr 2019 04:14:13 +0000 (04:14 +0000)]
Auto merge of #59723 - Zoxc:rem-noforce, r=michaelwoerister

Remove no_force from coherent_trait

r? @michaelwoerister

5 years agoChange `copytest` parameter name from `y` to `sign`
Will Hakes [Sat, 6 Apr 2019 02:30:45 +0000 (20:30 -0600)]
Change `copytest` parameter name from `y` to `sign`

5 years agoShow better errors for LLVM IR output
Josh Stone [Sat, 6 Apr 2019 00:48:23 +0000 (17:48 -0700)]
Show better errors for LLVM IR output

I was trying to output LLVM IR directly to the console:

    $ rustc hello.rs --emit=llvm-ir -o /dev/stdout
    LLVM ERROR: IO failure on output stream: Bad file descriptor

Now `LLVMRustPrintModule` returns an error, and we print:

    error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied

... which is more informative.

5 years agoAuto merge of #59741 - Centril:rollup-3us4b8q, r=Centril
bors [Fri, 5 Apr 2019 22:56:15 +0000 (22:56 +0000)]
Auto merge of #59741 - Centril:rollup-3us4b8q, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #58894 (Fix invalid bounds string generation in rustdoc)
 - #59599 (Updated RELEASES.md for 1.34.0)
 - #59624 (SGX target: Use linker option to avoid code CGU assignment kludge)
 - #59696 (Remove invalid assertion back::link::from add_upstream_rust_crates().)
 - #59707 (Add missing tryfrom example)
 - #59727 (wasi: Use shared API for preopened fds)

Failed merges:

r? @ghost

5 years agoRollup merge of #59727 - alexcrichton:wasi-apis, r=fitzgen
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:47 +0000 (00:14 +0200)]
Rollup merge of #59727 - alexcrichton:wasi-apis, r=fitzgen

wasi: Use shared API for preopened fds

This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The `open_parent` function in
the wasi `fs` module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

5 years agoRollup merge of #59707 - GuillaumeGomez:GuillaumeGomez-patch-1, r=Centril
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:46 +0000 (00:14 +0200)]
Rollup merge of #59707 - GuillaumeGomez:GuillaumeGomez-patch-1, r=Centril

Add missing tryfrom example

r? @rust-lang/docs

5 years agoRollup merge of #59696 - michaelwoerister:fix-issue-59137, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:44 +0000 (00:14 +0200)]
Rollup merge of #59696 - michaelwoerister:fix-issue-59137, r=alexcrichton

Remove invalid assertion back::link::from add_upstream_rust_crates().

This removes a misplaced assertion. The function containing the assertion is actually only ever called for upstream crates that are not considered for LTO, so we don't care whether upstream code has been merged in by LTO or not.

Fixes #59137

r? @alexcrichton

5 years agoRollup merge of #59624 - jethrogb:jb/sgx-unwind-syms, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:43 +0000 (00:14 +0200)]
Rollup merge of #59624 - jethrogb:jb/sgx-unwind-syms, r=alexcrichton

SGX target: Use linker option to avoid code CGU assignment kludge

cc @VardhanThigle @faern

5 years agoRollup merge of #59599 - XAMPPRocky:master, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:41 +0000 (00:14 +0200)]
Rollup merge of #59599 - XAMPPRocky:master, r=Mark-Simulacrum

Updated RELEASES.md for 1.34.0

[Rendered](https://github.com/XAMPPRocky/rust/blob/master/RELEASES.md)

This also corrects an omission in the previous 1.33.0 release.

r? @Mark-Simulacrum

cc @rust-lang/release

5 years agoRollup merge of #58894 - GuillaumeGomez:invalid-lifetime-bounds, r=estebank
Mazdak Farrokhzad [Fri, 5 Apr 2019 22:14:40 +0000 (00:14 +0200)]
Rollup merge of #58894 - GuillaumeGomez:invalid-lifetime-bounds, r=estebank

Fix invalid bounds string generation in rustdoc

Fixes #58737.

Very weird and I'm not sure this is the best fix around. However, trying to fix it beforehand seems overly complicated compared to the gain (in `clean`, it wouldn't change anything since we **have to** return something so that wouldn't work, and in `hir`, I'm afraid I'd break something else for very little gain).

Also, I wasn't able to make a small code to reproduce the issue. The only way to test is to document `crossbeam` directly and check the `Scope` struct...

r? @QuietMisdreavus

5 years agoFuture-proof the Futures API
Taylor Cramer [Mon, 11 Mar 2019 23:56:00 +0000 (16:56 -0700)]
Future-proof the Futures API

5 years agoUse for_each to extend collections
Josh Stone [Fri, 5 Apr 2019 21:51:07 +0000 (14:51 -0700)]
Use for_each to extend collections

This updates the `Extend` implementations to use `for_each` for many
collections: `BinaryHeap`, `BTreeMap`, `BTreeSet`, `LinkedList`, `Path`,
`TokenStream`, `VecDeque`, and `Wtf8Buf`.

Folding with `for_each` enables better performance than a `for`-loop for
some iterators, especially if they can just forward to internal
iterators, like `Chain` and `FlatMap` do.

5 years agoMove match_path from DefId to lint::LateContext
flip1995 [Fri, 5 Apr 2019 21:04:56 +0000 (23:04 +0200)]
Move match_path from DefId to lint::LateContext

5 years agoAuto merge of #59500 - crlf0710:boxed-closure-impls, r=cramertj
bors [Fri, 5 Apr 2019 17:45:43 +0000 (17:45 +0000)]
Auto merge of #59500 - crlf0710:boxed-closure-impls, r=cramertj

Unsized rvalues: implement boxed closure impls. (2nd try)

This is a rebase of S-blocked-closed PR #55431 to current master. LLVM has moved forward since then, so maybe we can check whether the new LLVM 8.0 version unblocked this work.

5 years agoUpdate RELEASES.md
Mazdak Farrokhzad [Fri, 5 Apr 2019 17:38:24 +0000 (19:38 +0200)]
Update RELEASES.md

Co-Authored-By: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
5 years agowasi: Use shared API for preopened fds
Alex Crichton [Fri, 5 Apr 2019 13:37:03 +0000 (06:37 -0700)]
wasi: Use shared API for preopened fds

This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The `open_parent` function in
the wasi `fs` module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

5 years agoAdd missing tryfrom example
Guillaume Gomez [Fri, 29 Mar 2019 22:22:11 +0000 (23:22 +0100)]
Add missing tryfrom example

5 years agorustc: Start implementing compat with LLVM 9
Alex Crichton [Thu, 4 Apr 2019 20:05:41 +0000 (13:05 -0700)]
rustc: Start implementing compat with LLVM 9

This commit doesn't actually migrate to LLVM 9, but it brings our own
C++ bindings in line with LLVM 9 and able to compile against tip of
tree. The changes made were:

* The `MainSubprogram` flag for debuginfo moved between flag types.
* Iteration of archive members was tweaked slightly and we have to
  construct the two iterators before constructing the returned
  `RustArchiveIterator` value.
* The `getOrInsertFunction` binding now returns a wrapper which we use
  `getCallee()` on to get the value we're interested in.

5 years agoAuto merge of #59076 - dtolnay:comma, r=alexcrichton
bors [Fri, 5 Apr 2019 15:01:07 +0000 (15:01 +0000)]
Auto merge of #59076 - dtolnay:comma, r=alexcrichton

Include trailing comma in multiline Debug representation

This PR changes the behavior of [`Formatter::debug_struct`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_struct), [`debug_tuple`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_tuple), [`debug_list`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_list), [`debug_set`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_set), and [`debug_map`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_map) to render trailing commas in `{:#?}` mode, which is the dominant style in modern Rust code.

#### Before:

```console
Language {
    name: "Rust",
    trailing_commas: false
}
```

#### After:

```console
Language {
    name: "Rust",
    trailing_commas: true,
}
```

5 years agoInclude trailing comma in multiline Debug representation
David Tolnay [Wed, 3 Apr 2019 14:30:08 +0000 (07:30 -0700)]
Include trailing comma in multiline Debug representation

This commit changes the behavior of Formatter::debug_struct,
debug_tuple, debug_list, debug_set, and debug_map to render trailing
commas in {:#?} mode, which is the dominant style in modern Rust code.

Before:

    Language {
        name: "Rust",
        trailing_commas: false
    }

After:

    Language {
        name: "Rust",
        trailing_commas: true,
    }

5 years agoAuto merge of #59721 - Centril:rollup-ieam9ke, r=Centril
bors [Fri, 5 Apr 2019 12:13:52 +0000 (12:13 +0000)]
Auto merge of #59721 - Centril:rollup-ieam9ke, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #59665 (improve worst-case performance of HashSet.is_subset)
 - #59687 (cleanup shebang handling in the lexer)
 - #59690 (Mark unix::ffi::OsStrExt methods as inline)
 - #59702 (Use declare_lint_pass! and impl_lint_pass! in more places)
 - #59712 (wasm32: Default to a "static" relocation model)

Failed merges:

r? @ghost

5 years agoRemove no_force from coherent_trait
John Kåre Alsaker [Fri, 5 Apr 2019 11:25:24 +0000 (13:25 +0200)]
Remove no_force from coherent_trait

5 years agoRollup merge of #59712 - alexcrichton:wasm-static-not-pic, r=eddyb
Mazdak Farrokhzad [Fri, 5 Apr 2019 10:46:53 +0000 (12:46 +0200)]
Rollup merge of #59712 - alexcrichton:wasm-static-not-pic, r=eddyb

wasm32: Default to a "static" relocation model

LLVM 9 is adding support for a "pic" relocation model for wasm code,
which is quite different than the current model. In order to preserve
the mode of compilation that we have today default to "static" to ensure
that we don't accidentally start creating experimental relocatable
binaries.

5 years agoRollup merge of #59702 - hgallagher1993:origin, r=Centril
Mazdak Farrokhzad [Fri, 5 Apr 2019 10:46:52 +0000 (12:46 +0200)]
Rollup merge of #59702 - hgallagher1993:origin, r=Centril

Use declare_lint_pass! and impl_lint_pass! in more places

Fixes #59683

5 years agoRollup merge of #59690 - xfix:patch-17, r=cramertj
Mazdak Farrokhzad [Fri, 5 Apr 2019 10:46:51 +0000 (12:46 +0200)]
Rollup merge of #59690 - xfix:patch-17, r=cramertj

Mark unix::ffi::OsStrExt methods as inline

This is a small change, but I found it surprising it's not inlined looking at the assembly.

5 years agoRollup merge of #59687 - matklad:shebang, r=petrochenkov
Mazdak Farrokhzad [Fri, 5 Apr 2019 10:46:49 +0000 (12:46 +0200)]
Rollup merge of #59687 - matklad:shebang, r=petrochenkov

cleanup shebang handling in the lexer

5 years agoRollup merge of #59665 - ssomers:hashset_revisited, r=KodrAus
Mazdak Farrokhzad [Fri, 5 Apr 2019 10:46:48 +0000 (12:46 +0200)]
Rollup merge of #59665 - ssomers:hashset_revisited, r=KodrAus

improve worst-case performance of HashSet.is_subset

One more simple optimization opportunity for HashSet that was applied in BTreeSet in #59186 (and wasn't in #57043). Already covered by the existing unit test.

r? @KodrAus

5 years agoAdd regression test for #59137.
Michael Woerister [Fri, 5 Apr 2019 09:32:45 +0000 (11:32 +0200)]
Add regression test for #59137.

5 years agoAuto merge of #59681 - dtolnay:cargo, r=alexcrichton
bors [Fri, 5 Apr 2019 09:30:13 +0000 (09:30 +0000)]
Auto merge of #59681 - dtolnay:cargo, r=alexcrichton

Update cargo

20 commits in
63231f438a2b5b84ccf319a5de22343ee0316323..6f3e9c367abb497c64f360c3839dab5e74928d5c
2019-03-27 12:26:45 +0000 to 2019-04-04 14:11:33 +0000
- Fix Init for Fossil SCM project (rust-lang/cargo#6792)
- Fix member_manifest_version_error accessing the network (rust-lang/cargo#6799)
- Don't include email if it is empty (rust-lang/cargo#6802)
- Fix unused import warning (rust-lang/cargo#6807)
- Add some help and documentation for unstable flags (rust-lang/cargo#6791)
- Allow `cargo doc --open` with multiple packages (rust-lang/cargo#6803)
- Allow `cargo install --path P` to load config from P (rust-lang/cargo#6804)
- Add more suggestions on how to deal with excluding a package from a workspace (rust-lang/cargo#6805)
- Warn on version req with metadata (rust-lang/cargo#6806)
- cargo install: Be more restrictive about cli flags (rust-lang/cargo#6801)
- Support force-pushed repos with git-fetch-with-cli (rust-lang/cargo#6800)
- Cargo clippy (rust-lang/cargo#6759)
- Don't include metadata in wasm binary examples (rust-lang/cargo#6812)
- Update glossary for `feature` (rust-lang/cargo#6809)
- Include proc-macros in `build-override` (rust-lang/cargo#6811)
- Resolver: A dep is equivalent to one of the things it can resolve to (rust-lang/cargo#6776)
- Add some docs for `Downloads` (rust-lang/cargo#6815)
- Resolve: Be less strict while offline (rust-lang/cargo#6814)
- Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)
- Fix doc link (rust-lang/cargo#6820)

<br>

I specifically care about "Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)" to unblock https://github.com/rust-lang/rust/pull/59076.

Mentioning @ehuss.

5 years agoFix expectations on some ui test in nll compare mode.
Charles Lew [Fri, 5 Apr 2019 04:06:29 +0000 (12:06 +0800)]
Fix expectations on some ui test in nll compare mode.

5 years agoAuto merge of #59643 - alexcrichton:wasi-symbols, r=sanxiyn
bors [Fri, 5 Apr 2019 05:16:45 +0000 (05:16 +0000)]
Auto merge of #59643 - alexcrichton:wasi-symbols, r=sanxiyn

std: Upgrade `compiler_builtins` to fix wasi linkage

Turns out we needed to exclude a number of math functions on the
`wasm32-unknown-wasi` target, and this was fixed in 0.1.9 of
compiler-builtins and this is pulling in the fix to libstd's own build.

5 years agoAuto merge of #59704 - alexcrichton:fix-freebsd, r=pietroalbini
bors [Fri, 5 Apr 2019 02:32:20 +0000 (02:32 +0000)]
Auto merge of #59704 - alexcrichton:fix-freebsd, r=pietroalbini

ci: Update FreeBSD tarball downloads

These appear to have disappeared from the original server, so I acquired
the contents from a different mirror and uploaded them to our S3 bucket

5 years agoAdd DropArena and use it to allocate types with few allocations
John Kåre Alsaker [Sat, 30 Mar 2019 19:15:11 +0000 (20:15 +0100)]
Add DropArena and use it to allocate types with few allocations

5 years agoImpl UseSpecializedDecodable for &T
John Kåre Alsaker [Sat, 30 Mar 2019 00:53:11 +0000 (01:53 +0100)]
Impl UseSpecializedDecodable for &T

5 years agoMake ArenaAllocatable a marker trait to allow overlapping impls and use specializatio...
John Kåre Alsaker [Sat, 30 Mar 2019 00:36:51 +0000 (01:36 +0100)]
Make ArenaAllocatable a marker trait to allow overlapping impls and use specialization to find the right field

5 years agoIntroduce an arena type which may be used to allocate a list of types with destructors
John Kåre Alsaker [Fri, 29 Mar 2019 16:49:11 +0000 (17:49 +0100)]
Introduce an arena type which may be used to allocate a list of types with destructors

5 years agowasm32: Default to a "static" relocation model
Alex Crichton [Thu, 4 Apr 2019 20:23:42 +0000 (13:23 -0700)]
wasm32: Default to a "static" relocation model

LLVM 9 is adding support for a "pic" relocation model for wasm code,
which is quite different than the current model. In order to preserve
the mode of compilation that we have today default to "static" to ensure
that we don't accidentally start creating experimental relocatable
binaries.

5 years agoci: Update FreeBSD tarball downloads
Alex Crichton [Thu, 4 Apr 2019 18:40:21 +0000 (11:40 -0700)]
ci: Update FreeBSD tarball downloads

These appear to have disappeared from the original server, so I acquired
the contents from a different mirror and uploaded them to our S3 bucket

5 years agoAdd ignore to doc code
Masaki Hara [Mon, 11 Feb 2019 07:32:42 +0000 (16:32 +0900)]
Add ignore to doc code

5 years agoSimplify fnbox docs.
Masaki Hara [Mon, 11 Feb 2019 02:09:41 +0000 (11:09 +0900)]
Simplify fnbox docs.

5 years agoStabilize boxed_closure_impls in 1.35.0.
Charles Lew [Mon, 11 Feb 2019 02:09:26 +0000 (11:09 +0900)]
Stabilize boxed_closure_impls in 1.35.0.

5 years agoRemove FnBox specialization of impl FnOnce for Box<impl FnOnce>.
Masaki Hara [Mon, 11 Feb 2019 01:34:24 +0000 (10:34 +0900)]
Remove FnBox specialization of impl FnOnce for Box<impl FnOnce>.

5 years agoWe already have unsized_locals in stage0.
Masaki Hara [Sun, 10 Feb 2019 10:25:56 +0000 (19:25 +0900)]
We already have unsized_locals in stage0.

5 years agoFix failing tests.
Masaki Hara [Sun, 3 Feb 2019 13:08:34 +0000 (22:08 +0900)]
Fix failing tests.

5 years agoFix expectations on some ui tests involving FnOnce.
Masaki Hara [Sun, 28 Oct 2018 08:53:43 +0000 (17:53 +0900)]
Fix expectations on some ui tests involving FnOnce.

5 years agoAdd unstable-book articles on fnbox and boxed_closure_impls.
Masaki Hara [Sun, 28 Oct 2018 06:36:58 +0000 (15:36 +0900)]
Add unstable-book articles on fnbox and boxed_closure_impls.