Commit Graph

90007 Commits

Author SHA1 Message Date
Ralf Jung
ac2284b80b expand type name 2019-02-23 16:18:50 +01:00
Mazdak Farrokhzad
53c0275882
Apply suggestions from code review
Co-Authored-By: RalfJung <post@ralfj.de>
2019-02-23 16:17:07 +01:00
Ralf Jung
aa4a9b0827 make MaybeUninit Copy 2019-02-22 23:06:03 +01:00
Ralf Jung
d10366fe27 avoid unnecessary use of MaybeUninit::get_ref, and expand comment on the others 2019-02-22 23:05:58 +01:00
Ralf Jung
084ee7a875 examples for MaybeUninit::zeroed 2019-02-22 22:37:54 +01:00
Ralf Jung
48aa59e74d examples for as[_mut]_ptr 2019-02-22 22:37:54 +01:00
Ralf Jung
10f511daa0 misc tweaks 2019-02-22 22:37:54 +01:00
Ralf Jung
dc570fb3f2 also add examples to MaybeUninit::into_initialized 2019-02-22 22:37:54 +01:00
Ralf Jung
13ffbee173 Add MaybeUninit::read_uninitialized
Also remove a no-longer accurate comments
2019-02-22 22:37:50 +01:00
bors
e1c6d00574 Auto merge of #57997 - nitnelave:master, r=RalfJung
Wrap write_bytes in a function. Move docs

This will allow us to add debug assertions.
See issue #53871.
2019-02-22 13:52:41 +00:00
bors
1005f3bac7 Auto merge of #56113 - spastorino:erroneous-loop-diagnostic-in-nll, r=pnkfelix
Erroneous loop diagnostic in nll

Closes #53773

r? @nikomatsakis
2019-02-22 06:52:39 +00:00
bors
c6fd02772b Auto merge of #58574 - RalfJung:pin, r=Mark-Simulacrum
improve Pin documentation

Incorporates a bunch of the documentation-related comments that came up when discussing `Pin` stabilization.

Cc @alexcrichton @withoutboats @cramertj @jonhoo

Fixes https://github.com/rust-lang/rust/issues/58130
2019-02-22 04:11:23 +00:00
bors
d1f8970bd1 Auto merge of #58616 - vertexclique:destabilize-fixed-width-atomic-integers, r=dtolnay
Destabilize fixed-width const defined atomic integers

With this PR version 1.34.0 onwards const declarations of atomic integers will be unstable.

* Closes https://github.com/rust-lang/rust/issues/58089
* Reverts partially: https://github.com/rust-lang/rust/pull/57425
2019-02-22 01:29:34 +00:00
Ralf Jung
497439c199 take a bit more space for new_unchecked examples 2019-02-21 23:13:49 +01:00
bors
8a1d0defdf Auto merge of #58592 - nikomatsakis:universe-leak-check, r=aturon
Re-implement leak check in terms of universes

This PR temporarily restores the leak-check, but implemented in terms of universes. This is not because the leak check behavior was necessarily **correct**, but because (a) we may want to have a transition period and because (b) we want to have more breathing room to work through the full implications of handling higher-ranked types correctly. Note that this PR builds atop https://github.com/rust-lang/rust/pull/58056.

Fixes #58451
Fixes #46989
Fixes #57639

r? @aturon
cc @arielb1, @lqd

~~Temporary note: I've not finished running `./x.py test` locally -- I'm confident a lot of error messages in tests will need updating. I sort of expect them to revert to the older, (imo) less good error messages, which is mildly unfortunate. There might be a way to preserve the new error messages, not sure.~~
2019-02-21 21:35:21 +00:00
Niko Matsakis
33d3598e3b partially revert 904a0bde93
This preserves the error you currently get on stable for the
old-lub-glb-object.rs test.
2019-02-21 12:50:13 -05:00
bors
633d75ac17 Auto merge of #58584 - ehuss:update-cargo, r=alexcrichton
Update cargo

9 commits in 865cb70106a6b1171a500ff68f93ab52eea56e72..b33ce7fc9092962b0657b4c25354984b5e5c47e4
2019-02-10 15:49:37 +0000 to 2019-02-19 18:42:50 +0000
- Don't retry invalid credentials from git credential helpers (rust-lang/cargo#6681)
- Fix some typos in resolver tests (rust-lang/cargo#6682)
- Add an unstable option to build proc macros for both the host and the target (rust-lang/cargo#6547)
- Test cases proving RUSTC_WRAPPER can be a relative path (rust-lang/cargo#6638)
- Add support for Azure DevOps (rust-lang/cargo#6264)
- Update docs for removed `patch` restriction. (rust-lang/cargo#6663)
- Fix incorrect help message (rust-lang/cargo#6555)
- Stabilize Alternative Registries (rust-lang/cargo#6654)
- Having a [patch] section when publishing is not an error (rust-lang/cargo#6535)
2019-02-21 17:18:53 +00:00
Niko Matsakis
21e9478366 update test files to reflect new output
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-21 11:32:17 -05:00
Niko Matsakis
561ce442de restore the actual leak-check 2019-02-21 11:32:17 -05:00
Niko Matsakis
0c94ea0bf1 introduce a dummy leak check and invoke it in all the right places
This set of diffs was produced by combing through
b68fad670b and seeing where the
`leak_check` used to be invoked and how.
2019-02-21 11:32:17 -05:00
Niko Matsakis
2cbe07b5b3 reintroduce commit_if_ok calls to subtype_predicate 2019-02-21 11:32:17 -05:00
Niko Matsakis
6cb4ffbe14 reintroduce commit_if_ok call into higher_ranked_sub 2019-02-21 11:32:17 -05:00
Niko Matsakis
3cd286bac2 s/skol_/placeholder_/ 2019-02-21 11:32:17 -05:00
Ralf Jung
811af4289c fix link 2019-02-21 17:18:18 +01:00
Ralf Jung
32a9614a4e this is for you, tidy 2019-02-21 16:05:49 +01:00
bors
fd42f24b01 Auto merge of #58597 - pietroalbini:appveyor-gce, r=alexcrichton
ci: switch appveyor to gce builders to try debugging the 259 failure

r? @alexcrichton
2019-02-21 14:34:49 +00:00
Ralf Jung
6b88007473 explain unsafe 2019-02-21 15:33:55 +01:00
Ralf Jung
bcc55e5e79 we only list some examples of basic types 2019-02-21 15:31:09 +01:00
Ralf Jung
2db0e0d65c tweaks and fix weird space 2019-02-21 15:30:31 +01:00
Mazdak Farrokhzad
e61a8a94f7
Apply suggestions from code review
Co-Authored-By: RalfJung <post@ralfj.de>
2019-02-21 15:28:46 +01:00
Mahmut Bulut
99d67ca3b8
Destabilize fixed-width const defined atomic integers
* With this PR 1.34.0 onwards const declarations of atomic integers will be
  unstable.
2019-02-21 13:57:51 +01:00
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
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
Ralf Jung
1b556f16c9 expand pinning projections 2019-02-20 19:38:28 +01:00
Ralf Jung
06b2affa78 tweak pinning projections 2019-02-20 18:28:12 +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
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
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