]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #50783 - pnkfelix:issue-27282-match-borrows-its-input-take-three, r...
bors [Wed, 30 May 2018 02:11:59 +0000 (02:11 +0000)]
Auto merge of #50783 - pnkfelix:issue-27282-match-borrows-its-input-take-three, r=nikomatsakis

every match arm reads the match's borrowed input

This PR changes the `match` codegen under NLL (and just NLL, at least for now) to make the following adjustments:
 * It adds a `-Z disable-ast-check-for-mutation-in-guard` which, as described, turns off the naive (conservative but also not 100% sound) check for mutation in guards of match arms.
 * We now borrow the match input at the outset and emit a special `ReadForMatch` statement (that, according to the *static* semantics, reads that borrowed match input) at the start of each match arm. The intent here is to catch cases where the match guard mutates the match input, either via an independent borrow or via `ref mut` borrows in that arm's pattern.
 * In order to ensure that `ref mut` borrows do not actually conflict with the emitted `ReadForMatch` statements, I expanded the two-phase-borrow system slightly, and also changed the MIR code gen so that under NLL, when there is a guard on a match arm, then each pattern variable ends up having *three* temporaries associated with it:
   1. The first temporary will hold the substructure being matched; this is what we will move the (substructural) value into *if* the guard succeeds.
   2. The second temporary also corresponds to the same value as the first, but we are just constructing this temporarily for use during the scope of the guard; it is unaliased and its sole referrer is the third temporary.
   3. The third temporary is a reference to the second temporary.
   * (This sounds complicated, I know, but its actually *simpler* than what I was doing before and had checked into the repo, which was to sometimes construct the final value and then take a reference to it before evaluating the guard. See also PR #49870.)

Fix #27282

This also provides a path towards resolving #24535 aka rust-lang/rfcs#1006, at least once the `-Z disable-ast-check-for-mutation-in-guard` is just turned on by default (under NLL, that is. It is not sound under AST-borrowck).
 * But I did not want to make `#![feature(nll)]` imply that as part of this PR; that seemed like too drastic a change to me.

6 years agoAuto merge of #50772 - nicokoch:fastcopy, r=alexcrichton
bors [Tue, 29 May 2018 23:49:11 +0000 (23:49 +0000)]
Auto merge of #50772 - nicokoch:fastcopy, r=alexcrichton

fs: copy: use copy_file_range on Linux

Linux 4.5 introduced a new system call [copy_file_range](http://man7.org/linux/man-pages/man2/copy_file_range.2.html) to copy data from one file to another.

This PR uses the new system call (if available). This has several advantages:

1. No need to constantly copy data from userspace to kernel space, if the buffer is small or the file is large
2. On some filesystems, like BTRFS, the kernel can leverage internal fs mechanisms for huge performance gains
3. Filesystems on the network dont need to copy data between the host and the client machine (they have to in the current read/write implementation)

I have created a small library that also implements the new system call for some huge performance gains here: https://github.com/nicokoch/fastcopy
Benchmark results are in the README

6 years agoFix additional nits:
Nicolas Koch [Tue, 29 May 2018 21:42:42 +0000 (23:42 +0200)]
Fix additional nits:
  - compute bytes_to_copy more elegantly
  - add assert that written is 0 in fallback case

6 years agoReview feedback: Adding test cases suggested by arielb1.
Felix S. Klock II [Wed, 23 May 2018 09:21:01 +0000 (11:21 +0200)]
Review feedback: Adding test cases suggested by arielb1.

6 years agoReview feedback: Fix typo.
Felix S. Klock II [Tue, 22 May 2018 14:50:03 +0000 (16:50 +0200)]
Review feedback: Fix typo.

6 years agoReview feedback, remove fixme comment.
Felix S. Klock II [Tue, 22 May 2018 14:48:43 +0000 (16:48 +0200)]
Review feedback, remove fixme comment.

6 years agoReview feedback: Remove a fixme/tbd note and just add a note for the post-NLL future.
Felix S. Klock II [Tue, 22 May 2018 14:45:21 +0000 (16:45 +0200)]
Review feedback: Remove a fixme/tbd note and just add a note for the post-NLL future.

Driveby: just inline the two-line `fn inject_borrow` into its one call
site and remove its definition.

6 years agoReview feedback: update fixme comment to reflect reality.
Felix S. Klock II [Tue, 22 May 2018 13:05:02 +0000 (15:05 +0200)]
Review feedback: update fixme comment to reflect reality.

6 years agoreview feedback: fix indentation of pattern candidates to match code elsewhere in...
Felix S. Klock II [Tue, 22 May 2018 13:03:40 +0000 (15:03 +0200)]
review feedback: fix indentation of pattern candidates to match code elsewhere in file.

6 years agoTests illustrating the bug fixes for #27282 and #24535.
Felix S. Klock II [Tue, 15 May 2018 21:23:00 +0000 (23:23 +0200)]
Tests illustrating the bug fixes for #27282 and #24535.

6 years agoTest update: Fallout from ReadForMatch statements + changes to codegen under NLL.
Felix S. Klock II [Wed, 9 May 2018 11:16:43 +0000 (13:16 +0200)]
Test update: Fallout from ReadForMatch statements + changes to codegen under NLL.

6 years agoExpand two-phase-borrows so that a case like this still compiles:
Felix S. Klock II [Fri, 11 May 2018 21:32:13 +0000 (23:32 +0200)]
Expand two-phase-borrows so that a case like this still compiles:

```rust
fn main() {
    fn reuse<X>(_: &mut X) {}
    let mut t = 2f64;
    match t {
        ref mut _b if { false } => { reuse(_b); }
        _ => {}
    }
}
```

Note: The way this is currently written is confusing; when `autoref`
is off, then the arm body bindings (introduced by
`bind_matched_candidate_for_arm_body`) are *also* used for the guard.
(Any attempt to fix this needs to still ensure that the bindings used
by the guard are introduced before the guard is evaluated.)

(Once we turn NLL on by default, we can presumably simplify all of
that.)

6 years agoFallout from allowing some mutation in guards.
Felix S. Klock II [Mon, 7 May 2018 13:58:09 +0000 (15:58 +0200)]
Fallout from allowing some mutation in guards.

For some reason, allowing restricted mutation in match arms exposed an
obvious case where a unique borrow can indeed fail, namely something
like:

```rust
match b {
    ...
    ref mut r if { (|| { let bar = &mut *r; **bar = false; })(); false } => { &mut *r }
    //                             ~~~~~~~
    //                                |
    // This ends up holding a `&unique` borrow of `r`, but there ends up being an
    // implicit shared borrow in the guard thanks to rust-lang/rust#49870
    ...
}
```

6 years agorust-lang/rust#41962 has a new error with my new code. Incorporate that into my code.
Felix S. Klock II [Wed, 9 May 2018 15:17:58 +0000 (17:17 +0200)]
rust-lang/rust#41962 has a new error with my new code. Incorporate that into my code.

In particular, I am adding an implicit injected borrow on the pattern
matches, and when we go around the loop, the compiler is reporting
that this injected borrow is conflicting with the move of the original
value when the match succeeds.

6 years agorust-lang/rust#27282: emit `ReadForMatch` on each match arm.
Felix S. Klock II [Fri, 4 May 2018 10:05:10 +0000 (12:05 +0200)]
rust-lang/rust#27282: emit `ReadForMatch` on each match arm.

Also, turn on ReadForMatch emission by default (when using NLL).

6 years agorust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.
Felix S. Klock II [Fri, 4 May 2018 10:04:33 +0000 (12:04 +0200)]
rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.

(This is just the data structure changes and some boilerplate match
code that followed from it; the actual emission of these statements
comes in a follow-up commit.)

6 years agoDebug flag to bypass restriction of mutation in match guards.
Felix S. Klock II [Mon, 7 May 2018 13:54:41 +0000 (15:54 +0200)]
Debug flag to bypass restriction of mutation in match guards.

Now, if you pass `-Z disable-ast-check-for-mutation-in-guard`, then we
will just allow you to mutably-borrow and assign in guards of `match`
arms.

This is wildly unsound with AST-borrowck. It is also unsound with
MIR-borrowck without further adjustments, which come in later in the
commit series on this Pull Request.

See also rust-lang/rust#24535 and rust-lang/rfcs#1006.

6 years agoAuto merge of #51165 - SimonSapin:opt2, r=alexcrichton
bors [Tue, 29 May 2018 17:17:53 +0000 (17:17 +0000)]
Auto merge of #51165 - SimonSapin:opt2, r=alexcrichton

Revert "Set opt-level to 3"

This reverts commit aad9840ad49c56830384e87bc8bd87fd0199dc44.

Level 3 (possibly indirectly, the underlying bug might be in XCode’s linker) causes unit tests to sefault when compiled with some versions of XCode: https://github.com/rust-lang/rust/issues/50867

It also appears to cause some segfaults on Windows: https://github.com/rust-lang/rust/pull/50329#issuecomment-386853473, and regressions in some rustc performance benchmarks: https://github.com/rust-lang/rust/pull/50329#issuecomment-388084894

6 years agoChange the comment on `opt-level = 2` to point to https://github.com/rust-lang/rust...
Simon Sapin [Tue, 29 May 2018 15:38:23 +0000 (17:38 +0200)]
Change the comment on `opt-level = 2` to point to https://github.com/rust-lang/rust/issues/50867

6 years agoAuto merge of #51133 - spastorino:make_borrowck_use_output, r=nikomatsakis
bors [Tue, 29 May 2018 15:02:39 +0000 (15:02 +0000)]
Auto merge of #51133 - spastorino:make_borrowck_use_output, r=nikomatsakis

Make borrowck use polonius output

6 years agoWIP fix rustc-hash cargo.lock entry for polonius-engine
Niko Matsakis [Tue, 29 May 2018 13:36:45 +0000 (09:36 -0400)]
WIP fix rustc-hash cargo.lock entry for polonius-engine

6 years agoWhitelist datafrog on tidy
Santiago Pastorino [Mon, 28 May 2018 16:54:11 +0000 (13:54 -0300)]
Whitelist datafrog on tidy

6 years agoRun rustfmt
Santiago Pastorino [Mon, 28 May 2018 16:47:20 +0000 (13:47 -0300)]
Run rustfmt

6 years agoUse polonius_output
Santiago Pastorino [Tue, 29 May 2018 11:54:15 +0000 (08:54 -0300)]
Use polonius_output

6 years agostore output in FlowState
Douglas Campos [Sat, 26 May 2018 01:38:50 +0000 (01:38 +0000)]
store output in FlowState

6 years agostore polonius output in MirBorrowCtx
Douglas Campos [Sat, 26 May 2018 01:14:45 +0000 (01:14 +0000)]
store polonius output in MirBorrowCtx

6 years agoit compiles, but we do not use the output yet
Douglas Campos [Fri, 25 May 2018 23:07:33 +0000 (23:07 +0000)]
it compiles, but we do not use the output yet

6 years agoexpose -Zpolonius flag
Douglas Campos [Fri, 25 May 2018 22:17:04 +0000 (22:17 +0000)]
expose -Zpolonius flag

6 years agobump polonius engine
Douglas Campos [Tue, 29 May 2018 11:52:51 +0000 (08:52 -0300)]
bump polonius engine

6 years agoAuto merge of #51134 - RalfJung:from_raw_parts, r=SimonSapin
bors [Tue, 29 May 2018 12:50:06 +0000 (12:50 +0000)]
Auto merge of #51134 - RalfJung:from_raw_parts, r=SimonSapin

extend from_raw_parts docs for slices and strs to mention alignment requirement

The documentation for `str::from_raw_parts_mut` seems to not be visible because that method is private, bit I figured it could still be fixed. I also removed the reference to the no-longer-existing `str::from_raw_parts` while I was at it.

Alternatively, should I remove `str::from_raw_parts_mut` completely? it is only used in `str::split_at_mut`, where it might as well be inlined.

6 years agoRevert "Set opt-level to 3"
Simon Sapin [Tue, 29 May 2018 12:44:42 +0000 (14:44 +0200)]
Revert "Set opt-level to 3"

This reverts commit aad9840ad49c56830384e87bc8bd87fd0199dc44.

Level 3 (possibly indirectly, the underlying bug might be in XCode’s linker)
causes unit tests to sefault when compiled with some versions of XCode:
https://github.com/rust-lang/rust/issues/50867

It also appears to cause some segfaults on Windows:
https://github.com/rust-lang/rust/pull/50329#issuecomment-386853473

… and regressions in some rustc performance benchmarks:
https://github.com/rust-lang/rust/pull/50329#issuecomment-388084894

6 years agoAuto merge of #51019 - Zoxc:hash-bytes, r=michaelwoerister
bors [Tue, 29 May 2018 10:18:35 +0000 (10:18 +0000)]
Auto merge of #51019 - Zoxc:hash-bytes, r=michaelwoerister

Hash up to 8 bytes at once with FxHasher

r? @michaelwoerister

6 years agoAuto merge of #51142 - nickbabcock:doc-inspect, r=frewsxcv
bors [Tue, 29 May 2018 06:50:12 +0000 (06:50 +0000)]
Auto merge of #51142 - nickbabcock:doc-inspect, r=frewsxcv

Document additional use case for iter::inspect

Adds docs for `iter::inspect` showing the non-debug use case

Closes #49564

6 years agoAuto merge of #51144 - tmccombs:unix-epoch-stable, r=Mark-Simulacrum
bors [Tue, 29 May 2018 03:22:20 +0000 (03:22 +0000)]
Auto merge of #51144 - tmccombs:unix-epoch-stable, r=Mark-Simulacrum

Stabilize SystemTime::UNIX_EPOCH

Fixes #49502

6 years agoAuto merge of #50475 - csmoe:debr, r=nikomatsakis
bors [Tue, 29 May 2018 01:11:24 +0000 (01:11 +0000)]
Auto merge of #50475 - csmoe:debr, r=nikomatsakis

Refactor DebruijnIndex to be 0-based

Fixes #49813

6 years agoStabilize SystemTime::UNIX_EPOCH
Thayne McCombs [Tue, 29 May 2018 00:24:01 +0000 (18:24 -0600)]
Stabilize SystemTime::UNIX_EPOCH

6 years agoDocument additional use case for iter::inspect
Nick Babcock [Mon, 28 May 2018 23:50:16 +0000 (18:50 -0500)]
Document additional use case for iter::inspect

6 years agochange to 0-based indices
Niko Matsakis [Mon, 28 May 2018 17:19:04 +0000 (13:19 -0400)]
change to 0-based indices

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agomake depth private
Niko Matsakis [Mon, 28 May 2018 16:56:56 +0000 (12:56 -0400)]
make depth private

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoremove use of depth from `TyS` and replace with a debruijn index
Niko Matsakis [Mon, 28 May 2018 16:38:39 +0000 (12:38 -0400)]
remove use of depth from `TyS` and replace with a debruijn index

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoreplace `binder_depth` in `LateBoundRegionsDetector`
Niko Matsakis [Mon, 28 May 2018 14:43:54 +0000 (10:43 -0400)]
replace `binder_depth` in `LateBoundRegionsDetector`

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoconvert `LateBoundRegionsCollector` to track a debruijn index
Niko Matsakis [Mon, 28 May 2018 14:24:01 +0000 (10:24 -0400)]
convert `LateBoundRegionsCollector` to track a debruijn index

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoreplace use of DebruijnIndex in `for_each_free_region`
Niko Matsakis [Mon, 28 May 2018 14:13:21 +0000 (10:13 -0400)]
replace use of DebruijnIndex in `for_each_free_region`

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agorefactor `resolve_lifetime` to track outer-index, not depth
Niko Matsakis [Mon, 28 May 2018 13:53:10 +0000 (09:53 -0400)]
refactor `resolve_lifetime` to track outer-index, not depth

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agorewrite the hasher to not access `depth` field
Niko Matsakis [Mon, 28 May 2018 13:52:53 +0000 (09:52 -0400)]
rewrite the hasher to not access `depth` field

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoport `nice_region_error` code to not track depth but rather index
Niko Matsakis [Fri, 25 May 2018 15:12:38 +0000 (11:12 -0400)]
port `nice_region_error` code to not track depth but rather index

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agostop invoking `DebruijnIndex::new` directly
Niko Matsakis [Fri, 25 May 2018 14:41:01 +0000 (10:41 -0400)]
stop invoking `DebruijnIndex::new` directly

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agomake `shifted_in` and `shifted_out` const fns
Niko Matsakis [Fri, 25 May 2018 14:37:38 +0000 (10:37 -0400)]
make `shifted_in` and `shifted_out` const fns

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoport `fold_regions` and friends to use debruijn indices directly
Niko Matsakis [Fri, 25 May 2018 13:58:29 +0000 (09:58 -0400)]
port `fold_regions` and friends to use debruijn indices directly

They no longer talk about plain integers.

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoAuto merge of #50465 - clarcharr:wrapping, r=KodrAus
bors [Mon, 28 May 2018 22:28:43 +0000 (22:28 +0000)]
Auto merge of #50465 - clarcharr:wrapping, r=KodrAus

Add missing Wrapping methods, use doc_comment!

Re-opened version of #49393 . Finishing touches for #32463.

Note that this adds `Shl` and `Shr` implementations for `Wrapping<i128>` and `Wrapping<u128>`, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.

6 years agoget rid of str::from_raw_parts_mut
Ralf Jung [Mon, 28 May 2018 20:04:50 +0000 (22:04 +0200)]
get rid of str::from_raw_parts_mut

str::from_raw_parts has been removed long ago because it can be obtained via
str::from_utf8_unchecked and slice::from_raw_parts.  The same goes for
str::from_raw_parts_mut.

6 years agoAuto merge of #50929 - zackmdavis:hiridification_initiative, r=michaelwoerister
bors [Mon, 28 May 2018 19:16:27 +0000 (19:16 +0000)]
Auto merge of #50929 - zackmdavis:hiridification_initiative, r=michaelwoerister

operate on `HirId` instead of `NodeId` in `hir::Pat::each_binding`, and consequences of that

See #50928 for motivation.

Questions—

 * Is #50928 actually a good idea as a plan of record, or is there some reason to keep `NodeId`s?
 * Are the uses of `find_node_for_hir_id` in this initial submission OK (see the FIXME comments)?
 * Can we bikeshed a better method names `struct_span_lint_hir` _&c._? (Coined in analogy to the `struct_span_lint_node` and `NodeId`, but it feels kind of semantically clunky.)

r? @michaelwoerister

6 years agoUpdate rustc-hash to hash up to 8 bytes at once with FxHasher
John Kåre Alsaker [Thu, 24 May 2018 03:37:40 +0000 (05:37 +0200)]
Update rustc-hash to hash up to 8 bytes at once with FxHasher

6 years agointroduce `shifted_in`, `shifted_out` and friends
Niko Matsakis [Fri, 25 May 2018 13:06:54 +0000 (09:06 -0400)]
introduce `shifted_in`, `shifted_out` and friends

Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
6 years agoAuto merge of #50521 - gnzlbg:simd_float, r=alexcrichton
bors [Mon, 28 May 2018 16:54:44 +0000 (16:54 +0000)]
Auto merge of #50521 - gnzlbg:simd_float, r=alexcrichton

Add simd math intrinsics and gather/scatter

This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.

6 years agoextend from_raw_parts docs for slices and strs to mention alignment requirement
Ralf Jung [Mon, 28 May 2018 16:27:26 +0000 (18:27 +0200)]
extend from_raw_parts docs for slices and strs to mention alignment requirement

6 years agoscrap `find_node_for_hir_id` in favor of `hir_to_node_id`
Zack M. Davis [Sun, 27 May 2018 00:30:26 +0000 (17:30 -0700)]
scrap `find_node_for_hir_id` in favor of `hir_to_node_id`

Michael Woerister pointed out that `hir_to_node_id` (introduced in
August 2017's 28ddd7a4e) supersedes the functionality of
`find_node_for_hir_id` (just a hash lookup compared to that linear
search).

6 years agoin which `NodeMap` and friends are macrotized!
Zack M. Davis [Mon, 21 May 2018 06:15:07 +0000 (23:15 -0700)]
in which `NodeMap` and friends are macrotized!

6 years agooperate on `HirId` in `hir::Pat::each_binding`, and consequences of that
Zack M. Davis [Mon, 21 May 2018 03:19:34 +0000 (20:19 -0700)]
operate on `HirId` in `hir::Pat::each_binding`, and consequences of that

Changing the `each_binding` utility method to take the `HirId` of a
binding pattern rather than its `NodeId` seems like a modest first step
in support of the `HirId`ification initiative #50928. (The inspiration
for choosing this in particular came from the present author's previous
work on diagnostics issued during liveness analysis, which is the most
greatly affected module in this change.)

6 years agoUse FIXME instead of TODO; Move bytes_to_copy calculation inside if
Nicolas Koch [Mon, 28 May 2018 15:19:42 +0000 (17:19 +0200)]
Use FIXME instead of TODO; Move bytes_to_copy calculation inside if
branch

6 years agoAuto merge of #51121 - Manishearth:rust-syntax, r=killercup
bors [Mon, 28 May 2018 14:45:46 +0000 (14:45 +0000)]
Auto merge of #51121 - Manishearth:rust-syntax, r=killercup

Mark .fixed files as Rust syntax for GitHub

r? @killercup

6 years agoAuto merge of #51118 - nrc:update, r=oli-obk
bors [Mon, 28 May 2018 12:39:03 +0000 (12:39 +0000)]
Auto merge of #51118 - nrc:update, r=oli-obk

Update RLS, Rustfmt, and Cargo

r? @Mark-Simulacrum

Should fix broken rustfmt and RLS builds - Cargo update is needed for compatibility with RLS

6 years agoAuto merge of #50724 - zackmdavis:applicability_rush, r=Manishearth
bors [Mon, 28 May 2018 10:11:26 +0000 (10:11 +0000)]
Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearth

add suggestion applicabilities to librustc and libsyntax

A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means).

r? @Manishearth
cc @killercup @estebank

6 years agoMark .fixed files as Rust syntax for GitHub
Manish Goregaokar [Mon, 28 May 2018 09:36:13 +0000 (11:36 +0200)]
Mark .fixed files as Rust syntax for GitHub

6 years agoAuto merge of #50612 - Zoxc:thin-slice, r=michaelwoerister
bors [Mon, 28 May 2018 07:59:21 +0000 (07:59 +0000)]
Auto merge of #50612 - Zoxc:thin-slice, r=michaelwoerister

Make &Slice a thin pointer

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

r? @michaelwoerister

6 years agoUpdate RLS, Rustfmt, and Cargo
Nick Cameron [Sun, 27 May 2018 22:16:42 +0000 (10:16 +1200)]
Update RLS, Rustfmt, and Cargo

6 years agoAuto merge of #50892 - davidtwco:issue-50004, r=alexcrichton
bors [Mon, 28 May 2018 01:28:14 +0000 (01:28 +0000)]
Auto merge of #50892 - davidtwco:issue-50004, r=alexcrichton

Added rustdoc documentation to compiler docs.

Fixes #50004.

r? @alexcrichton
(since you reviewed the last PR about compiler docs)

6 years agoAuto merge of #48309 - mark-i-m:anon_param_lint, r=nikomatsakis
bors [Sun, 27 May 2018 22:28:11 +0000 (22:28 +0000)]
Auto merge of #48309 - mark-i-m:anon_param_lint, r=nikomatsakis

Make anon params lint warn-by-default

This is intended as a followup on anonymous parameters deprecation.

Cross-posting from #41686:

> After having read a bit more of the discussion that I can find, I propose a more aggressive deprecation strategy:
> - We make the lint warn-by-default as soon as possible
> - We make anon parameters a hard error at the epoch boundary

cc @matklad @est31 @aturon

6 years agoAuto merge of #51062 - mati865:cargo_update, r=alexcrichton
bors [Sun, 27 May 2018 20:27:48 +0000 (20:27 +0000)]
Auto merge of #51062 - mati865:cargo_update, r=alexcrichton

Update cargo

There are few nice fixes waiting already.

6 years agoMake anon params lint warn-by-default
Mark Mansi [Sat, 17 Feb 2018 23:33:27 +0000 (17:33 -0600)]
Make anon params lint warn-by-default

6 years agoAuto merge of #51108 - simartin:issue_51022_follow-up, r=estebank
bors [Sun, 27 May 2018 18:08:26 +0000 (18:08 +0000)]
Auto merge of #51108 - simartin:issue_51022_follow-up, r=estebank

Address comments in pull request #51084.

This is a follow-up to https://github.com/rust-lang/rust/pull/51084, that's already been integrated into mainline.

6 years agoAuto merge of #51078 - GuillaumeGomez:stabilize-formatter, r=SimonSapin
bors [Sun, 27 May 2018 16:01:32 +0000 (16:01 +0000)]
Auto merge of #51078 - GuillaumeGomez:stabilize-formatter, r=SimonSapin

Stabilize Formatter alignment

Fixes #27726.

cc @SimonSapin

6 years agoAdd fields to Slice
John Kåre Alsaker [Thu, 24 May 2018 11:07:27 +0000 (13:07 +0200)]
Add fields to Slice

6 years agoAdd assertions for TyS and TypeVariants sizes
John Kåre Alsaker [Sun, 27 May 2018 15:13:15 +0000 (17:13 +0200)]
Add assertions for TyS and TypeVariants sizes

6 years agoMake &Slice a thin pointer
John Kåre Alsaker [Wed, 2 May 2018 06:02:57 +0000 (08:02 +0200)]
Make &Slice a thin pointer

6 years agoAddress comments in pull request #51084.
Simon Martin [Sun, 27 May 2018 15:04:27 +0000 (17:04 +0200)]
Address comments in pull request #51084.

6 years agoAuto merge of #51105 - uuttff8:master, r=GuillaumeGomez
bors [Sun, 27 May 2018 13:49:52 +0000 (13:49 +0000)]
Auto merge of #51105 - uuttff8:master, r=GuillaumeGomez

lib.rs don't beautiful

6 years agoStabilize Formatter alignment
Guillaume Gomez [Sat, 26 May 2018 08:41:48 +0000 (10:41 +0200)]
Stabilize Formatter alignment

6 years agoAuto merge of #51101 - 11Takanori:fix-typo, r=frewsxcv
bors [Sun, 27 May 2018 11:43:26 +0000 (11:43 +0000)]
Auto merge of #51101 - 11Takanori:fix-typo, r=frewsxcv

Fix typo in macro_parser.rs

innacurate -> inaccurate

6 years agoAuto merge of #51084 - simartin:issue_51022, r=estebank
bors [Sun, 27 May 2018 09:22:27 +0000 (09:22 +0000)]
Auto merge of #51084 - simartin:issue_51022, r=estebank

Issue #51022: Improve E0131 message when lifetimes are involved.

Fixes #51022

6 years agolib.rs don't beautiful
uuttff8 [Sun, 27 May 2018 08:53:43 +0000 (11:53 +0300)]
lib.rs don't beautiful

6 years agoAuto merge of #51090 - kennytm:tidy-check-missing-tracking-issue, r=alexcrichton
bors [Sun, 27 May 2018 07:02:17 +0000 (07:02 +0000)]
Auto merge of #51090 - kennytm:tidy-check-missing-tracking-issue, r=alexcrichton

Ensure every unstable language feature has a tracking issue.

Filled in the missing numbers:

* `abi_ptx` → #38788
* `generators` → #43122
* `global_allocator` → #27389

Reused existing tracking issues because they were decomposed from a larger feature

* `*_target_feature` → #44839 (reusing the old `target_feature` number)
* `proc_macros_*` → #38356 (reusing the to-be-stabilized `proc_macros` number)

Filed new issues

* `exhaustive_patterns` → #51085
* `pattern_parentheses` → #51087
* `wasm_custom_section` and `wasm_import_module` → #51088

6 years agoEnsure every unstable feature has a tracking issue.
kennytm [Sat, 26 May 2018 15:39:31 +0000 (23:39 +0800)]
Ensure every unstable feature has a tracking issue.

6 years agoAuto merge of #51075 - estebank:and_the_case_of_the_confusable_float_exponent, r...
bors [Sun, 27 May 2018 03:32:47 +0000 (03:32 +0000)]
Auto merge of #51075 - estebank:and_the_case_of_the_confusable_float_exponent, r=eddyb

Check for confusable Unicode chars in float literal exponent

Fixing tests for #49989. Resolves #49746.

6 years agoAuto merge of #51066 - est31:master, r=sfackler
bors [Sun, 27 May 2018 00:54:12 +0000 (00:54 +0000)]
Auto merge of #51066 - est31:master, r=sfackler

Point to the current box syntax tracking issue

The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.

r? @aidanhs

6 years agoinnacurate -> inaccurate
Takanori Ishibashi [Sun, 27 May 2018 00:47:04 +0000 (09:47 +0900)]
innacurate -> inaccurate

6 years agoIssue #51022: Improve E0131 message when lifetimes are involved.
Simon Martin [Sat, 26 May 2018 13:45:45 +0000 (15:45 +0200)]
Issue #51022: Improve E0131 message when lifetimes are involved.

6 years agoUpdate cargo
Mateusz Mikuła [Fri, 25 May 2018 16:38:04 +0000 (18:38 +0200)]
Update cargo

6 years agoAuto merge of #51094 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sat, 26 May 2018 19:05:39 +0000 (19:05 +0000)]
Auto merge of #51094 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 3 pull requests

Successful merges:

 - #51049 (Fix behaviour of divergence in while loop conditions)
 - #51057 (make ui tests robust with respect to NLL)
 - #51092 ([master] Release notes for 1.26.1)

Failed merges:

6 years agoFix test
Esteban Küber [Sat, 26 May 2018 04:57:02 +0000 (21:57 -0700)]
Fix test

6 years agoPoint to the current box syntax tracking issue
est31 [Fri, 25 May 2018 20:37:25 +0000 (22:37 +0200)]
Point to the current box syntax tracking issue

The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.

6 years agoRollup merge of #51092 - Mark-Simulacrum:release-notes-master, r=Mark-Simulacrum
Mark Simulacrum [Sat, 26 May 2018 17:22:55 +0000 (11:22 -0600)]
Rollup merge of #51092 - Mark-Simulacrum:release-notes-master, r=Mark-Simulacrum

[master] Release notes for 1.26.1

None

6 years agoRollup merge of #51057 - pnkfelix:issue-51025-make-ui-tests-robust-wrt-nll, r=nikomat...
Mark Simulacrum [Sat, 26 May 2018 17:22:54 +0000 (11:22 -0600)]
Rollup merge of #51057 - pnkfelix:issue-51025-make-ui-tests-robust-wrt-nll, r=nikomatsakis

make ui tests robust with respect to NLL

This PR revises the `ui` tests that I could quickly identify that:
 1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but
 2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness.

In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict.

(In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.)

----

With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before.

Fix #51025

6 years agoRollup merge of #51049 - varkor:break-while-condition, r=nikomatsakis
Mark Simulacrum [Sat, 26 May 2018 17:22:53 +0000 (11:22 -0600)]
Rollup merge of #51049 - varkor:break-while-condition, r=nikomatsakis

Fix behaviour of divergence in while loop conditions

This fixes `'a: while break 'a {};` being treated as diverging, by tracking break expressions in the same way as in `loop` expressions.

Fixes #50856.

r? @nikomatsakis

6 years agoCopy release notes from stable branch to master
Mark Simulacrum [Sat, 26 May 2018 17:19:21 +0000 (11:19 -0600)]
Copy release notes from stable branch to master

6 years agoAuto merge of #51072 - petrochenkov:ifield, r=eddyb
bors [Sat, 26 May 2018 16:56:22 +0000 (16:56 +0000)]
Auto merge of #51072 - petrochenkov:ifield, r=eddyb

Use `Ident`s for fields in HIR

Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300

6 years agoAuto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkov
bors [Sat, 26 May 2018 14:30:30 +0000 (14:30 +0000)]
Auto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkov

restore emplacement syntax (obsolete)

Fix https://github.com/rust-lang/rust/issues/50832

r? @petrochenkov

6 years agoAdd `Ident::as_str` helper
Vadim Petrochenkov [Sat, 26 May 2018 12:12:38 +0000 (15:12 +0300)]
Add `Ident::as_str` helper

6 years agoAuto merge of #51082 - kennytm:rollup, r=kennytm
bors [Sat, 26 May 2018 12:03:28 +0000 (12:03 +0000)]
Auto merge of #51082 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #50987 (Underline multiple suggested replacements in the same line)
 - #51014 (Add documentation about env! second argument)
 - #51034 (Remove unused lowering field and method)
 - #51047 (Use AllFacts from polonius-engine)
 - #51048 (Add more missing examples for Formatter)
 - #51056 (Mention and use `Once::new` instead of `ONCE_INIT`)
 - #51059 (What does an expression look like, that consists only of special characters?)
 - #51065 (Update nomicon link in transmute docs)
 - #51067 (Add inner links in documentation)
 - #51070 (Fail typecheck if we encounter a bogus break)
 - #51073 (Rename TokenStream::empty to TokenStream::new)

Failed merges:

6 years agoUse `Ident`s for fields in HIR
Vadim Petrochenkov [Fri, 25 May 2018 23:50:15 +0000 (02:50 +0300)]
Use `Ident`s for fields in HIR