Commit Graph

90050 Commits

Author SHA1 Message Date
bors
0e25a6829c Auto merge of #58535 - RalfJung:miri, r=oli-obk
update miri

r? @oli-obk

Fixes https://github.com/rust-lang/rust/issues/58558
2019-02-21 11:44:16 +00:00
Ralf Jung
59bdb31c89 final pin projections tweaking 2019-02-21 10:21:59 +01:00
Ralf Jung
c9ade6a577 more pin projections tweaking 2019-02-21 09:57:29 +01:00
Alex Gurganus
6a5abea709 Remove braces from most E0505 examples
The solution which uses braces to release the borrow
before it is moved is only required to satisfy the 2015
edition borrow checker.

All other examples give the expected results for both
2015 and 2018 editions.
2019-02-20 16:12:28 -06: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
Stjepan Glavina
102436d16a Put Future trait into spotlight 2019-02-20 22:06:30 +01:00
Alex Gurganus
b2a02c8d4a Fixes #58586: Make E0505 explain example fail for 2018 edition 2019-02-20 14:46:42 -06:00
Ralf Jung
1b556f16c9 expand pinning projections 2019-02-20 19:38:28 +01:00
gnzlbg
103ed0c347 Search for target_triple.json only if builtin target not found
Before this commit, if the builtin target was found, but an error
happened when instantiating it (e.g. validating the target
specification file failed, etc.), then we ignored those errors
and proceeded to try to find a `target_triple.json` file, and if
that failed, reported that as an error.

With this commit, if rustc is supposed to provide the builtin target,
and something fails while instantiating it, that error will
get properly propagated.
2019-02-20 19:37:54 +01:00
Ralf Jung
06b2affa78 tweak pinning projections 2019-02-20 18:28:12 +01:00
Andre Bogus
8cf3605c50 fix typo 2019-02-20 17:59:17 +01:00
Pietro Albini
703e2361f0
ci: switch appveyor to gce builders to try debugging the 259 failure 2019-02-20 17:01:29 +01:00
Santiago Pastorino
a12982cdc2
Run rustfmt 2019-02-20 12:15:27 -03:00
Santiago Pastorino
801c3f060f
Fix erroneous loop diagnostic in nll
This commit fixes the logic of detecting when a use happen in a later
iteration of where a borrow was defined

Fixes #53773
2019-02-20 12:15:08 -03:00
Santiago Pastorino
cbc865defd
Use successor_within_block helper 2019-02-20 11:49:18 -03:00
Dale Wijnand
ad096d1a0e
Dedup a rustdoc diagnostic construction 2019-02-20 14:07:07 +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
Ralf Jung
c52560d788 tweaks 2019-02-20 09:45:28 +01:00
Aleksey Kladov
65622e319e cleanup macro after 2018 transition
We can now use `?`
2019-02-20 10:10:11 +03:00
Aleksey Kladov
abb07c42ec remove a bit of dead code 2019-02-20 09:49:52 +03: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
Eric Huss
158f074b08 Update cargo 2019-02-19 17:59:32 -08:00
Ralf Jung
7f5d50e475 update miri 2019-02-19 21:54:49 +01:00
Ralf Jung
7596a10225 update Cargo.lock and miri URL 2019-02-19 21:54:49 +01:00
Ralf Jung
5cf0d7b5f8 update miri 2019-02-19 21:54:49 +01:00
Ralf Jung
9c241aa714 expand Unpin example 2019-02-19 21:27:48 +01:00
Ralf Jung
d5df8a49d7 improve wording 2019-02-19 21:25:39 +01:00
Ralf Jung
2c6981a315 improve linked list -> drop transition 2019-02-19 21:23:53 +01:00