]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoDebug-print error when using rtunwrap
Jethro Beekman [Tue, 23 Apr 2019 17:06:27 +0000 (10:06 -0700)]
Debug-print error when using rtunwrap

5 years agoAuto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor
bors [Tue, 23 Apr 2019 12:27:38 +0000 (12:27 +0000)]
Auto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkor

Remove `visit_subpats` parameter from `check_pat`

The core idea is to keep track of current ID directly in `EllipsisInclusiveRangePatterns` struct and early return in `check_pat` based on it.

Fixes https://github.com/rust-lang/rust/issues/60043.

r? @varkor

5 years agoAuto merge of #60125 - estebank:continue-evaluating, r=oli-obk
bors [Tue, 23 Apr 2019 09:38:34 +0000 (09:38 +0000)]
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`.

5 years agoAuto merge of #60172 - varkor:tidy-double-trailing-newline, r=kennytm
bors [Tue, 23 Apr 2019 06:40:12 +0000 (06:40 +0000)]
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

5 years agoAuto merge of #60121 - davazp:fix-sync-all-macos, r=KodrAus
bors [Tue, 23 Apr 2019 03:34:21 +0000 (03:34 +0000)]
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.

5 years agoAuto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez
bors [Tue, 23 Apr 2019 00:44:58 +0000 (00:44 +0000)]
Auto merge of #60140 - euclio:pulldown-cmark, r=GuillaumeGomez

upgrade rustdoc's pulldown-cmark to 0.4.1

Fixes #59194.

5 years agoAuto merge of #60126 - estebank:continue-eval, r=oli-obk
bors [Mon, 22 Apr 2019 21:46:07 +0000 (21:46 +0000)]
Auto merge of #60126 - estebank:continue-eval, r=oli-obk

Continue evaluating after item-type checking

Fix #30999.

r? @oli-obk

5 years agoRemove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns
Tomas Koutsky [Sun, 21 Apr 2019 14:09:30 +0000 (17:09 +0300)]
Remove visit_subpats from check_pat in favor of state in EllipsisInclusiveRangePatterns

5 years agoreview comment: add HACK comment
Esteban Küber [Mon, 22 Apr 2019 20:14:43 +0000 (13:14 -0700)]
review comment: add HACK comment

5 years agoFix ICE related to #53708
Esteban Küber [Fri, 19 Apr 2019 21:53:34 +0000 (14:53 -0700)]
Fix ICE related to #53708

5 years agoNever stop due to errors before borrow checking
Esteban Küber [Mon, 15 Apr 2019 19:54:18 +0000 (12:54 -0700)]
Never stop due to errors before borrow checking

5 years agoRemove needless error in test
Esteban Küber [Mon, 22 Apr 2019 19:19:07 +0000 (12:19 -0700)]
Remove needless error in test

5 years agoreview comments: deduplicate tests
Esteban Küber [Mon, 22 Apr 2019 19:11:46 +0000 (12:11 -0700)]
review comments: deduplicate tests

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 18:50:11 +0000 (19:50 +0100)]
Update ui tests

5 years agoContinue evaluating after item-type checking
Esteban Küber [Fri, 19 Apr 2019 22:37:34 +0000 (15:37 -0700)]
Continue evaluating after item-type checking

5 years agoAuto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton
bors [Mon, 22 Apr 2019 16:30:42 +0000 (16:30 +0000)]
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).

5 years agoUpdate ui tests
varkor [Mon, 22 Apr 2019 16:30:54 +0000 (17:30 +0100)]
Update ui tests

5 years agoRemove leading newlines
varkor [Mon, 22 Apr 2019 14:50:02 +0000 (15:50 +0100)]
Remove leading newlines

5 years agoAdd a tidy check for leading trailing newlines
varkor [Mon, 22 Apr 2019 14:49:51 +0000 (15:49 +0100)]
Add a tidy check for leading trailing newlines

5 years agoDisallow double trailing newlines in tidy
varkor [Mon, 22 Apr 2019 15:56:47 +0000 (16:56 +0100)]
Disallow double trailing newlines in tidy

5 years agoRemove double trailing newlines
varkor [Mon, 22 Apr 2019 15:55:33 +0000 (16:55 +0100)]
Remove double trailing newlines

5 years agoupgrade rustdoc's pulldown-cmark to 0.4.1
Andy Russell [Sat, 20 Apr 2019 17:03:59 +0000 (13:03 -0400)]
upgrade rustdoc's pulldown-cmark to 0.4.1

5 years agoAuto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
bors [Mon, 22 Apr 2019 12:09:59 +0000 (12:09 +0000)]
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

5 years agoupdate tests for migrate mode by default
Matthew Jasper [Mon, 22 Apr 2019 07:40:08 +0000 (08:40 +0100)]
update tests for migrate mode by default

5 years agoAuto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril
bors [Mon, 22 Apr 2019 07:28:20 +0000 (07:28 +0000)]
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

5 years agoAuto merge of #60053 - Xanewok:serde-save-analysis, r=nrc
bors [Mon, 22 Apr 2019 01:46:13 +0000 (01:46 +0000)]
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

5 years agoAuto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr
bors [Sun, 21 Apr 2019 21:46:15 +0000 (21:46 +0000)]
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

5 years agoUpdate Clippy
Igor Matuszewski [Sun, 21 Apr 2019 21:03:27 +0000 (23:03 +0200)]
Update Clippy

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

5 years agoEnable migrate mode by default on the 2015 edition
Matthew Jasper [Sat, 26 Jan 2019 17:25:37 +0000 (17:25 +0000)]
Enable migrate mode by default on the 2015 edition

This also fully stabilizes two-phase borrows on all editions

5 years agoUse sysroot libserialize in newtype_index test
Igor Matuszewski [Sun, 21 Apr 2019 13:51:28 +0000 (15:51 +0200)]
Use sysroot libserialize in newtype_index test

5 years agoAuto merge of #60124 - petrochenkov:stanomut, r=eddyb
bors [Sun, 21 Apr 2019 13:40:22 +0000 (13:40 +0000)]
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

5 years agoAST/HIR: Use `Mutability` instead of bool in foreign statics
Vadim Petrochenkov [Sun, 21 Apr 2019 12:29:58 +0000 (15:29 +0300)]
AST/HIR: Use `Mutability` instead of bool in foreign statics

5 years agoRemove mutability from `Def::Static`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Remove mutability from `Def::Static`

5 years agoChange return type of `TyCtxt::is_static` to bool
Vadim Petrochenkov [Sun, 21 Apr 2019 11:41:51 +0000 (14:41 +0300)]
Change return type of `TyCtxt::is_static` to bool

Add `TyCtxt::is_mutable_static`

5 years agoIntroduce query `static_mutability`
Vadim Petrochenkov [Fri, 19 Apr 2019 20:32:26 +0000 (23:32 +0300)]
Introduce query `static_mutability`

5 years agoSwitch to serde-enabled rls-* and update RLS appropriately
Igor Matuszewski [Sun, 21 Apr 2019 10:52:07 +0000 (12:52 +0200)]
Switch to serde-enabled rls-* and update RLS appropriately

This also bumps RLS version to 1.36.
The updated rls-* packages use serde but *not* serde_derive thanks to
manual proc macro expansion. This is a hack, since rustc cannot handle
crates.io proc macros (duplicated in tools) when cross-compiling, so
that's the best we can do in order to support serde_json in save-analysis.

5 years agosave-analysis: Use serde instead of libserialize to dump JSON data
Igor Matuszewski [Wed, 17 Apr 2019 19:34:35 +0000 (21:34 +0200)]
save-analysis: Use serde instead of libserialize to dump JSON data

5 years agoAuto merge of #60119 - estebank:bad-recovery, r=davidtwco
bors [Sun, 21 Apr 2019 10:13:27 +0000 (10:13 +0000)]
Auto merge of #60119 - estebank:bad-recovery, r=davidtwco

Remove assumption from recovery code

Fix #60115.

5 years agoAllow unused_extern_crates for rustc_libserialize
Philipp Hansch [Sun, 21 Apr 2019 08:52:12 +0000 (10:52 +0200)]
Allow unused_extern_crates for rustc_libserialize

5 years agoAuto merge of #60132 - davidtwco:issue-60075, r=estebank
bors [Sun, 21 Apr 2019 07:20:14 +0000 (07:20 +0000)]
Auto merge of #60132 - davidtwco:issue-60075, r=estebank

Fix fn front matter parsing ICE from invalid code.

Fixes #60075.

This PR fixes an "unreachable code" ICE that results from parsing
invalid code where the compiler is expecting the next trait item
declaration in the middle of the previous trait item due to extra
closing braces.

r? @estebank (thanks for the minimized test case)

5 years agoAuto merge of #60116 - RalfJung:miri-exit, r=oli-obk
bors [Sun, 21 Apr 2019 02:38:15 +0000 (02:38 +0000)]
Auto merge of #60116 - RalfJung:miri-exit, r=oli-obk

add Miri error variant for process exit

This is to support https://github.com/rust-lang/miri/pull/702

r? @oli-obk

5 years agoAuto merge of #60088 - varkor:async_await-method-feature-gate, r=cramertj
bors [Sat, 20 Apr 2019 23:44:02 +0000 (23:44 +0000)]
Auto merge of #60088 - varkor:async_await-method-feature-gate, r=cramertj

Feature gate async methods

Fixes https://github.com/rust-lang/rust/issues/60069.

5 years agoUpdate error message in test
varkor [Sat, 20 Apr 2019 21:32:47 +0000 (22:32 +0100)]
Update error message in test

5 years agoCheck async in trait methods
varkor [Thu, 18 Apr 2019 19:57:15 +0000 (20:57 +0100)]
Check async in trait methods

5 years agoFix additional variadic typos
varkor [Thu, 18 Apr 2019 19:36:32 +0000 (20:36 +0100)]
Fix additional variadic typos

5 years agoFix typo in variadic C function warning
varkor [Thu, 18 Apr 2019 18:16:17 +0000 (19:16 +0100)]
Fix typo in variadic C function warning

5 years agoAdd test for async fn methods feature gating
varkor [Thu, 18 Apr 2019 18:15:53 +0000 (19:15 +0100)]
Add test for async fn methods feature gating

5 years agoFeature gate async fn methods
varkor [Thu, 18 Apr 2019 18:15:43 +0000 (19:15 +0100)]
Feature gate async fn methods

5 years agoRefactor some existing methods
varkor [Thu, 18 Apr 2019 17:47:52 +0000 (18:47 +0100)]
Refactor some existing methods

5 years agoAdd a `header` method to `FnKind`
varkor [Thu, 18 Apr 2019 17:44:55 +0000 (18:44 +0100)]
Add a `header` method to `FnKind`

5 years agoAuto merge of #59826 - llogiq:multi-dbg, r=SimonSapin
bors [Sat, 20 Apr 2019 20:55:29 +0000 (20:55 +0000)]
Auto merge of #59826 - llogiq:multi-dbg, r=SimonSapin

allow multiple args to `dbg!(..)`

This closes #59763

5 years agoAuto merge of #59700 - matklad:simplify, r=eddyb
bors [Sat, 20 Apr 2019 17:59:15 +0000 (17:59 +0000)]
Auto merge of #59700 - matklad:simplify, r=eddyb

Simplify doc comment lexing

is_doc_comment function checks the first four chars, but this is
redundant, `doc_comment` local var has the same info.

5 years agoDeny rust_2018_idioms in libcore tests
Philipp Hansch [Sat, 20 Apr 2019 16:44:29 +0000 (18:44 +0200)]
Deny rust_2018_idioms in libcore tests

5 years agoimprove docs
Ralf Jung [Sat, 20 Apr 2019 16:38:39 +0000 (18:38 +0200)]
improve docs

5 years agoAuto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obk
bors [Sat, 20 Apr 2019 15:06:15 +0000 (15:06 +0000)]
Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obk

Refactor Adjust and CastKind

fixes rust-lang#59588

5 years agoDeny rust_2018_idioms in liballoc tests
Philipp Hansch [Sat, 20 Apr 2019 14:05:25 +0000 (16:05 +0200)]
Deny rust_2018_idioms in liballoc tests

5 years agoAuto merge of #59564 - bjorn3:move_link_to_cg_ssa, r=eddyb
bors [Sat, 20 Apr 2019 12:18:49 +0000 (12:18 +0000)]
Auto merge of #59564 - bjorn3:move_link_to_cg_ssa, r=eddyb

Move back::link and debuginfo::type_names to cg ssa

r? @eddyb

5 years agoDeny rust_2018_idioms globally
Philipp Hansch [Sat, 20 Apr 2019 11:45:46 +0000 (13:45 +0200)]
Deny rust_2018_idioms globally

5 years agoTidy
bjorn3 [Sat, 30 Mar 2019 15:16:25 +0000 (16:16 +0100)]
Tidy

5 years agoMove cg_llvm/debuginfo/type_names.rs to cg_ssa
bjorn3 [Sat, 30 Mar 2019 14:45:09 +0000 (15:45 +0100)]
Move cg_llvm/debuginfo/type_names.rs to cg_ssa

5 years agoRemove cg_llvm/back/link.rs
bjorn3 [Sat, 30 Mar 2019 14:30:07 +0000 (15:30 +0100)]
Remove cg_llvm/back/link.rs

5 years agoMove almost all of cg_llvm/back/link.rs to cg_ssa
bjorn3 [Sat, 30 Mar 2019 14:25:10 +0000 (15:25 +0100)]
Move almost all of cg_llvm/back/link.rs to cg_ssa

5 years agoRemove get_reloc_model and target_cpu dependency from most of link.rs
bjorn3 [Sat, 30 Mar 2019 11:59:40 +0000 (12:59 +0100)]
Remove get_reloc_model and target_cpu dependency from most of link.rs

5 years agoMake link functions generic over archive builder
bjorn3 [Sat, 30 Mar 2019 11:59:40 +0000 (12:59 +0100)]
Make link functions generic over archive builder

5 years agoMove some filename constants to cg_ssa
bjorn3 [Sat, 30 Mar 2019 12:03:52 +0000 (13:03 +0100)]
Move some filename constants to cg_ssa

5 years agoMove some function from cg_llvm/back/link.rs to cg_ssa/back/link.rs
bjorn3 [Sat, 30 Mar 2019 10:25:22 +0000 (11:25 +0100)]
Move some function from cg_llvm/back/link.rs to cg_ssa/back/link.rs

5 years agoFix fn front matter parsing ICE from invalid code.
David Wood [Sat, 20 Apr 2019 10:31:38 +0000 (11:31 +0100)]
Fix fn front matter parsing ICE from invalid code.

This commit fixes an "unreachable code" ICE that results from parsing
invalid code where the compiler is expecting the next trait item
declaration in the middle of the previous trait item due to extra
closing braces.

5 years agoAuto merge of #60128 - jimblandy:futures-doc-fix, r=withoutboats
bors [Sat, 20 Apr 2019 09:30:51 +0000 (09:30 +0000)]
Auto merge of #60128 - jimblandy:futures-doc-fix, r=withoutboats

Doc fixes for core::future::Future.

Fixed outdated reference to `waker` argument; now futures are passed a
`Context`, from which one can obtain a `waker`.

Cleaned up explanation of what happens when you call `poll` on a completed
future. It doesn't make sense to say that `poll` implementations can't cause
memory unsafety; no safe function is ever allowed to cause memory unsafety, so
why mention it here? It seems like the intent is to say that the `Future` trait
doesn't say what the consequences of excess polls will be, and they might be
bad; but that the usual constraints that Rust imposes on any non-`unsafe`
function still apply. It's also oddly specific to say 'memory corruption'
instead of just 'undefined behavior'; UB is a bit jargony, so the text should
provide examples.

5 years agocore::future::Future: Fix markup typo in docs.
Jim Blandy [Sat, 20 Apr 2019 02:25:40 +0000 (19:25 -0700)]
core::future::Future: Fix markup typo in docs.

5 years agoDoc fixes for core::future::Future.
Jim Blandy [Sat, 20 Apr 2019 02:10:24 +0000 (19:10 -0700)]
Doc fixes for core::future::Future.

Fixed outdated reference to `waker` argument; now futures are passed a
`Context`, from which one can obtain a `waker`.

Cleaned up explanation of what happens when you call `poll` on a completed
future. It doesn't make sense to say that `poll` implementations can't cause
memory unsafety; no safe function is ever allowed to cause memory unsafety, so
why mention it here? It seems like the intent is to say that the `Future` trait
doesn't say what the consequences of excess polls will be, and they might be
bad; but that the usual constraints that Rust imposes on any non-`unsafe`
function still apply. It's also oddly specific to say 'memory corruption'
instead of just 'undefined behavior'; UB is a bit jargony, so the text should
provide examples.

5 years agoAuto merge of #60120 - matthiaskrgr:submodule_upd, r=sanxiyn
bors [Sat, 20 Apr 2019 00:12:14 +0000 (00:12 +0000)]
Auto merge of #60120 - matthiaskrgr:submodule_upd, r=sanxiyn

submodules: update clippy from fbb3a47b to cafbe7f2

Changes:
````
Update compiletest_rs
Typo
Fix dogfood error
Add lint PathBufPushOverwrite
Update *.stderr file
Remove code duplication
Format code
Add test for debug_assert!(false)
Don't lint debug_assert!(false)
Add run-rustfix for option_map_or_none lint
Move two cast_lossless tests to their correct files
Change naive_bytecount applicability MaybeIncorrect
Add tests for declare_lint_pass and impl_lint_pass
Use lint pass macros
Document `declare_lint_pass!`
Fix lint_without_lint_pass internal lint
Use {get,match}_def_path from LateContext
Remove uplifted functions {get,match}_def_path from Clippy
Add run-rustfix for len_zero lint
Add run-rustfix for bool_comparison lint
Add run-rustfix for deref_addrof lint
while_let_loop uses placeholders in suggestions
Remove rust-toolchain file from clippy_dev
Update adding_lints.md
Update PULL_REQUEST_TEMPLATE
Add new lint checklist
Create PULL_REQUEST_TEMPLATE
Only suggest .copied() for Option right now
Also suggest .copied() when .clone() is called on a Copy type
Suggest .copied() instead of .cloned() in map_clone when dealing with references
Deny rustc internal lints
Remove clippy::default_hash_types internal lint
Enable -Zunstable-options in .cargo/config
````

r? @oli-obk

5 years agoAuto merge of #59981 - estebank:recover-struct-lit, r=petrochenkov
bors [Fri, 19 Apr 2019 20:15:11 +0000 (20:15 +0000)]
Auto merge of #59981 - estebank:recover-struct-lit, r=petrochenkov

Emit specific error for struct literal in conditions

Fix #59962, fix #51311.

5 years agoextend ui test
Andre Bogus [Wed, 10 Apr 2019 04:00:35 +0000 (06:00 +0200)]
extend ui test

5 years agosubmodules: update clippy from fbb3a47b to cafbe7f2
Matthias Krüger [Fri, 19 Apr 2019 18:13:07 +0000 (20:13 +0200)]
submodules: update clippy from fbb3a47b to cafbe7f2

Changes:
````
Update compiletest_rs
Typo
Fix dogfood error
Add lint PathBufPushOverwrite
Update *.stderr file
Remove code duplication
Format code
Add test for debug_assert!(false)
Don't lint debug_assert!(false)
Add run-rustfix for option_map_or_none lint
Move two cast_lossless tests to their correct files
Change naive_bytecount applicability MaybeIncorrect
Add tests for declare_lint_pass and impl_lint_pass
Use lint pass macros
Document `declare_lint_pass!`
Fix lint_without_lint_pass internal lint
Use {get,match}_def_path from LateContext
Remove uplifted functions {get,match}_def_path from Clippy
Add run-rustfix for len_zero lint
Add run-rustfix for bool_comparison lint
Add run-rustfix for deref_addrof lint
while_let_loop uses placeholders in suggestions
Remove rust-toolchain file from clippy_dev
Update adding_lints.md
Update PULL_REQUEST_TEMPLATE
Add new lint checklist
Create PULL_REQUEST_TEMPLATE
Only suggest .copied() for Option right now
Also suggest .copied() when .clone() is called on a Copy type
Suggest .copied() instead of .cloned() in map_clone when dealing with references
Deny rustc internal lints
Remove clippy::default_hash_types internal lint
Enable -Zunstable-options in .cargo/config
````

5 years agoFix sync_all on macos/ios
David Vázquez Púa [Fri, 19 Apr 2019 18:42:52 +0000 (20:42 +0200)]
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.

Fixes #55920

5 years agoRemove assumption from recovery code
Esteban Küber [Fri, 19 Apr 2019 18:04:41 +0000 (11:04 -0700)]
Remove assumption from recovery code

5 years agoSome cleanup to `maybe_parse_struct_expr`
Vadim Petrochenkov [Thu, 18 Apr 2019 20:58:57 +0000 (23:58 +0300)]
Some cleanup to `maybe_parse_struct_expr`

5 years agoremove duplicated code and simplify logic
Esteban Küber [Thu, 18 Apr 2019 18:35:11 +0000 (11:35 -0700)]
remove duplicated code and simplify logic

5 years agoIdentify missing ambiguous case with best effort suggestion
Esteban Küber [Mon, 15 Apr 2019 15:08:46 +0000 (08:08 -0700)]
Identify missing ambiguous case with best effort suggestion

5 years agoEmit specific error for struct literal in conditions
Esteban Küber [Mon, 15 Apr 2019 00:09:03 +0000 (17:09 -0700)]
Emit specific error for struct literal in conditions

5 years agoAuto merge of #60072 - RalfJung:linked-list, r=shepmaster
bors [Fri, 19 Apr 2019 17:12:17 +0000 (17:12 +0000)]
Auto merge of #60072 - RalfJung:linked-list, r=shepmaster

fix LinkedList invalidating mutable references

The test `test_insert_prev` failed in Miri due to what I consider a bug in `LinkedList`: in various places, `NonNull::as_mut` got called to modify the `prev`/`next` pointers of existing nodes. In particular, the unstable `insert_next` has to modify the `next` pointer of the node that was last handed out by the iterator; to this end it creates a mutable reference to the *entire node* that overlaps with the mutable reference to the node's content that was handed out by the iterator! Thus, the next use if said mutable reference is UB.

In code:
```rust
            loop {
                match it.next() { // mutable reference handed to us
                    None => break,
                    Some(elt) => {
                        it.insert_next(*elt + 1); // this invalidates `elt` because it creates an overlapping mutable reference
                        match it.peek_next() {
                            Some(x) => assert_eq!(*x, *elt + 2), // this use of `elt` now is a use of an invalid pointer
                            None => assert_eq!(8, *elt),
                        }
                    }
                }
            }
```

This PR fixes that by using `as_ptr` instead of `as_mut`. This avoids invalidating the mutable reference that was handed to the user.  I did this in all methods called by iterators, just to be sure.

Cc @Gankro

5 years agoadd Miri error variant for process exit
Ralf Jung [Fri, 19 Apr 2019 16:48:02 +0000 (18:48 +0200)]
add Miri error variant for process exit

5 years agofix LinkedList invalidating mutable references
Ralf Jung [Thu, 18 Apr 2019 09:41:28 +0000 (11:41 +0200)]
fix LinkedList invalidating mutable references

5 years agoAuto merge of #60077 - RalfJung:miri-alloc-tests, r=joshtriplett
bors [Fri, 19 Apr 2019 12:52:02 +0000 (12:52 +0000)]
Auto merge of #60077 - RalfJung:miri-alloc-tests, r=joshtriplett

make liballoc internal test suite mostly pass in Miri

I discovered, to my surprise, that liballoc has two test suites: `liballoc/tests`, and a bunch of stuff embedded directly within liballoc.  The latter was not covered by [miri-test-libstd](https://github.com/RalfJung/miri-test-libstd) yet.  This disables in Miri the tests that Miri cannot support or runs too slowly.

5 years agoAuto merge of #60063 - spastorino:place2_2, r=oli-obk
bors [Fri, 19 Apr 2019 09:57:26 +0000 (09:57 +0000)]
Auto merge of #60063 - spastorino:place2_2, r=oli-obk

Convert Place unroll to a proper iterator

r? @oli-obk

5 years agomove variable down to where it is used
Ralf Jung [Fri, 19 Apr 2019 07:06:08 +0000 (09:06 +0200)]
move variable down to where it is used

5 years agoAuto merge of #60073 - rchaser53:issue-60049, r=estebank
bors [Fri, 19 Apr 2019 07:03:12 +0000 (07:03 +0000)]
Auto merge of #60073 - rchaser53:issue-60049, r=estebank

avoid type-check body of DefId

fix: #60049
related: PR #59798

5 years agoavoid type-check body of DefId
rchaser53 [Fri, 19 Apr 2019 04:34:54 +0000 (04:34 +0000)]
avoid type-check body of DefId

5 years agoAuto merge of #60104 - Centril:rollup-7vmae1a, r=Centril
bors [Fri, 19 Apr 2019 04:04:02 +0000 (04:04 +0000)]
Auto merge of #60104 - Centril:rollup-7vmae1a, r=Centril

Rollup of 16 pull requests

Successful merges:

 - #59915 (Implement event filtering for self-profiler.)
 - #59933 (Make clear that format padding doesn't work for Debug)
 - #60023 (implement specialized nth_back() for Bytes, Fuse and Enumerate)
 - #60032 (Remove unwanted z-index change)
 - #60041 (Simplify the returning of a Result a bit)
 - #60045 (Suggest appropriate path when calling associated item on bare types)
 - #60052 (Correct unused parameter diagnostic)
 - #60056 (Update rustfmt to 1.2.1)
 - #60060 (whitelist RTM x86 target cpu feature)
 - #60061 (Change suggestion of field when not in self context)
 - #60064 (Point at try `?` on errors affecting the err match arm of the desugared code)
 - #60078 (Use more realistic example for thread builder)
 - #60080 (Fix small errors in docs for `rchunks_exact` and `rchunks_exact_mut`.)
 - #60082 (Update miri)
 - #60097 (Use -mergefunc-use-aliases for any LLVM >= 8)
 - #60098 (libcore: deny `elided_lifetimes_in_paths`)

Failed merges:

r? @ghost

5 years agoRollup merge of #60098 - Centril:libcore-deny-more, r=varkor
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:30 +0000 (06:03 +0200)]
Rollup merge of #60098 - Centril:libcore-deny-more, r=varkor

libcore: deny `elided_lifetimes_in_paths`

r? @varkor

5 years agoRollup merge of #60097 - cuviper:llvm8-mergefunc-use-aliases, r=rkruppe
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:29 +0000 (06:03 +0200)]
Rollup merge of #60097 - cuviper:llvm8-mergefunc-use-aliases, r=rkruppe

Use -mergefunc-use-aliases for any LLVM >= 8

This functionality is not specific to Rust's LLVM, but any starting in LLVM 8.0,
as noted in <https://github.com/rust-lang/rust/pull/56358#discussion_r237702197>.

cc @nikic
r? @rkruppe

5 years agoRollup merge of #60082 - TimDiekmann:master, r=RalfJung
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:27 +0000 (06:03 +0200)]
Rollup merge of #60082 - TimDiekmann:master, r=RalfJung

Update miri

r? @RalfJung

5 years agoRollup merge of #60080 - nathankleyn:fix-issue-60068, r=Centril
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:26 +0000 (06:03 +0200)]
Rollup merge of #60080 - nathankleyn:fix-issue-60068, r=Centril

Fix small errors in docs for `rchunks_exact` and `rchunks_exact_mut`.

The documentation for `rchunks_exact` said it started at the beginning
of the slice, bit it actually starts at the end of the slice.

In addition, there were a couple of "of the slice of the slice"
duplicate phrases going on for `rchunks_exact` and `rchunks_exact_mut`.

This fixes #60068.

5 years agoRollup merge of #60078 - matklad:patch-1, r=shepmaster
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:24 +0000 (06:03 +0200)]
Rollup merge of #60078 - matklad:patch-1, r=shepmaster

Use more realistic example for thread builder

Stack size of 10 **bytes** does not make any sense: the minimal possible stack size is greater anyway.

5 years agoRollup merge of #60064 - estebank:issue-59980, r=varkor
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:23 +0000 (06:03 +0200)]
Rollup merge of #60064 - estebank:issue-59980, r=varkor

Point at try `?` on errors affecting the err match arm of the desugared code

Fix #59980.

5 years agoRollup merge of #60061 - estebank:field-sugg, r=davidtwco
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:21 +0000 (06:03 +0200)]
Rollup merge of #60061 - estebank:field-sugg, r=davidtwco

Change suggestion of field when not in self context

Fix #60057.

5 years agoRollup merge of #60060 - mtak-:rtm-x86-feature, r=petrochenkov
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:20 +0000 (06:03 +0200)]
Rollup merge of #60060 - mtak-:rtm-x86-feature, r=petrochenkov

whitelist RTM x86 target cpu feature

This PR adds support for intels restricted transactional memory cpu feature. I mostly copied what was done for the [movbe](https://github.com/rust-lang/rust/pull/57999) feature.

https://github.com/rust-lang-nursery/stdsimd/issues/718

5 years agoRollup merge of #60056 - topecongiro:rustfmt-1.2.1, r=alexcrichton
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:19 +0000 (06:03 +0200)]
Rollup merge of #60056 - topecongiro:rustfmt-1.2.1, r=alexcrichton

Update rustfmt to 1.2.1

5 years agoRollup merge of #60052 - varkor:unused-parameter-diagnostic, r=estebank
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:17 +0000 (06:03 +0200)]
Rollup merge of #60052 - varkor:unused-parameter-diagnostic, r=estebank

Correct unused parameter diagnostic

The message was incorrect for unused lifetime parameters. There's no need to be specific.

5 years agoRollup merge of #60045 - estebank:suggest-std, r=petrochenkov
Mazdak Farrokhzad [Fri, 19 Apr 2019 04:03:16 +0000 (06:03 +0200)]
Rollup merge of #60045 - estebank:suggest-std, r=petrochenkov

Suggest appropriate path when calling associated item on bare types

When looking at the documentation for `std::f32` or `std::str`, for
example, it is easy to get confused and assume `std::f32` and `f32`
are the same thing. Because of this, it is not uncommon to attempt
writing `f32::consts::PI` instead of the correct
`std::f32::consts::PI`. When encountering the former, which results
in an access error due to it being an inexistent path, try to access
the same path under `std`. If this succeeds, this information is
stored for later tweaking of the final E0599 to provide an
appropriate suggestion.

Fix #26760, fix #46660.