Commit Graph

92601 Commits

Author SHA1 Message Date
bors
31f5d69ba4 Auto merge of #60125 - estebank:continue-evaluating, r=oli-obk
Don't stop evaluating due to errors before borrow checking

r? @oli-obk

Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-23 09:38:34 +00:00
gnzlbg
2d401fb4dc Add f16c target_feature 2019-04-23 08:43:13 +02:00
bors
0f11354a9c Auto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm
Disallow double trailing newlines in tidy

This wasn't done previously in https://github.com/rust-lang/rust/pull/47064#issuecomment-354533010 as it affected too many files, but I think it's best to fix it now so that the number of files with double trailing newlines doesn't keep increasing.

r? kennytm
2019-04-23 06:40:12 +00:00
bors
3bee49f42b Auto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus
Fix sync_all on macos/ios

`sync_all` should flush all metadata in macos/ios, so it should call `fcntl` with the `F_FULLFSYNC` flag as `sync_data` does.

Note that without this `sync_data` performs more flushes than `sync_all` on macos/ios.
2019-04-23 03:34:21 +00:00
bors
0550766699 Auto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez
upgrade rustdoc's pulldown-cmark to 0.4.1

Fixes #59194.
2019-04-23 00:44:58 +00:00
Xavier Denis
4a073dda93 Fix #58270, fix off-by-one error in error diagnostics. 2019-04-22 18:14:45 -05:00
Esteban Küber
e3fb331695 Temporarily accept [i|u][32|size] suffixes on a tuple index and warn 2019-04-22 16:02:53 -07:00
Jakub Kądziołka
7af0fccc88
Reexport IntErrorKind in std 2019-04-23 00:15:43 +02:00
Tyler Mandry
b2c0fd0876 Remove redundant code in copy_clone_conditions
This was left over from when closure copy and clone were gated behind
feature flags.
2019-04-22 14:52:38 -07:00
bors
004c549a73 Auto merge of #60126 - estebank:continue-eval, r=oli-obk
Continue evaluating after item-type checking

Fix #30999.

r? @oli-obk
2019-04-22 21:46:07 +00:00
Tomas Koutsky
1dc13b5904 Remove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns 2019-04-23 00:17:19 +03:00
Esteban Küber
87ef96d394 review comment: add HACK comment 2019-04-22 13:14:43 -07:00
Esteban Küber
56b1ec06ee Fix ICE related to #53708 2019-04-22 13:11:53 -07:00
Esteban Küber
6e723c24a8 Never stop due to errors before borrow checking 2019-04-22 13:11:53 -07:00
Esteban Küber
2dc5d52a04 Remove needless error in test 2019-04-22 12:19:07 -07:00
Esteban Küber
3a19df20da review comments: deduplicate tests 2019-04-22 12:11:46 -07:00
varkor
f571b9548d Update ui tests 2019-04-22 19:50:11 +01:00
Alexey Shmalko
517fb1b06f
Promote rust comments to rustdoc 2019-04-22 21:38:28 +03:00
Esteban Küber
45bbd14db4 Continue evaluating after item-type checking 2019-04-22 11:31:35 -07:00
David Wood
7ab1bfd692
Only make suggestion when type is Copy.
This commit makes the suggestion to dereference when a type implements
`Deref` only apply if the dereference would succeed (ie. the type is
`Copy`, otherwise a borrow check error would occur).
2019-04-22 19:26:24 +01:00
bors
6d599337fa Auto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton
Add a tidy check for leading newlines

This is fairly uncommon, but it can slip through when refactoring (as evidenced by the files with leading newlines here).
2019-04-22 16:30:42 +00:00
varkor
096495531c Update ui tests 2019-04-22 17:30:54 +01:00
varkor
9736d32f84 Remove leading newlines 2019-04-22 17:01:33 +01:00
varkor
8423e00714 Add a tidy check for leading trailing newlines 2019-04-22 17:01:33 +01:00
varkor
a43ccb0b9b Disallow double trailing newlines in tidy 2019-04-22 16:57:01 +01:00
varkor
7f0f0e31ec Remove double trailing newlines 2019-04-22 16:57:01 +01:00
Andy Russell
303016485b
upgrade rustdoc's pulldown-cmark to 0.4.1 2019-04-22 09:11:26 -04:00
bors
c21fbfe7e3 Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
Enable NLL migrate mode on the 2015 edition

## What is in this PR?

* Remove the `-Zborrowck=ast` flag option from rustc.
* The default in the 2015 edition is now `-Zborrowck=migrate`.
* The 2018 edition default is unchanged: it's still `-Zborrowck=migrate`.
* Enable two-phase borrows (currently toggled via the `-Ztwo-phase-borrows` flag) on all editions.
* Remove most dead code that handled these options.
* Update tests for the above changes.

## What is *not* in this PR?

These are left for future PRs

* Use `-Zborrowck=mir` in NLL compare mode tests (#56993)
* Remove the `-Zborrowck=compare` option (#59193)
* Remove the `-Ztwo-phase-borrows` flag. It's kept, as a flag that does nothing so that perf.rlo has time to stop using it (cc @Mark-Simulacrum)
* Remove MIR typeck as its own MIR pass - it's now run by NLL.
* Enabling `-Zborrowck=mir` by default (#58781)
* Replace `allow_bind_by_move_patterns_with_guards` and `check_for_mutation_in_guard_via_ast_walk` with just using the feature gate. (#59192)

Soundness issues that are fixed by NLL will stay open until full NLL is emitting hard errors. However, these diagnostics and completeness issues can now be closed:

Closes #18330
Closes #22323
Closes #23591
Closes #26736
Closes #27487
Closes #28092
Closes #28970
Closes #29733
Closes #30104
Closes #38915
Closes #39908
Closes #43407
Closes #47524
Closes #48540
Closes #49073
Closes #52614
Closes #55085
Closes #56093
Closes #56496
Closes #57804

cc #43234

r? @pnkfelix
cc @rust-lang/lang
cc @rust-lang/wg-compiler-nll
2019-04-22 12:09:59 +00:00
Matthew Jasper
8eef102270 update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
bors
a850a42649 Auto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril
Deny rust_2018_idioms globally

cc https://github.com/rust-lang/rust/issues/58099#issuecomment-484921194
2019-04-22 07:28:20 +00:00
gnzlbg
c9553f7382 Breaking update of stdsimd
This commit updates stdsimd and contains two breaking changes:

* https://github.com/rust-lang-nursery/stdsimd/pull/733
* https://github.com/rust-lang-nursery/stdsimd/pull/586

We already did a crater run of 586 but we should do another one here.
2019-04-22 09:07:25 +02:00
bors
8f06188991 Auto merge of #60053 - Xanewok:serde-save-analysis, r=nrc
save-analysis: Use serde instead of libserialize to dump JSON data

This breaks the save-analysis infrastructure (which also includes `rls-{analysis, data, span}` crates) from depending on rustc_serialize and so we can start moving them to being supported on stable without implementing `Decodable` et al. by hand for data structures defined there.

Notable benefits:
- we drop the awkward raw byte `PathBuf` [serialization](https://gist.github.com/Xanewok/f4fe8564d0dc0c3ab1dbc244279ff895) (until now (de)serialized as `&[u8]`)
- [faster](https://github.com/serde-rs/json-benchmark) (hopefully noticeable for inner crate dependencies for the RLS workloads)
- we can easily explore the binary serialization backend (which we planned to do for save-analysis anyway)

~This should be merged together with an update to RLS (https://github.com/rust-lang/rls/pull/1435), which technically could be included right now because we can use the bundled `rls-analysis` here directly, however I'd prefer to publish this to crates.io first (https://github.com/rust-lang/rls/pull/1434, cc @nrc) and use the published version, instead.~
Includes https://github.com/rust-lang/rls/pull/1436.

@matklad @nikomatsakis This is also important for the potential RLS 1.0 - 2.0 bridge we talked about on Zulip today
2019-04-22 01:46:13 +00:00
bors
247b505099 Auto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr
Update Clippy

Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.

r? @oli-obk
cc @matthiaskrgr
2019-04-21 21:46:15 +00:00
Igor Matuszewski
f01015d161 Update Clippy
Fixes fallout from https://github.com/rust-lang/rust/pull/60124.
Closes #60154.
2019-04-21 23:45:05 +02:00
Matthew Jasper
aa6fb6caf9 Enable migrate mode by default on the 2015 edition
This also fully stabilizes two-phase borrows on all editions
2019-04-21 20:50:02 +01:00
David Wood
fd95ba3574
Suggest dereferencing when Deref is implemented.
This commit suggests dereferencing a type when it implements `Deref`
with the correct `Output` associated type.
2019-04-21 20:00:32 +01:00
David Wood
c9a2616e44
Add existing behaviour test for deref suggestions.
This commit adds a test that demonstrates the current behaviour where
suggestions to add a dereference aren't given for non-references.
2019-04-21 18:49:02 +01:00
David Wood
09c707f0ca
Display original pattern in rustdoc.
This commit displays the original pattern in generated documentation for
async functions rather than the synthesized pattern.
2019-04-21 16:46:33 +01:00
David Wood
44ddbc5565
Correct lowering order to avoid ICE after rebase.
This commit changes the order that arguments and bodies of async
functions are lowered so that when the body attempts to `lower_def` of a
upvar then the id has already been assigned by lowering the argument
first.
2019-04-21 16:46:32 +01:00
David Wood
9d7da824d6
Introduce ArgSource for diagnostics.
This commit introduces an `ArgSource` enum that is lowered into the HIR
so that diagnostics can correctly refer to the argument pattern's
original name rather than the generated pattern.
2019-04-21 16:46:32 +01:00
David Wood
92e72df2c1
Do not specify type in generated let bindings.
This avoids issues with `impl_trait_in_bindings` as the type from the
argument is normally used as the let binding, but `impl Trait` is
unstable in binding position.
2019-04-21 16:46:32 +01:00
David Wood
61346557ce
Enforce consistent drop order w/ async methods.
This commit extends the previous commit to apply to trait methods as
well as free functions.
2019-04-21 16:46:32 +01:00
David Wood
7c6dc7a254
Move async fn arguments into closure.
This commit takes advantage of `AsyncArgument` type that was added in a
previous commit to replace the arguments of the `async fn` in the HIR
and add statements to move the bindings from the new arguments to the
pattern from the old argument.

For example, the async function `foo` below:

    async fn foo((x, _y): (T, V)) {
        async move {
        }
    }

becomes:

    async fn foo(__arg0: (T, V)) {
        async move {
            let (x, _y) = __arg0;
        }
    }
2019-04-21 16:46:32 +01:00
David Wood
879abb1641
Add AsyncArgument to AST.
This commit adds an `AsyncArgument` struct to the AST that contains the
generated argument and statement that will be used in HIR lowering, name
resolution and def collection.
2019-04-21 16:46:32 +01:00
Igor Matuszewski
2dccaa77f8 Use sysroot libserialize in newtype_index test 2019-04-21 15:58:06 +02:00
bors
31a75a1728 Auto merge of #60124 - petrochenkov:stanomut, r=eddyb
Remove mutability from `Def::Static`

Querify `TyCtxt::is_static`.
Use `Mutability` instead of bool in foreign statics in AST/HIR.

cc https://github.com/rust-lang/rust/pull/60110
r? @eddyb
2019-04-21 13:40:22 +00:00
Vadim Petrochenkov
4eb94b4407 AST/HIR: Use Mutability instead of bool in foreign statics 2019-04-21 15:29:58 +03:00
Vadim Petrochenkov
53ffcd96b7 Remove mutability from Def::Static 2019-04-21 15:05:55 +03:00
Vadim Petrochenkov
6c187cc0c6 Change return type of TyCtxt::is_static to bool
Add `TyCtxt::is_mutable_static`
2019-04-21 14:41:51 +03:00
Vadim Petrochenkov
286a469a16 Introduce query static_mutability 2019-04-21 14:16:44 +03:00