Commit Graph

89951 Commits

Author SHA1 Message Date
Ralf Jung
b01f81be74 remark about the one place where place computation calls size_and_align_of 2019-02-21 16:14:31 +01:00
Ralf Jung
0f6d36375f explain why we use static alignment in ref-to-place conversion 2019-02-21 13:15:59 +01:00
bors
1349c84a4f 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
2019-02-20 21:12:18 +00:00
bors
f66e4697ae 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)
2019-02-20 10:14:28 +00:00
kennytm
a1a17f5c66
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.
2019-02-20 12:01:58 +08:00
kennytm
8ca56e1e02
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
2019-02-20 11:59:26 +08:00
kennytm
95daca4aaf
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`.
2019-02-20 11:59:23 +08:00
kennytm
2f9fa199d2
Rollup merge of #58568 - benjaminp:driver-trans, r=wesleywiser
Fix a transposition in driver.rs.
2019-02-20 11:59:20 +08:00
kennytm
09c85a1d22
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.
2019-02-20 11:59:17 +08:00
kennytm
6e991011dc
Rollup merge of #58562 - dlrobertson:fix_nits, r=alexreg
Fix style nits

Fix style nits discovered in reading code.

r? @alexreg
2019-02-20 11:59:13 +08:00
kennytm
e3a8f7db47
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
2019-02-20 11:59:10 +08:00
kennytm
ef0aaddf69
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.
2019-02-20 11:59:07 +08:00
kennytm
8368638515
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
2019-02-20 11:59:04 +08:00
kennytm
fd18e3f35e
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. :)
2019-02-20 11:59:02 +08:00
kennytm
717aa46178
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
2019-02-20 11:58:58 +08:00
kennytm
c965858e20
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)
2019-02-20 11:58:55 +08:00
kennytm
a68a1c758d
Rollup merge of #58538 - GuillaumeGomez:fmt-examples, r=Centril
Add missing fmt structs examples

r? @rust-lang/docs
2019-02-20 11:58:52 +08:00
kennytm
943fe1ee2c
Rollup merge of #58536 - xfix:remove-ub-in-pointer-tests, r=RalfJung
Remove UB in pointer tests

UB found by Miri.
2019-02-20 11:58:48 +08:00
kennytm
51445830d2
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.
2019-02-20 11:58:45 +08:00
kennytm
7ef11d4f84
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.
2019-02-20 11:58:42 +08:00
kennytm
e95297ca15
Rollup merge of #58528 - Zoxc:stmtkind-item, r=oli-obk
Don't use an allocation for ItemId in StmtKind
2019-02-20 11:58:38 +08:00
kennytm
897778ec28
Rollup merge of #58456 - lzutao:nll, r=Centril
Remove no longer accurate diagnostic code about NLL

r? @steveklabnik
2019-02-20 11:58:35 +08:00
kennytm
8d1e4323b3
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">
2019-02-20 11:58:31 +08:00
kennytm
98a6e720d0
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)
2019-02-20 11:58:26 +08:00
kennytm
07b6d17416
Rollup merge of #58384 - GuillaumeGomez:fix-table-display, r=QuietMisdreavus
Fix tables display

Fixes #58134.

cc @lzutao

r? @QuietMisdreavus
2019-02-20 11:58:22 +08:00
kennytm
d22bb1a8b4
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
2019-02-20 11:58:16 +08:00
kennytm
120e9cb70f
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
2019-02-20 11:58:11 +08:00
kennytm
5a06eab1f5
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.
2019-02-20 01:13:12 +08:00
bors
74e35d2700 Auto merge of #57896 - oli-obk:permissive_existence, r=cramertj
Be more permissive with required bounds on existential types

fixes  #54184

r? @pnkfelix
2019-02-19 15:30:38 +00:00
Simon Sapin
3906cb9187 Stabilize iter::from_fn
FCP: https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234
2019-02-19 14:10:07 +01:00
Simon Sapin
95d2795907 Stabilize iter::successors
FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773
2019-02-19 13:58:55 +01:00
Guillaume Gomez
31ee20db3e Add missing fmt structs examples 2019-02-19 11:20:00 +01:00
Guillaume Gomez
b53305df7f Fix tables display 2019-02-19 11:07:16 +01:00
bors
4d66b7b76d Auto merge of #58571 - Manishearth:rustup, r=Manishearth
Update clippy, RLS, and rustfmt

moved from https://github.com/rust-lang/rust/pull/58337
2019-02-19 10:06:55 +00:00
Manish Goregaokar
cd99bd3a3d Update clippy to rust-lang/rust-clippy@d61b25419b 2019-02-19 13:36:31 +05:30
bors
fcccf06fc9 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
2019-02-19 07:27:39 +00:00
kenta7777
94b6bf240a reduced some code repetitions. 2019-02-19 16:23:03 +09:00
Benjamin Peterson
b96d6fb4b3 Fix a transposition in driver.rs. 2019-02-18 17:33:52 -08:00
bors
32471f7ea4 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
2019-02-19 00:46:12 +00:00
Thomas Eizinger
75c541f228 Fix typo in std::future::Future docs 2019-02-19 09:36:41 +11:00
Dan Robertson
f8b6449f80
Fix style nits
Fix style nits discovered in reading code.
2019-02-18 22:22:19 +00:00
bors
c61b92beaa 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
2019-02-18 22:03:41 +00:00
Aaron Stillwell
c9fbcc1f39 Fixed doc example for Path::with_capacity 2019-02-18 17:42:07 +00:00
bors
146aa60f34 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
2019-02-18 17:34:14 +00:00
Pietro Albini
2b2045d161
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.
2019-02-18 15:28:10 +01:00
flip1995
4c228cc9b8
Update Cargo.lock 2019-02-18 10:32:58 +01:00
flip1995
4f96a03ab3
Add constant_time_eq to license exception list of tidy tool 2019-02-18 10:32:00 +01:00
flip1995
919b3f9da3
Update Cargo.toml of rustc-workspace-hack 2019-02-18 10:31:59 +01:00
flip1995
5f483570a0
Update rustfmt to rust-lang/rustfmt@d6829d 2019-02-18 10:31:59 +01:00
flip1995
ed17700018
Update RLS to rust-lang/rls@0d6f53 2019-02-18 10:31:59 +01:00