]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoexplain why we use static alignment in ref-to-place conversion
Ralf Jung [Thu, 21 Feb 2019 12:15:59 +0000 (13:15 +0100)]
explain why we use static alignment in ref-to-place conversion

5 years agoAuto merge of #58056 - nikomatsakis:issue-57843-universe-leak, r=pnkfelix
bors [Wed, 20 Feb 2019 21:12:18 +0000 (21:12 +0000)]
Auto merge of #58056 - nikomatsakis:issue-57843-universe-leak, r=pnkfelix

make generalization code create new variables in correct universe

In our type inference system, when we "generalize" a type T to become
a suitable value for a type variable V, we sometimes wind up creating
new inference variables. So, for example, if we are making V be some
subtype of `&'X u32`, then we might instantiate V with `&'Y u32`.
This generalized type is then related `&'Y u32 <: &'X u32`, resulting
in a region constriant `'Y: 'X`. Previously, however, we were making
these fresh variables like `'Y` in the "current universe", but they
should be created in the universe of V. Moreover, we sometimes cheat
in an invariant context and avoid creating fresh variables if we know
the result must be equal -- we can only do that when the universes
work out.

Fixes #57843

r? @pnkfelix

5 years agoAuto merge of #58578 - kennytm:rollup, r=kennytm
bors [Wed, 20 Feb 2019 10:14:28 +0000 (10:14 +0000)]
Auto merge of #58578 - kennytm:rollup, r=kennytm

Rollup of 24 pull requests

Successful merges:

 - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s)
 - #58044 (Make overflowing and wrapping negation const)
 - #58303 (Improve stability tags display)
 - #58336 (Fix search results interactions)
 - #58384 (Fix tables display)
 - #58392 (Use less explicit shifting in std::net::ip)
 - #58409 (rustdoc: respect alternate flag when formatting impl trait)
 - #58456 (Remove no longer accurate diagnostic code about NLL)
 - #58528 (Don't use an allocation for ItemId in StmtKind)
 - #58530 (Monomorphize less code in fs::{read|write})
 - #58534 (Mention capping forbid lints)
 - #58536 (Remove UB in pointer tests)
 - #58538 (Add missing fmt structs examples)
 - #58539 (Add alias methods to PathBuf for underlying OsString (#58234))
 - #58544 (Fix doc for rustc "-g" flag)
 - #58545 (Add regression test for a specialization-related ICE (#39448))
 - #58546 (librustc_codegen_llvm => 2018)
 - #58551 (Explain a panic in test case net::tcp::tests::double_bind)
 - #58553 (Use more impl header lifetime elision)
 - #58562 (Fix style nits)
 - #58565 (Fix typo in std::future::Future docs)
 - #58568 (Fix a transposition in driver.rs.)
 - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`)
 - #58576 (Stabilize iter::successors and iter::from_fn)

5 years agoRollup merge of #58044 - Lokathor:lokathor, r=alexcrichton
kennytm [Wed, 20 Feb 2019 04:01:58 +0000 (12:01 +0800)]
Rollup merge of #58044 - Lokathor:lokathor, r=alexcrichton

Make overflowing and wrapping negation const

Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.

5 years agoRollup merge of #58576 - SimonSapin:successors, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:49 +0000 (01:13 +0800)]
Rollup merge of #58576 - SimonSapin:successors, r=Centril

Stabilize iter::successors and iter::from_fn

FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773, https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234

5 years agoRollup merge of #58569 - kenta7777:reduce-code-repetition, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:47 +0000 (01:13 +0800)]
Rollup merge of #58569 - kenta7777:reduce-code-repetition, r=oli-obk

Reduce Some Code Repetitions like `(n << amt) >> amt`

This Pull Request is related to [#49937](https://github.com/rust-lang/rust/issues/49937).
This Pull Request has reduced repetition of `(n << amt) >> amt`.

5 years agoRollup merge of #58568 - benjaminp:driver-trans, r=wesleywiser
kennytm [Tue, 19 Feb 2019 17:13:46 +0000 (01:13 +0800)]
Rollup merge of #58568 - benjaminp:driver-trans, r=wesleywiser

Fix a transposition in driver.rs.

5 years agoRollup merge of #58565 - thomaseizinger:typo-future-docs, r=frewsxcv
kennytm [Tue, 19 Feb 2019 17:13:44 +0000 (01:13 +0800)]
Rollup merge of #58565 - thomaseizinger:typo-future-docs, r=frewsxcv

Fix typo in std::future::Future docs

I am not quite sure if this is actually a typo but

1. to me the sentence doesn't make sense if it says "expect"
2. I hope that `Future`s are not really allowed to cause memory unsafety if they are polled after completion.

5 years agoRollup merge of #58562 - dlrobertson:fix_nits, r=alexreg
kennytm [Tue, 19 Feb 2019 17:13:41 +0000 (01:13 +0800)]
Rollup merge of #58562 - dlrobertson:fix_nits, r=alexreg

Fix style nits

Fix style nits discovered in reading code.

r? @alexreg

5 years agoRollup merge of #58553 - scottmcm:more-ihle, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:39 +0000 (01:13 +0800)]
Rollup merge of #58553 - scottmcm:more-ihle, r=Centril

Use more impl header lifetime elision

Inspired by seeing explicit lifetimes on these two:

- https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator
- https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not

And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore.

Most of the changes in here fall into two big categories:

- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`)

- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)

I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm).

I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423

5 years agoRollup merge of #58551 - ssomers:master, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:36 +0000 (01:13 +0800)]
Rollup merge of #58551 - ssomers:master, r=oli-obk

Explain a panic in test case net::tcp::tests::double_bind

Those who try to build libstd on the Windows Subsystem for Linux experience a single failing test, where the point of failure is an explicit but anonymous panic, as reported in https://github.com/rust-lang/rust/issues/49367
This commit somewhat explains why and allows diagnosing a little.

5 years agoRollup merge of #58546 - taiki-e:librustc_codegen_llvm-2018, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:34 +0000 (01:13 +0800)]
Rollup merge of #58546 - taiki-e:librustc_codegen_llvm-2018, r=Centril

librustc_codegen_llvm => 2018

Transitions `librustc_codegen_llvm` to Rust 2018; cc #58099

r? @Centril

5 years agoRollup merge of #58545 - emlai:regression-test-for-39448, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:33 +0000 (01:13 +0800)]
Rollup merge of #58545 - emlai:regression-test-for-39448, r=Centril

Add regression test for a specialization-related ICE (#39448)

Closes #39448.

This is my first time contributing, I hope I got everything right. :)

5 years agoRollup merge of #58544 - TheBiggerGuy:rustc-doc-cli-args, r=TimNN
kennytm [Tue, 19 Feb 2019 17:13:32 +0000 (01:13 +0800)]
Rollup merge of #58544 - TheBiggerGuy:rustc-doc-cli-args, r=TimNN

Fix doc for rustc "-g" flag

The rustc `-g` CLI flag was miss documented to be a synonym of `-C debug-level=2` and not `-C debuglevel=2`. Also add links to the codegen docs for each synonym.

I am unsure of this will conflict with work on #52938

5 years agoRollup merge of #58539 - aaronstillwell:master, r=Mark-Simulacrum
kennytm [Tue, 19 Feb 2019 17:13:31 +0000 (01:13 +0800)]
Rollup merge of #58539 - aaronstillwell:master, r=Mark-Simulacrum

Add alias methods to PathBuf for underlying OsString (#58234)

Implemented the following methods on PathBuf which forward to the underlying OsString.

- capacity
- with_capacity
- clear
- reserve
- reserve_exact
- shrink_to_fit
- shrink_to

These methods have been documented with reference to the original docs for `OsString`. @Mark-Simulacrum please let me know if you feel this does not suffice.

Further, I've not yet included tests for these definitions - please advise on how comprehensive tests need to be for methods such as these that simply alias other (already tested) methods.

(This PR addresses issue #58234)

5 years agoRollup merge of #58538 - GuillaumeGomez:fmt-examples, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:29 +0000 (01:13 +0800)]
Rollup merge of #58538 - GuillaumeGomez:fmt-examples, r=Centril

Add missing fmt structs examples

r? @rust-lang/docs

5 years agoRollup merge of #58536 - xfix:remove-ub-in-pointer-tests, r=RalfJung
kennytm [Tue, 19 Feb 2019 17:13:28 +0000 (01:13 +0800)]
Rollup merge of #58536 - xfix:remove-ub-in-pointer-tests, r=RalfJung

Remove UB in pointer tests

UB found by Miri.

5 years agoRollup merge of #58534 - dwijnand:mention-capping-forbid-lints, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:27 +0000 (01:13 +0800)]
Rollup merge of #58534 - dwijnand:mention-capping-forbid-lints, r=oli-obk

Mention capping forbid lints

I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.

5 years agoRollup merge of #58530 - scottmcm:monomorphize-less, r=TimNN
kennytm [Tue, 19 Feb 2019 17:13:25 +0000 (01:13 +0800)]
Rollup merge of #58530 - scottmcm:monomorphize-less, r=TimNN

Monomorphize less code in fs::{read|write}

Since the generic-ness is only for the as_refs, might as well have std just compile the important part once instead of on every use.

5 years agoRollup merge of #58528 - Zoxc:stmtkind-item, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:24 +0000 (01:13 +0800)]
Rollup merge of #58528 - Zoxc:stmtkind-item, r=oli-obk

Don't use an allocation for ItemId in StmtKind

5 years agoRollup merge of #58456 - lzutao:nll, r=Centril
kennytm [Tue, 19 Feb 2019 17:13:23 +0000 (01:13 +0800)]
Rollup merge of #58456 - lzutao:nll, r=Centril

Remove no longer accurate diagnostic code about NLL

r? @steveklabnik

5 years agoRollup merge of #58409 - euclio:impl-trait-wrapping, r=QuietMisdreavus
kennytm [Tue, 19 Feb 2019 17:13:21 +0000 (01:13 +0800)]
Rollup merge of #58409 - euclio:impl-trait-wrapping, r=QuietMisdreavus

rustdoc: respect alternate flag when formatting impl trait

Fixes #58226.

Before:
<img width="963" alt="screen shot 2019-02-12 at 3 23 30 pm" src="https://user-images.githubusercontent.com/1372438/52665732-4496ea00-2eda-11e9-9e29-efffe43b2abf.png">

After:
<img width="964" alt="screen shot 2019-02-12 at 3 23 51 pm" src="https://user-images.githubusercontent.com/1372438/52665733-452f8080-2eda-11e9-999a-dd1fb28dee16.png">

5 years agoRollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:20 +0000 (01:13 +0800)]
Rollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obk

Use less explicit shifting in std::net::ip

Now that we have `{to|from}_be_bytes` the code can be simpler.

(Inspired by PR #57740)

5 years agoRollup merge of #58384 - GuillaumeGomez:fix-table-display, r=QuietMisdreavus
kennytm [Tue, 19 Feb 2019 17:13:18 +0000 (01:13 +0800)]
Rollup merge of #58384 - GuillaumeGomez:fix-table-display, r=QuietMisdreavus

Fix tables display

Fixes #58134.

cc @lzutao

r? @QuietMisdreavus

5 years agoRollup merge of #58336 - GuillaumeGomez:fix-search-results-interactions, r=oli-obk
kennytm [Tue, 19 Feb 2019 17:13:16 +0000 (01:13 +0800)]
Rollup merge of #58336 - GuillaumeGomez:fix-search-results-interactions, r=oli-obk

Fix search results interactions

The bug is visible when you search for "none": the second tab is empty and therefore it messes with the classes. Then when you try to use arrows on the third tab, it just crashes (because only 2 "search-results" are present and you're on tab 3).

r? @QuietMisdreavus

5 years agoRollup merge of #58303 - GuillaumeGomez:stability-tags-display, r=QuietMisdreavus
kennytm [Tue, 19 Feb 2019 17:13:15 +0000 (01:13 +0800)]
Rollup merge of #58303 - GuillaumeGomez:stability-tags-display, r=QuietMisdreavus

Improve stability tags display

The issue was the font color on dark theme. Fixed now:

<img width="352" alt="screenshot 2019-02-08 at 14 15 24" src="https://user-images.githubusercontent.com/3050060/52483276-bd810380-2bb3-11e9-8d46-95368569ac85.png">

r? @QuietMisdreavus

5 years agoRollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomez
kennytm [Tue, 19 Feb 2019 17:13:12 +0000 (01:13 +0800)]
Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomez

Modify doctest's auto-`fn main()` to allow `Result`s

This lets the default `fn main()` ~~return `impl Termination`~~ unwrap Results, which allows the use of `?` in most tests without adding it manually. This fixes #56260

~~Blocked on `std::process::Termination` stabilization.~~

Using `Termination` would have been cleaner, but this should work OK.

5 years agoAuto merge of #57896 - oli-obk:permissive_existence, r=cramertj
bors [Tue, 19 Feb 2019 15:30:38 +0000 (15:30 +0000)]
Auto merge of #57896 - oli-obk:permissive_existence, r=cramertj

 Be more permissive with required bounds on existential types

fixes  #54184

r? @pnkfelix

5 years agoStabilize iter::from_fn
Simon Sapin [Tue, 19 Feb 2019 13:10:07 +0000 (14:10 +0100)]
Stabilize iter::from_fn

FCP: https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234

5 years agoStabilize iter::successors
Simon Sapin [Tue, 19 Feb 2019 12:58:55 +0000 (13:58 +0100)]
Stabilize iter::successors

FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773

5 years agoAdd missing fmt structs examples
Guillaume Gomez [Sun, 17 Feb 2019 14:55:59 +0000 (15:55 +0100)]
Add missing fmt structs examples

5 years agoFix tables display
Guillaume Gomez [Mon, 11 Feb 2019 21:22:56 +0000 (22:22 +0100)]
Fix tables display

5 years agoAuto merge of #58571 - Manishearth:rustup, r=Manishearth
bors [Tue, 19 Feb 2019 10:06:55 +0000 (10:06 +0000)]
Auto merge of #58571 - Manishearth:rustup, r=Manishearth

Update clippy, RLS, and rustfmt

moved from https://github.com/rust-lang/rust/pull/58337

5 years agoUpdate clippy to rust-lang/rust-clippy@d61b25419be
Manish Goregaokar [Tue, 19 Feb 2019 08:06:31 +0000 (13:36 +0530)]
Update clippy to rust-lang/rust-clippy@d61b25419be

5 years agoAuto merge of #56514 - ollie27:rustdoc_test_libdir, r=QuietMisdreavus
bors [Tue, 19 Feb 2019 07:27:39 +0000 (07:27 +0000)]
Auto merge of #56514 - ollie27:rustdoc_test_libdir, r=QuietMisdreavus

rustdoc: Don't modify library path for doctests

It shouldn't be needed anymore because doctests are no longer compiled with `prefer-dynamic` (since #54939).

r? @QuietMisdreavus

5 years agoreduced some code repetitions.
kenta7777 [Tue, 19 Feb 2019 07:23:03 +0000 (16:23 +0900)]
reduced some code repetitions.

5 years agoFix a transposition in driver.rs.
Benjamin Peterson [Tue, 19 Feb 2019 01:33:52 +0000 (17:33 -0800)]
Fix a transposition in driver.rs.

5 years agoAuto merge of #58503 - varkor:const-generics-hir, r=petrochenkov
bors [Tue, 19 Feb 2019 00:46:12 +0000 (00:46 +0000)]
Auto merge of #58503 - varkor:const-generics-hir, r=petrochenkov

Add const generics to the HIR

Split out from https://github.com/rust-lang/rust/pull/53645.

cc @yodaldevoid

r? @eddyb

5 years agoFix typo in std::future::Future docs
Thomas Eizinger [Mon, 18 Feb 2019 22:36:41 +0000 (09:36 +1100)]
Fix typo in std::future::Future docs

5 years agoFix style nits
Dan Robertson [Mon, 18 Feb 2019 18:34:42 +0000 (18:34 +0000)]
Fix style nits

Fix style nits discovered in reading code.

5 years agoAuto merge of #58543 - jonas-schievink:bumpstrap, r=pietroalbini
bors [Mon, 18 Feb 2019 22:03:41 +0000 (22:03 +0000)]
Auto merge of #58543 - jonas-schievink:bumpstrap, r=pietroalbini

Bump the bootstrap compiler

This compiler includes https://github.com/rust-lang/rust/pull/58501, which fixes an annoying ICE while working on rustc itself.

r? @pietroalbini

5 years agoFixed doc example for Path::with_capacity
Aaron Stillwell [Mon, 18 Feb 2019 17:42:07 +0000 (17:42 +0000)]
Fixed doc example for Path::with_capacity

5 years agoAuto merge of #58549 - pietroalbini:fix-docker-ci-hash, r=Mark-Simulacrum
bors [Mon, 18 Feb 2019 17:34:14 +0000 (17:34 +0000)]
Auto merge of #58549 - pietroalbini:fix-docker-ci-hash, r=Mark-Simulacrum

ci: fix docker cache hash collision

#58416 uncovered a bug in our caching for docker images: if the image `foo` pulls files from the image `bar` and a file in `bar` changed, the hash of `foo` will be the same even though it should be different. In that PR's case, `dist-i686-linux` pulls scripts from `dist-x86_64-linux`, and the PR only changed those scripts, causing an hash collision for `dist-i686-linux`.

We have to fix this, since the image will be rebuilt every time bors switches from testing master to testing beta/stable (and when it switches back), making CI way more painful than it currently is.

The approach used by this PR is to just include all the files in `src/ci/docker` in the hash. It's a bit heavy-handed and it will cause a rebuild of all the images every time a single image changes, but it's the best I can think of.

r? @Mark-Simulacrum
cc @alexcrichton @kennytm

5 years agoci: fix docker cache hash collision
Pietro Albini [Sun, 17 Feb 2019 21:24:13 +0000 (22:24 +0100)]
ci: fix docker cache hash collision

Before this commit the hash used to cache docker images was calculated
from the image's files and the files in the scripts/ directory. This
worked fine when all the files used by an image were in those
directories, but some images pull files from other images, causing hash
collisions in some cases.

This commit changes the hash to include the files of all the docker
images, causing a rebuild of all the images when a single one changes.
That's a bit heavy-handed, but we have no way to track which files an
image pulls in and hash collisions are really painful to deal with.

5 years agoUpdate Cargo.lock
flip1995 [Mon, 18 Feb 2019 09:32:58 +0000 (10:32 +0100)]
Update Cargo.lock

5 years agoAdd constant_time_eq to license exception list of tidy tool
flip1995 [Sat, 16 Feb 2019 23:09:27 +0000 (00:09 +0100)]
Add constant_time_eq to license exception list of tidy tool

5 years agoUpdate Cargo.toml of rustc-workspace-hack
flip1995 [Thu, 14 Feb 2019 13:32:02 +0000 (14:32 +0100)]
Update Cargo.toml of rustc-workspace-hack

5 years agoUpdate rustfmt to rust-lang/rustfmt@d6829d
flip1995 [Mon, 11 Feb 2019 21:43:31 +0000 (22:43 +0100)]
Update rustfmt to rust-lang/rustfmt@d6829d

5 years agoUpdate RLS to rust-lang/rls@0d6f53
flip1995 [Sun, 10 Feb 2019 00:33:54 +0000 (01:33 +0100)]
Update RLS to rust-lang/rls@0d6f53

5 years agoUpdate Clippy to rust-lang/rust-clippy@32ee30
flip1995 [Sun, 10 Feb 2019 00:10:23 +0000 (01:10 +0100)]
Update Clippy to rust-lang/rust-clippy@32ee30

5 years agoAuto merge of #58541 - kennytm:fix-publish-toolstate-py-again, r=oli-obk
bors [Mon, 18 Feb 2019 08:37:18 +0000 (08:37 +0000)]
Auto merge of #58541 - kennytm:fix-publish-toolstate-py-again, r=oli-obk

publish_toolstate.py: further fix the runtime errors

The regex was missing a `,`, causing `relevant_pr_match` to become None and set the PR number to -1 and assigned the new issue to `@<unknown user>`. This causes the 422 error when creating the issue due to invalid assignee and unable to leave the tool-is-broken comment since PR -1 does not exist.

The default user names are now also changed to @ghost to prevent the 422 error in case anything goes wrong again.

5 years agoUse more impl header lifetime elision
Scott McMurray [Mon, 18 Feb 2019 03:42:36 +0000 (19:42 -0800)]
Use more impl header lifetime elision

There are two big categories of changes in here

- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)

I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.

5 years agoAuto merge of #58373 - RalfJung:maybe-uninit, r=gnzlbg
bors [Mon, 18 Feb 2019 02:56:18 +0000 (02:56 +0000)]
Auto merge of #58373 - RalfJung:maybe-uninit, r=gnzlbg

update stdsimd and remove now-unused MaybeUninit::into_inner

That's a huge diff for stdsimd... Cc @gnzlbg @alexcrichton

5 years agoMerge remote-tracking branch 'upstream/master'
Stein Somers [Sun, 17 Feb 2019 23:31:41 +0000 (00:31 +0100)]
Merge remote-tracking branch 'upstream/master'

5 years agoExplain a panic in test case net::tcp::tests::double_bind
Stein Somers [Mon, 4 Feb 2019 22:47:28 +0000 (23:47 +0100)]
Explain a panic in test case net::tcp::tests::double_bind

5 years agoAdd links to codegen docs for rustc synonym flags
Guy Taylor [Sun, 17 Feb 2019 18:00:33 +0000 (18:00 +0000)]
Add links to codegen docs for rustc synonym flags

The rustc "-g" and "-o" fags are synonyms of the "-c" codegen flags.
This adds a link to the codegen docs for each synonym.

5 years agoFix doc for rustc "-g" flag
Guy Taylor [Sun, 17 Feb 2019 14:18:03 +0000 (14:18 +0000)]
Fix doc for rustc "-g" flag

The rustc "-g" CLI flag was miss documented to be a synonym of "-C
debug-level=2" and not the correct "-C debuginfo=2".

5 years agolibrustc_codegen_llvm => 2018
Taiki Endo [Sun, 17 Feb 2019 18:58:58 +0000 (03:58 +0900)]
librustc_codegen_llvm => 2018

5 years agoAdd regression test for a specialization-related ICE (#39448)
emlai [Sun, 17 Feb 2019 18:41:18 +0000 (20:41 +0200)]
Add regression test for a specialization-related ICE (#39448)

5 years agoBump the bootstrap compiler
Jonas Schievink [Sun, 17 Feb 2019 17:14:32 +0000 (18:14 +0100)]
Bump the bootstrap compiler

5 years agoChanged feature gate for new PathBuf methods
Aaron Stillwell [Sun, 17 Feb 2019 17:14:10 +0000 (17:14 +0000)]
Changed feature gate for new PathBuf methods

Feature gate changed to `path_buf_capacity` as per advice from @Mark-Simulacrum

5 years agoFixes for implementation of PathBuf methods (aliases for OsString)
Aaron Stillwell [Sun, 17 Feb 2019 16:41:05 +0000 (16:41 +0000)]
Fixes for implementation of PathBuf methods (aliases for OsString)

- Fixed incorrect `mut` usage
- Fixed style in accordance with tidy
- Marked all methods as unstable
- Changed feature identifier to path_buf_alias_os_string_methods

5 years agoModify doctest's auto-`fn main()` to allow `Result`s
Andre Bogus [Mon, 3 Dec 2018 17:16:20 +0000 (18:16 +0100)]
Modify doctest's auto-`fn main()` to allow `Result`s

This lets the default `fn main()` unwrap any `Result`s, which
allows the use of `?` in most tests without adding it manually.

5 years agopublish_toolstate.py: further fix the runtime errors
kennytm [Sun, 17 Feb 2019 15:19:47 +0000 (23:19 +0800)]
publish_toolstate.py: further fix the runtime errors

The regex was missing a `,`, causing `relevant_pr_match` to become None
and set the PR number to -1 and assigned the new issue to
`@<unknown user>`. This causes the 422 error when creating the issue due
to invalid assignee and unable to leave the tool-is-broken comment since
PR -1 does not exist.

The default user names are now also changed to @ghost to prevent the
422 error in case anything goes wrong again.

5 years agoAdd alias methods to PathBuf for underlying OsString
Aaron Stillwell [Sun, 17 Feb 2019 15:17:46 +0000 (15:17 +0000)]
Add alias methods to PathBuf for underlying OsString

Implemented the following methods on PathBuf which
forward to the underlying OsString.

- capacity
- with_capacity
- clear
- reserve
- reserve_exact
- shrink_to_fit
- shrink_to

5 years agoAuto merge of #58416 - cuviper:dist-linux-gcc, r=alexcrichton
bors [Sun, 17 Feb 2019 14:29:33 +0000 (14:29 +0000)]
Auto merge of #58416 - cuviper:dist-linux-gcc, r=alexcrichton

[CI] Update GCC in the dist-linux builders

Upstream LLVM is planning to raise their minimum toolchain requirements, so they may start using C++14 features. This new policy has already landed in the form of a "soft" error.
http://lists.llvm.org/pipermail/llvm-dev/2019-February/130117.html

For GCC, they will require at least version 5.1. This PR moves our crosstool-ng builders to their max GCC 5.2, with a few small patches to fix compatibility. The dist-x86_64-linux builder is updated to GCC 5.5 and LLVM/Clang 8.0.0-rc2, which also affects dist-i686-linux sharing the same scripts.

r? @alexcrichton

5 years agoRemove UB in test_ptr_subtraction test
Konrad Borowski [Sun, 17 Feb 2019 12:04:48 +0000 (13:04 +0100)]
Remove UB in test_ptr_subtraction test

5 years agoRemove UB in test_is_null test
Konrad Borowski [Sun, 17 Feb 2019 11:58:48 +0000 (12:58 +0100)]
Remove UB in test_is_null test

5 years agoMention capping forbid lints
Dale Wijnand [Sun, 17 Feb 2019 10:24:06 +0000 (10:24 +0000)]
Mention capping forbid lints

I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.

5 years agoupdate stdsimd
Ralf Jung [Sun, 17 Feb 2019 10:22:04 +0000 (11:22 +0100)]
update stdsimd

5 years agoAuto merge of #58495 - kennytm:rollup, r=kennytm
bors [Sun, 17 Feb 2019 07:34:48 +0000 (07:34 +0000)]
Auto merge of #58495 - kennytm:rollup, r=kennytm

Rollup of 19 pull requests

Successful merges:

 - #57929 (Rustdoc remove old style files)
 - #57981 (Fix #57730)
 - #58074 (Stabilize slice_sort_by_cached_key)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58293 (Remove code for updating copyright years in generate-deriving-span-tests)
 - #58306 (Don't default on std crate when manipulating browser history)
 - #58359 (librustc_mir: use ? in impl_snapshot_for! macro)
 - #58395 (Instant::checked_duration_since)
 - #58429 (fix Box::into_unique effecitvely transmuting to a raw ptr)
 - #58433 (Update which libcore/liballoc tests Miri ignores, and document why)
 - #58438 (Use posix_spawn_file_actions_addchdir_np when possible)
 - #58440 (Whitelist the ARM v6 target-feature)
 - #58448 (rustdoc: mask `compiler_builtins` docs)
 - #58468 (split MaybeUninit into several features, expand docs a bit)
 - #58479 (compile-pass test for #53606)
 - #58489 (Fix runtime error in generate-keyword-tests)
 - #58496 (Fix documentation for std::path::PathBuf::pop)
 - #58509 (Notify myself when Clippy toolstate changes)
 - #58521 (Fix tracking issue for error iterators)

5 years agoMonomorphize less code in fs::{read|write}
Scott McMurray [Sun, 17 Feb 2019 07:18:43 +0000 (23:18 -0800)]
Monomorphize less code in fs::{read|write}

Since the generic-ness is only for the as_refs, might as well have std just compile the important part once instead of on every use.

5 years agoRollup merge of #58521 - sfackler:error-iter-issue, r=withoutboats
kennytm [Sun, 17 Feb 2019 06:54:00 +0000 (14:54 +0800)]
Rollup merge of #58521 - sfackler:error-iter-issue, r=withoutboats

Fix tracking issue for error iterators

5 years agoRollup merge of #58509 - phansch:add_myself_to_clippy_toolstate_maintainers, r=oli-obk
kennytm [Sat, 16 Feb 2019 15:46:32 +0000 (23:46 +0800)]
Rollup merge of #58509 - phansch:add_myself_to_clippy_toolstate_maintainers, r=oli-obk

Notify myself when Clippy toolstate changes

5 years agoRollup merge of #58496 - nathan:doc-std-path-pathbuf-pop, r=frewsxcv
kennytm [Sat, 16 Feb 2019 15:46:10 +0000 (23:46 +0800)]
Rollup merge of #58496 - nathan:doc-std-path-pathbuf-pop, r=frewsxcv

Fix documentation for std::path::PathBuf::pop

Closes #58474.

5 years agoRollup merge of #58395 - vi:checked_duration_since, r=dtolnay
kennytm [Sat, 16 Feb 2019 06:15:45 +0000 (14:15 +0800)]
Rollup merge of #58395 - vi:checked_duration_since, r=dtolnay

Instant::checked_duration_since

5 years agoRollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-files, r=ollie27
kennytm [Sat, 16 Feb 2019 06:15:04 +0000 (14:15 +0800)]
Rollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-files, r=ollie27

Rustdoc remove old style files

Reopening of #56577 (which I can't seem to reopen...).

I made the flag unstable so with this change, what was blocking the PR is now gone I assume.

5 years agoRollup merge of #58489 - xfix:fix-keyword-tests-runtime-error, r=alexcrichton
kennytm [Fri, 15 Feb 2019 16:56:04 +0000 (00:56 +0800)]
Rollup merge of #58489 - xfix:fix-keyword-tests-runtime-error, r=alexcrichton

Fix runtime error in generate-keyword-tests

The script was made unusable after removing license headers.

5 years agoRollup merge of #58479 - saleemjaffer:test_promote_evaluation_unused_result, r=oli-obk
kennytm [Fri, 15 Feb 2019 16:56:03 +0000 (00:56 +0800)]
Rollup merge of #58479 - saleemjaffer:test_promote_evaluation_unused_result, r=oli-obk

compile-pass test for #53606

fixes #53606

5 years agoDon't use an allocation for ItemId in StmtKind
John Kåre Alsaker [Sun, 17 Feb 2019 06:23:13 +0000 (07:23 +0100)]
Don't use an allocation for ItemId in StmtKind

5 years agoAuto merge of #58477 - rust-lang:fix-publish-toolstate-syntax-error, r=oli-obk
bors [Sun, 17 Feb 2019 04:57:50 +0000 (04:57 +0000)]
Auto merge of #58477 - rust-lang:fix-publish-toolstate-syntax-error, r=oli-obk

Fix the syntax error in publish_toolstate.py

5 years agoFix tracking issue for error iterators
Steven Fackler [Sat, 16 Feb 2019 20:16:18 +0000 (12:16 -0800)]
Fix tracking issue for error iterators

5 years agoAdd a test for const parameter uppercase lint
varkor [Sat, 16 Feb 2019 13:04:15 +0000 (13:04 +0000)]
Add a test for const parameter uppercase lint

5 years agoDon't abort early when collecting const generics
varkor [Sat, 16 Feb 2019 13:03:58 +0000 (13:03 +0000)]
Don't abort early when collecting const generics

5 years agoCheck for Const param in collect
varkor [Sat, 16 Feb 2019 13:03:30 +0000 (13:03 +0000)]
Check for Const param in collect

5 years agoNotify myself when Clippy toolstate changes
Philipp Hansch [Sat, 16 Feb 2019 10:56:32 +0000 (11:56 +0100)]
Notify myself when Clippy toolstate changes

5 years agoRollup merge of #58468 - RalfJung:maybe-uninit-split, r=Centril
kennytm [Fri, 15 Feb 2019 16:56:00 +0000 (00:56 +0800)]
Rollup merge of #58468 - RalfJung:maybe-uninit-split, r=Centril

split MaybeUninit into several features, expand docs a bit

This splits the `maybe_uninit` feature gate into several:

* `maybe_uninit` for what we will hopefully stabilize soon-ish.
* `maybe_uninit_ref` for creating references into `MaybeUninit`, for which the rules are not yet clear.
* `maybe_uninit_slice` for handling slices of `MaybeUninit`, which needs more API design work.
* `maybe_uninit_array` for creating arrays of `MaybeUninit` using a macro (because we don't have https://github.com/rust-lang/rust/issues/49147 yet).

Is that an okay thing to do? The goal is to help people avoid APIs we do not want to stabilize yet. I used this to make sure rustc itself does not use `get_ref` and `get_mut`.

I also extended the docs to advise against uninitialized integers -- again this is something for which the rules are still being discussed.

5 years agoRollup merge of #58448 - euclio:missing-summaries, r=QuietMisdreavus
kennytm [Fri, 15 Feb 2019 16:55:59 +0000 (00:55 +0800)]
Rollup merge of #58448 - euclio:missing-summaries, r=QuietMisdreavus

rustdoc: mask `compiler_builtins` docs

Fixes #46783.

I wasn't able to fully confirm the underlying cause, but my theory is that functions in `compiler_builtins` were overwriting functions with the same names in libcore in the search index. Since the functions in `compiler_builtins` didn't have docs, that's why they weren't appearing in the results.

Masking the `compiler_builtins` crate fixes the search results. It appears that this crate was accidentally unmasked in #49503.

5 years agoRollup merge of #58440 - gnzlbg:v6, r=japaric
kennytm [Fri, 15 Feb 2019 16:55:58 +0000 (00:55 +0800)]
Rollup merge of #58440 - gnzlbg:v6, r=japaric

Whitelist the ARM v6 target-feature

5 years agoRollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np, r=alexcrichton
kennytm [Fri, 15 Feb 2019 16:55:56 +0000 (00:55 +0800)]
Rollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np, r=alexcrichton

Use posix_spawn_file_actions_addchdir_np when possible

This is a non-POSIX extension implemented in Solaris and in glibc 2.29.
With this we can still use `posix_spawn()` when `Command::current_dir()`
has been set, otherwise we fallback to `fork(); chdir(); exec()`.

5 years agoRollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN
kennytm [Fri, 15 Feb 2019 16:55:55 +0000 (00:55 +0800)]
Rollup merge of #58433 - RalfJung:miri-mark-tests, r=TimNN

Update which libcore/liballoc tests Miri ignores, and document why

5 years agoRollup merge of #58429 - RalfJung:box, r=TimNN
kennytm [Fri, 15 Feb 2019 16:55:54 +0000 (00:55 +0800)]
Rollup merge of #58429 - RalfJung:box, r=TimNN

fix Box::into_unique effecitvely transmuting to a raw ptr

Miri/Stacked Borrows treat `Box` specially: they assert that it is unique, and tag it appropriately. However, currently, `Box::into_inner` is not aware of that and returns a raw pointer (wrapped in a `Unique`) that carries the same tag as the box, meaning it carries a `Uniq` tag. This leads to all sorts of problems when people use the raw pointer they get out of the `Unique` type.

In the future, it'd be interesting to make `Unique` also carry some kind of uniqueness. In that case, something like this would instead be needed whenever a raw pointer is extracted from a `Unique`. However, that is out-of-scope for the current version of Stacked Borrows. So until then, this changes `into_unique` to perform a proper reference-to-raw-ptr-cast, which clears the tag.

5 years agoRollup merge of #58359 - taiki-e:impl_snapshot_for, r=oli-obk
kennytm [Fri, 15 Feb 2019 16:55:53 +0000 (00:55 +0800)]
Rollup merge of #58359 - taiki-e:impl_snapshot_for, r=oli-obk

librustc_mir: use ? in impl_snapshot_for! macro

5 years agoRollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=QuietMisdreavus
kennytm [Fri, 15 Feb 2019 16:55:51 +0000 (00:55 +0800)]
Rollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=QuietMisdreavus

Don't default on std crate when manipulating browser history

Fixes #58263.

r? @QuietMisdreavus

5 years agoRollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrum
kennytm [Fri, 15 Feb 2019 16:55:50 +0000 (00:55 +0800)]
Rollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrum

Remove code for updating copyright years in generate-deriving-span-tests

It's no longer necessary, as there is no license header anymore.

5 years agoRollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk
kennytm [Fri, 15 Feb 2019 16:55:49 +0000 (00:55 +0800)]
Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obk

Add specific feature gate error for const-unstable features

Before:
```
error: `impl Trait` in const fn is unstable
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^

error: aborting due to previous error
```

After:
```
error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
 --> src/lib.rs:7:19
  |
7 | const fn foo() -> impl T {
  |                   ^^^^^^
  = help: add #![feature(const_fn)] to the crate attributes to enable

error: aborting due to previous error
```

This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469.

r? @oli-obk

5 years agoRollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapin
kennytm [Fri, 15 Feb 2019 16:55:47 +0000 (00:55 +0800)]
Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapin

Stabilize slice_sort_by_cached_key

I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here.  The method was added last March by https://github.com/rust-lang/rust/pull/48639.

Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
```rust
impl [T] {
    pub fn sort_by_cached_key<K, F>(&mut self, f: F)
        where F: FnMut(&T) -> K, K: Ord;
}
```

That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?".

The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key

(I'm asking because it's exactly what I just needed the other day:
```rust
    all_positions.sort_by_cached_key(|&n|
        data::CITIES.iter()
            .map(|x| *metric_closure.get_edge(n, x.pos).unwrap())
            .sum::<usize>()
    );
```
since caching that key is a pretty obviously good idea.)

Closes #34447

5 years agoRollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakis
kennytm [Fri, 15 Feb 2019 16:55:46 +0000 (00:55 +0800)]
Rollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakis

Fix #57730

cc https://github.com/rust-lang/rust/pull/57730

r? @cramertj

5 years agoFix rebase issue
varkor [Fri, 15 Feb 2019 23:34:04 +0000 (23:34 +0000)]
Fix rebase issue

5 years agoUpdate tests
varkor [Fri, 15 Feb 2019 22:26:36 +0000 (22:26 +0000)]
Update tests

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>