]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #59733 - cramertj:wake-by-ref, r=withoutboats
bors [Fri, 12 Apr 2019 17:24:01 +0000 (17:24 +0000)]
Auto merge of #59733 - cramertj:wake-by-ref, r=withoutboats

Final (one can only hope) futures_api adjustments

Based on https://github.com/rust-lang/rust/pull/59119 -- this change is only the latter two commits.
cc https://github.com/rust-lang/rust/issues/59725

r? @withoutboats

5 years agoAuto merge of #59651 - tmandry:discr-index, r=eddyb
bors [Fri, 12 Apr 2019 14:38:15 +0000 (14:38 +0000)]
Auto merge of #59651 - tmandry:discr-index, r=eddyb

 Add discr_index to multi-variant layouts

We remove the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not (always) going to be
the case.

Specifically, upvars are going to go before the discriminant. In theory, it's possible to remove _that_ assumption instead and keep the discriminant at field index 0, but one assumption or the other had to go :)

There is one place I know of in the debuginfo code where we'll still need to remove assumptions that the discriminant is the _only_ field. I was planning on doing this along with the upcoming generator change, which will also include tests that exercise the code changing in this PR.

r? @eddyb
cc @oli-obk
cc @cramertj

5 years agoAuto merge of #59910 - Centril:rollup-yjv7b06, r=Centril
bors [Fri, 12 Apr 2019 11:46:01 +0000 (11:46 +0000)]
Auto merge of #59910 - Centril:rollup-yjv7b06, r=Centril

Rollup of 15 pull requests

Successful merges:

 - #59680 (Document the -Z flag to the rustc book)
 - #59711 (Add back the substring test)
 - #59806 (compiletest: Improve no_prefer_dynamic docs)
 - #59809 (Make trait_methods_not_found use a lock)
 - #59811 (Kill dead code dominator code.)
 - #59814 (Fix broken links on std::boxed doc page)
 - #59821 (improve unknown enum variant errors)
 - #59831 (Remove strange formatting in `Ordering` docs.)
 - #59836 (std::ops::Div examples: correct nominator to numerator)
 - #59857 (SGX target: fix cfg(test) build)
 - #59876 (Update TRPL to use mdbook 0.2)
 - #59880 (Remove note about transmute for float bitpatterns.)
 - #59889 (Update diagnostics.rs)
 - #59891 (Fix the link to sort_by_cached_key)
 - #59894 (save-analysis: Pull associated type definition using `qpath_def`)

Failed merges:

r? @ghost

5 years agoRollup merge of #59894 - Xanewok:save-assoc-ty-qpath, r=eddyb
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:11 +0000 (12:18 +0200)]
Rollup merge of #59894 - Xanewok:save-assoc-ty-qpath, r=eddyb

save-analysis: Pull associated type definition using `qpath_def`

Closes https://github.com/rust-lang/rls/issues/1390

This (probably?) fixes the case where we run the save-analysis code on the following snippet:
```rust
trait Test<'a> {
    type Thing: Test2;
}

trait Test2 {
    fn print();
}

#[allow(unused)]
fn example<T>(t: T)
    where T: for<'a> Test<'a>
{
    T::Thing::print(); //~ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
    // ^ only errors in save-analysis mode
}
```

The chain is as follows:
- culprit is `hir_ty_to_ty`
- which calls `ast_ty_to_ty` in the `ItemCtxt`
- which calls `associated_path_to_ty`
- which finally fails on `projected_ty_from_poly_trait_ref`
https://github.com/rust-lang/rust/blob/3de0106789468b211bcc3a25c09c0cf07119186d/src/librustc_typeck/collect.rs#L212-L224

I'm not exactly sure why `hir_ty_to_ty` fails - is it because it needs more setup from typeck to work correctly? I'm guessing the fix is okay since we just pull the already typeck'd data (we run save-analysis after all the analysis passes are complete) from the tables.

With this change we can 'go to def' on all segments in the `T::Thing::print()` path.

5 years agoRollup merge of #59891 - rust-lang:sort_by_cached_key, r=jonas-schievink
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:09 +0000 (12:18 +0200)]
Rollup merge of #59891 - rust-lang:sort_by_cached_key, r=jonas-schievink

Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.

5 years agoRollup merge of #59889 - andrewbanchich:minor-text-fixes, r=estebank
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:07 +0000 (12:18 +0200)]
Rollup merge of #59889 - andrewbanchich:minor-text-fixes, r=estebank

Update diagnostics.rs

Add `a` and other minor text improvements

5 years agoRollup merge of #59880 - solson:transmute-float, r=alexcrichton
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:05 +0000 (12:18 +0200)]
Rollup merge of #59880 - solson:transmute-float, r=alexcrichton

Remove note about transmute for float bitpatterns.

This particular usecase has been safely abstracted in these `std` functions: [f32::to_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.to_bits), [f32::from_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.from_bits), [f64::to_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.to_bits), [f64::from_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.from_bits). So, I think we shouldn't recommend an unnecessary use of `unsafe` here anymore.

5 years agoRollup merge of #59876 - integer32llc:update-trpl-to-mdbook-0.2, r=steveklabnik
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:02 +0000 (12:18 +0200)]
Rollup merge of #59876 - integer32llc:update-trpl-to-mdbook-0.2, r=steveklabnik

Update TRPL to use mdbook 0.2

I ran linkchecker locally and it passed. Let's see if I did it correctly...

5 years agoRollup merge of #59857 - jethrogb:jb/sgx-test, r=Centril
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:01 +0000 (12:18 +0200)]
Rollup merge of #59857 - jethrogb:jb/sgx-test, r=Centril

SGX target: fix cfg(test) build

5 years agoRollup merge of #59836 - andersk:nominator, r=Centril
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:59 +0000 (12:17 +0200)]
Rollup merge of #59836 - andersk:nominator, r=Centril

std::ops::Div examples: correct nominator to numerator

5 years agoRollup merge of #59831 - ehuss:ordering-docs, r=kennytm
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:58 +0000 (12:17 +0200)]
Rollup merge of #59831 - ehuss:ordering-docs, r=kennytm

Remove strange formatting in `Ordering` docs.

I can't really fathom what the intent of the brackets is. The [original PR](#12956) doesn't give any hints. I think it seems fine without them.

5 years agoRollup merge of #59821 - euclio:unknown-enum-variants, r=davidtwco
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:56 +0000 (12:17 +0200)]
Rollup merge of #59821 - euclio:unknown-enum-variants, r=davidtwco

improve unknown enum variant errors

Fixes #56517.

5 years agoRollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:55 +0000 (12:17 +0200)]
Rollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavus

Fix broken links on std::boxed doc page

r? @QuietMisdreavus

5 years agoRollup merge of #59811 - vext01:dead-dominator-code, r=oli-obk
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:54 +0000 (12:17 +0200)]
Rollup merge of #59811 - vext01:dead-dominator-code, r=oli-obk

Kill dead code dominator code.

Hi,

Whilst fiddling around in the dominator code, I found some (I think) unused code. This code *was* used at the time it was imported, but over time it seems to have become redundant.

I've tested a build up to stage 1 with no problems. Maybe the tests will turn up something though.

P.S.

There is a FIXME comment in `dominators/mod.rs`:
```
    pub fn is_dominated_by(&self, node: Node, dom: Node) -> bool {
        // FIXME -- could be optimized by using post-order-rank
        self.dominators(node).any(|n| n == dom)
    }
```

I'm not sure of the intention of this comment. The `Dominators` struct already operates over post-order rank nodes. Any ideas?

5 years agoRollup merge of #59809 - Zoxc:trait_methods_not_found, r=estebank
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:52 +0000 (12:17 +0200)]
Rollup merge of #59809 - Zoxc:trait_methods_not_found, r=estebank

Make trait_methods_not_found use a lock

r? @estebank

5 years agoRollup merge of #59806 - phansch:compiletest_docs2, r=oli-obk
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:51 +0000 (12:17 +0200)]
Rollup merge of #59806 - phansch:compiletest_docs2, r=oli-obk

compiletest: Improve no_prefer_dynamic docs

This adds some extra docs for the `no-prefer-dynamic` header.

And also a `s/must_compile_successfully/compile_pass`.

`must_compile_successfully` has been renamed to `compile_pass` at some
point in the past and this comment was still referring to the old name.

5 years agoRollup merge of #59711 - GuillaumeGomez:substring-test, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:49 +0000 (12:17 +0200)]
Rollup merge of #59711 - GuillaumeGomez:substring-test, r=QuietMisdreavus

Add back the substring test

Fixes #58331.

r? @QuietMisdreavus

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 #59622 - GuillaumeGomez:improve-one-char-search, r=QuietMisdreavus
bors [Fri, 12 Apr 2019 08:59:03 +0000 (08:59 +0000)]
Auto merge of #59622 - GuillaumeGomez:improve-one-char-search, r=QuietMisdreavus

Ensure that exact matches come first in rustdoc search

Fixes #59287.

cc @scottmcm

r? @QuietMisdreavus

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 agoAdd discr_index to multi-variant layouts
Tyler Mandry [Tue, 2 Apr 2019 22:57:50 +0000 (15:57 -0700)]
Add discr_index to multi-variant layouts

We relax the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not going to be
the case.

5 years agodescribe_enum_variant: Reduce code duplication
Tyler Mandry [Tue, 2 Apr 2019 20:51:13 +0000 (13:51 -0700)]
describe_enum_variant: Reduce code duplication

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 agosave-analysis: Simplify match arm for type node def
Igor Matuszewski [Thu, 11 Apr 2019 21:53:59 +0000 (23:53 +0200)]
save-analysis: Simplify match arm for type node def

5 years agosave-analysis: use `qpath_def` for associated types
Igor Matuszewski [Thu, 11 Apr 2019 21:31:34 +0000 (23:31 +0200)]
save-analysis: use `qpath_def` for associated types

5 years agoFix the link to sort_by_cached_key
Josh Stone [Thu, 11 Apr 2019 21:04:52 +0000 (14:04 -0700)]
Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.

5 years agoUpdate diagnostics.rs
Andrew Banchich [Thu, 11 Apr 2019 20:12:04 +0000 (16:12 -0400)]
Update diagnostics.rs

Add `a` and other minor text improvements

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 agoFix broken links on std::boxed doc page
Oliver Middleton [Tue, 9 Apr 2019 14:41:46 +0000 (15:41 +0100)]
Fix broken links on std::boxed doc page

5 years agoRemove note about transmute for float bitpatterns.
Scott Olson [Thu, 11 Apr 2019 13:56:35 +0000 (07:56 -0600)]
Remove note about transmute for float bitpatterns.

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 agoUpdate TRPL to use mdbook 0.2
Carol (Nichols || Goulding) [Thu, 11 Apr 2019 11:56:25 +0000 (07:56 -0400)]
Update TRPL to use mdbook 0.2

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 agoSGX target: fix cfg(test) build
Jethro Beekman [Wed, 10 Apr 2019 21:08:54 +0000 (14:08 -0700)]
SGX target: fix cfg(test) build

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 agostd::ops::Div examples: correct nominator to numerator
Anders Kaseorg [Wed, 10 Apr 2019 04:43:41 +0000 (21:43 -0700)]
std::ops::Div examples: correct nominator to numerator

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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 agoRemove strange formatting in `Ordering` docs.
Eric Huss [Tue, 9 Apr 2019 22:41:38 +0000 (15:41 -0700)]
Remove strange formatting in `Ordering` docs.

5 years agoimprove unknown enum variant errors
Andy Russell [Mon, 8 Apr 2019 21:58:18 +0000 (17:58 -0400)]
improve unknown enum variant errors

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 agoKill dead code dominator code.
Edd Barrett [Tue, 9 Apr 2019 10:48:31 +0000 (11:48 +0100)]
Kill dead code dominator code.

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 agoMake trait_methods_not_found use a lock
John Kåre Alsaker [Tue, 9 Apr 2019 08:19:53 +0000 (10:19 +0200)]
Make trait_methods_not_found use a lock

5 years agoRename Waker::new_unchecked to Waker::from_raw
Taylor Cramer [Fri, 5 Apr 2019 18:49:46 +0000 (11:49 -0700)]
Rename Waker::new_unchecked to Waker::from_raw

5 years agoAdd Waker::wake_by_ref and make Waker::wake consume the Waker
Taylor Cramer [Fri, 5 Apr 2019 18:46:30 +0000 (11:46 -0700)]
Add Waker::wake_by_ref and make Waker::wake consume the Waker

5 years agocompiletest: Improve no_prefer_dynamic docs
Philipp Hansch [Mon, 8 Apr 2019 19:32:38 +0000 (21:32 +0200)]
compiletest: Improve no_prefer_dynamic docs

This adds some extra docs for the `no-prefer-dynamic` header.

And also a `s/must_compile_successfully/compile_pass`.

`must_compile_successfully` has been renamed to `compile_pass` at some
point in the past and this comment was still referring to the old name.

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