]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #71255 - Dylan-DPC:rollup-u5yl04z, r=Dylan-DPC
bors [Fri, 17 Apr 2020 18:36:53 +0000 (18:36 +0000)]
Auto merge of #71255 - Dylan-DPC:rollup-u5yl04z, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #69642 (Use query to determine whether function needs const checking)
 - #71239 (Rename `asm` test directory in favor of `llvm_asm`)
 - #71246 (Implement `Clone` for `liballoc::collections::linked_list::Cursor`.)
 - #71247 (Remove unnecessary variable intialization)
 - #71254 (Minor fix and addition to doc comments)

Failed merges:

r? @ghost

4 years agoAdjust mir-opt test and make it drop something
Jonas Schievink [Sun, 15 Mar 2020 01:28:48 +0000 (02:28 +0100)]
Adjust mir-opt test and make it drop something

4 years agoRollup merge of #71254 - JOE1994:add_comment, r=jonas-schievink
Dylan DPC [Fri, 17 Apr 2020 18:35:25 +0000 (20:35 +0200)]
Rollup merge of #71254 - JOE1994:add_comment, r=jonas-schievink

Minor fix and addition to doc comments

1. Fixed doc comment of struct 'rustc_middle::mir::Location'
Currently, the general explanation of the struct appears at the field
explanation section. I moved and changed the doc comments slightly, so
that the general explanation would appear in the proper location in
docs.
2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn'
Unlike other counterparts, brief explanation for this function was missing,
so I added one.

Thank you for reviewing this PR :)

4 years agoRollup merge of #71247 - ldm0:minor, r=estebank
Dylan DPC [Fri, 17 Apr 2020 18:35:24 +0000 (20:35 +0200)]
Rollup merge of #71247 - ldm0:minor, r=estebank

Remove unnecessary variable intialization

Minor fix.

4 years agoRollup merge of #71246 - crlf0710:linked_list_cursor, r=Amanieu
Dylan DPC [Fri, 17 Apr 2020 18:35:22 +0000 (20:35 +0200)]
Rollup merge of #71246 - crlf0710:linked_list_cursor, r=Amanieu

Implement `Clone` for `liballoc::collections::linked_list::Cursor`.

This implements `Clone` for linked list `Cursor`. Implementing `Copy` is also possible here, but i'm not sure whether i should also do it.

r? @Amanieu

4 years agoRollup merge of #71239 - JohnTitor:llvm-asm, r=Amanieu
Dylan DPC [Fri, 17 Apr 2020 18:35:21 +0000 (20:35 +0200)]
Rollup merge of #71239 - JohnTitor:llvm-asm, r=Amanieu

Rename `asm` test directory in favor of `llvm_asm`

r? @Amanieu

4 years agoRollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obk
Dylan DPC [Fri, 17 Apr 2020 18:35:19 +0000 (20:35 +0200)]
Rollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obk

Use query to determine whether function needs const checking

Resolves #69615.

The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account.

r? @oli-obk

4 years agoMake `needs_drop` less pessimistic on generators
Jonas Schievink [Sat, 14 Mar 2020 23:24:47 +0000 (00:24 +0100)]
Make `needs_drop` less pessimistic on generators

4 years agoImproved try_macro_suggestion function
Duddino [Fri, 17 Apr 2020 17:29:36 +0000 (19:29 +0200)]
Improved try_macro_suggestion function

4 years agoMinor fix and addition to doc comments
JOE1994 [Fri, 17 Apr 2020 17:24:33 +0000 (13:24 -0400)]
Minor fix and addition to doc comments
1. Fixed doc comment of struct 'rustc_middle::mir::Location'
Currently, the general explanation of the struct appears at the field
explanation section. I moved and changed the doc comments slightly, so
that the general explanation would appear in the proper location in
docs.
2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn'
Unlike other counterparts, brief explanation for this function was missing,
so I added one.

Thank you for reviewing this PR :)

4 years agoImproved try_macro_suggestion
Duddino [Fri, 17 Apr 2020 17:10:29 +0000 (19:10 +0200)]
Improved try_macro_suggestion

4 years agoMoved is_try check into try_macro_suggestion
Duddino [Fri, 17 Apr 2020 16:26:39 +0000 (18:26 +0200)]
Moved is_try check into try_macro_suggestion

4 years agoReplace big JS dict with JSON parsing
Guillaume Gomez [Fri, 17 Apr 2020 15:44:16 +0000 (17:44 +0200)]
Replace big JS dict with JSON parsing

4 years agoImplement `Clone` for `liballoc::collections::linked_list::Cursor`.
Charles Lew [Fri, 17 Apr 2020 13:10:48 +0000 (21:10 +0800)]
Implement `Clone` for `liballoc::collections::linked_list::Cursor`.

4 years agoRemove unnecessary variable intialization
Donough Liu [Sat, 11 Apr 2020 07:53:10 +0000 (15:53 +0800)]
Remove unnecessary variable intialization

4 years agoAccount for use of `try!()` in 2018 edition and guide users in the right direction
Duddino [Fri, 17 Apr 2020 12:07:44 +0000 (14:07 +0200)]
Account for use of `try!()` in 2018 edition and guide users in the right direction

4 years agoAuto merge of #71049 - eddyb:const-err, r=oli-obk
bors [Fri, 17 Apr 2020 11:52:01 +0000 (11:52 +0000)]
Auto merge of #71049 - eddyb:const-err, r=oli-obk

Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it.

By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output).

This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now.

r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid

4 years agoFormat Mailmap To Work With GitHub
XAMPPRocky [Fri, 17 Apr 2020 11:33:33 +0000 (13:33 +0200)]
Format Mailmap To Work With GitHub

4 years agoRename `asm` test directory in favor of `llvm_asm`
Yuki Okushi [Fri, 17 Apr 2020 09:36:16 +0000 (18:36 +0900)]
Rename `asm` test directory in favor of `llvm_asm`

4 years agoMiri: fix typo
Ralf Jung [Fri, 17 Apr 2020 09:23:20 +0000 (11:23 +0200)]
Miri: fix typo

4 years agoAuto merge of #70629 - anyska:fields-variant, r=oli-obk
bors [Fri, 17 Apr 2020 08:42:51 +0000 (08:42 +0000)]
Auto merge of #70629 - anyska:fields-variant, r=oli-obk

rustc_target::abi: add Primitive variant to FieldsShape.

Originally suggested by @eddyb.

4 years agoAuto merge of #71230 - Dylan-DPC:rollup-rofigbv, r=Dylan-DPC
bors [Fri, 17 Apr 2020 04:15:18 +0000 (04:15 +0000)]
Auto merge of #71230 - Dylan-DPC:rollup-rofigbv, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #70578 (Add long error explanation for E0657)
 - #70910 (Hides default fns inside Fuse impl to avoid exposing it to any crate)
 - #71164 (reword Miri validity errors: undefined -> uninitialized)
 - #71182 (Add some regression tests)
 - #71206 (Miri error messages: avoid try terminology)
 - #71220 (Dogfood or_patterns in the standard library)
 - #71225 (Fix typo in Default trait docs: Provides -> Provide)

Failed merges:

r? @ghost

4 years agoty/print: pretty-print constant aggregates (arrays, tuples and ADTs).
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 00:55:39 +0000 (03:55 +0300)]
ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).

4 years agomir: pretty-print `Rvalue::Aggregate` correctly.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 00:54:58 +0000 (03:54 +0300)]
mir: pretty-print `Rvalue::Aggregate` correctly.

4 years agoRollup merge of #71225 - leocassarani:patch-1, r=jonas-schievink
Dylan DPC [Fri, 17 Apr 2020 01:05:21 +0000 (03:05 +0200)]
Rollup merge of #71225 - leocassarani:patch-1, r=jonas-schievink

Fix typo in Default trait docs: Provides -> Provide

An earlier commit (99ed06e) accidentally changed this paragraph from the original, imperative `Provide` to the present tense `Provides`. The latter is indeed the standard for Rustdoc comments relating to a function or method, but this snippet is introducing the `Default` trait in general terms and not talking about any particular function. I believe this change was likely made in error and should be reverted.

4 years agoRollup merge of #71220 - cuviper:std_or_patterns, r=Mark-Simulacrum
Dylan DPC [Fri, 17 Apr 2020 01:05:19 +0000 (03:05 +0200)]
Rollup merge of #71220 - cuviper:std_or_patterns, r=Mark-Simulacrum

Dogfood or_patterns in the standard library

We can start using `or_patterns` in the standard library as a step toward stabilization.

cc #54883 @Centril

4 years agoRollup merge of #71206 - RalfJung:dont-try, r=oli-obk
Dylan DPC [Fri, 17 Apr 2020 01:05:18 +0000 (03:05 +0200)]
Rollup merge of #71206 - RalfJung:dont-try, r=oli-obk

Miri error messages: avoid try terminology

r? @oli-obk

4 years agoRollup merge of #71182 - JohnTitor:regression-tests, r=Mark-Simulacrum
Dylan DPC [Fri, 17 Apr 2020 01:05:16 +0000 (03:05 +0200)]
Rollup merge of #71182 - JohnTitor:regression-tests, r=Mark-Simulacrum

Add some regression tests

Closes #24843
Closes #28575
Closes #54067
Closes #66868
Closes #67893
Closes #68813

4 years agoRollup merge of #71164 - RalfJung:uninit-not-undef, r=oli-obk
Dylan DPC [Fri, 17 Apr 2020 01:05:15 +0000 (03:05 +0200)]
Rollup merge of #71164 - RalfJung:uninit-not-undef, r=oli-obk

reword Miri validity errors: undefined -> uninitialized

I don't think we say "undefined value" or anything like that anywhere in the docs or so, but we do use the term "uninitialized memory", so I think we should do the same here.

Longer-term, I think we should also internally rename "undef" to "uninit".

r? @oli-obk

4 years agoRollup merge of #70910 - rakshith-ravi:master, r=cuviper
Dylan DPC [Fri, 17 Apr 2020 01:05:13 +0000 (03:05 +0200)]
Rollup merge of #70910 - rakshith-ravi:master, r=cuviper

Hides default fns inside Fuse impl to avoid exposing it to any crate

Fixes #70796

@cuviper I've added some default, private traits to do the job for us. If required, I can expose them to a specific visibility if you want to call these functions for #70332

r? @cuviper

4 years agoRollup merge of #70578 - PankajChaudhary5:master, r=GuillaumeGomez
Dylan DPC [Fri, 17 Apr 2020 01:05:11 +0000 (03:05 +0200)]
Rollup merge of #70578 - PankajChaudhary5:master, r=GuillaumeGomez

Add long error explanation for E0657

Added proper error explanation for issue E0657 in the Rust compiler.

Part of #61137

r? @GuillaumeGomez

4 years agoty/print/pretty: use `comma_sep` instead of replicating it.
Eduard-Mihai Burtescu [Fri, 17 Apr 2020 00:54:13 +0000 (03:54 +0300)]
ty/print/pretty: use `comma_sep` instead of replicating it.

4 years agoAuto merge of #71131 - pnkfelix:issue-69798-dont-reuse-post-lto-products-when-exports...
bors [Fri, 17 Apr 2020 00:44:24 +0000 (00:44 +0000)]
Auto merge of #71131 - pnkfelix:issue-69798-dont-reuse-post-lto-products-when-exports-change, r=nagisa

Do not reuse post LTO products when exports change

Do not reuse post lto products when exports change

Generalizes code from PR #67020, which handled case when imports change.

Fix #69798

4 years agoFix typo in Default trait docs: Provides -> Provide
Leo Cassarani [Thu, 16 Apr 2020 21:30:53 +0000 (22:30 +0100)]
Fix typo in Default trait docs: Provides -> Provide

An earlier commit (99ed06e) accidentally changed this paragraph from the
original, imperative "Provide" to the present tense "Provides". The
latter is indeed the standard for Rustdoc comments relating to a
function or method, but this snippet is introducing the Default trait in
general terms and not talking about any particular function. I believe
this change was likely made in error and should be reverted.

4 years agoAuto merge of #71223 - Dylan-DPC:rollup-z5itu39, r=Dylan-DPC
bors [Thu, 16 Apr 2020 21:36:23 +0000 (21:36 +0000)]
Auto merge of #71223 - Dylan-DPC:rollup-z5itu39, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70611 (Add long error explanation for E0708 #61137)
 - #71197 (Don't use the HirId to NodeId map in MIR)
 - #71211 (Update cargo)
 - #71219 (Minor fixes to doc comments of 'VecDeque')
 - #71221 (Dogfood or_patterns in rustdoc)

Failed merges:

r? @ghost

4 years agoRollup merge of #71221 - cuviper:rustdoc_or_patterns, r=Mark-Simulacrum
Dylan DPC [Thu, 16 Apr 2020 21:34:46 +0000 (23:34 +0200)]
Rollup merge of #71221 - cuviper:rustdoc_or_patterns, r=Mark-Simulacrum

Dogfood or_patterns in rustdoc

We can start using `or_patterns` in `rustdoc` as a step toward stabilization.

cc #54883 @Centril

4 years agoRollup merge of #71219 - JOE1994:patch-4, r=Mark-Simulacrum
Dylan DPC [Thu, 16 Apr 2020 21:34:45 +0000 (23:34 +0200)]
Rollup merge of #71219 - JOE1994:patch-4, r=Mark-Simulacrum

Minor fixes to doc comments of 'VecDeque'

1. Changed descriptions of `fn get` & `fn get_mut`.
  Since both of these functions are returning references, and not the owned value, I thought the doc comments could be fixed to be consistent with doc comments of `fn front` & `fn front_mut`.

2. Other changes are minor fixes or additions for clarification.

Thank you for taking a look :)

4 years agoRollup merge of #71211 - ehuss:update-cargo, r=ehuss
Dylan DPC [Thu, 16 Apr 2020 21:34:43 +0000 (23:34 +0200)]
Rollup merge of #71211 - ehuss:update-cargo, r=ehuss

Update cargo

3 commits in 74e3a7d5b756d7c0e94399fc29fcd154e792c22a..ebda5065ee8a1e46801380abcbac21a25bc7e755
2020-04-13 20:41:52 +0000 to 2020-04-16 14:28:43 +0000
- Don't use debug display for error object. (rust-lang/cargo#8119)
- Add backwards-compatibility for old cargo-tree flags. (rust-lang/cargo#8115)
- Try to avoid panics on buggy (?) clocks (rust-lang/cargo#8114)

4 years agoRollup merge of #71197 - ljedrz:unsafe_unused, r=ecstatic-morse
Dylan DPC [Thu, 16 Apr 2020 21:34:42 +0000 (23:34 +0200)]
Rollup merge of #71197 - ljedrz:unsafe_unused, r=ecstatic-morse

Don't use the HirId to NodeId map in MIR

Another step towards not having to build a `HirId` to `NodeId` map other than for doc and RLS purposes.

We are currently sorting `unsafe` blocks by `NodeId` in `check_unsafety`; change it to sorting by `Span` instead; this passes the tests, but better ideas are welcome.

In addition, simplify the split between the used and unused `unsafe` blocks for readability and less sorting.

cc https://github.com/rust-lang/rust/issues/50928

4 years agoRollup merge of #70611 - pawanbisht62:doc/61137-add-long-error-code-e0708, r=Guillaum...
Dylan DPC [Thu, 16 Apr 2020 21:34:41 +0000 (23:34 +0200)]
Rollup merge of #70611 - pawanbisht62:doc/61137-add-long-error-code-e0708, r=GuillaumeGomez

Add long error explanation for E0708 #61137

Add long explanation for the E0708 error code
Part of #61137

r? @GuillaumeGomez

4 years agoAvoid emitting stderr for now
Yuki Okushi [Thu, 16 Apr 2020 15:14:52 +0000 (00:14 +0900)]
Avoid emitting stderr for now

4 years agoAdd test for issue-67893
Yuki Okushi [Thu, 16 Apr 2020 01:09:59 +0000 (10:09 +0900)]
Add test for issue-67893

4 years agoAdd test for issue-54067
Yuki Okushi [Thu, 16 Apr 2020 01:09:47 +0000 (10:09 +0900)]
Add test for issue-54067

4 years agoAdd test for issue-28575
Yuki Okushi [Thu, 16 Apr 2020 01:09:34 +0000 (10:09 +0900)]
Add test for issue-28575

4 years agoAdd test for issue-24843
Yuki Okushi [Thu, 16 Apr 2020 01:09:16 +0000 (10:09 +0900)]
Add test for issue-24843

4 years agoDogfood or_patterns in rustdoc
Josh Stone [Thu, 16 Apr 2020 20:58:47 +0000 (13:58 -0700)]
Dogfood or_patterns in rustdoc

4 years agoApply suggestions from code review
Christopher Durham [Thu, 16 Apr 2020 20:44:30 +0000 (16:44 -0400)]
Apply suggestions from code review

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoMinor fixes to doc comments of 'VecDequeue'
Youngsuk Kim [Thu, 16 Apr 2020 20:26:14 +0000 (16:26 -0400)]
Minor fixes to doc comments of 'VecDequeue'

1. Changed descriptions of `fn get` & `fn get_mut`.
  Since both of these functions are returning references, and not the owned value, I thought the doc comments could be fixed to be consistent with doc comments of `fn front` & `fn front_mut`.

2. Other changes are minor fixes or additions for clarification.

Thank you for taking a look :)

4 years agooutlives: ignore lifetimes shallowly found in `ty::FnDef`s.
Eduard-Mihai Burtescu [Thu, 16 Apr 2020 20:18:44 +0000 (23:18 +0300)]
outlives: ignore lifetimes shallowly found in `ty::FnDef`s.

4 years agoDogfood or_patterns in the standard library
Josh Stone [Thu, 16 Apr 2020 19:44:57 +0000 (12:44 -0700)]
Dogfood or_patterns in the standard library

4 years agoAuto merge of #71201 - Dylan-DPC:rollup-23202uf, r=Dylan-DPC
bors [Thu, 16 Apr 2020 18:02:11 +0000 (18:02 +0000)]
Auto merge of #71201 - Dylan-DPC:rollup-23202uf, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70566 (Don't bail out before linting in generic contexts.)
 - #71141 (Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa)
 - #71149 (remove an impossible branch from check_consts)
 - #71179 (fix more clippy warnings)
 - #71191 (Clean up E0520 explanation)

Failed merges:

r? @ghost

4 years agocomment on the sorting of unused unsafe blocks
ljedrz [Thu, 16 Apr 2020 18:00:54 +0000 (20:00 +0200)]
comment on the sorting of unused unsafe blocks

4 years agoUpdate cargo
Eric Huss [Thu, 16 Apr 2020 17:16:11 +0000 (10:16 -0700)]
Update cargo

4 years agoMove stack access methods in the Machine implementations out of the enforce_ method...
Vytautas Astrauskas [Thu, 16 Apr 2020 16:57:12 +0000 (09:57 -0700)]
Move stack access methods in the Machine implementations out of the enforce_ method group.

4 years agobikeshed
Ralf Jung [Thu, 16 Apr 2020 16:47:05 +0000 (18:47 +0200)]
bikeshed

4 years agoty: convert `ErrorHandled::Reported` to `ConstKind::Error`.
Eduard-Mihai Burtescu [Sun, 12 Apr 2020 04:16:38 +0000 (07:16 +0300)]
ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.

4 years agomir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.
Eduard-Mihai Burtescu [Sun, 12 Apr 2020 01:24:25 +0000 (04:24 +0300)]
mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.

4 years agoPartially revert "Do not ICE in the face of invalid enum discriminant"
Eduard-Mihai Burtescu [Thu, 16 Apr 2020 10:48:17 +0000 (13:48 +0300)]
Partially revert "Do not ICE in the face of invalid enum discriminant"

This (partially) reverts commit f47c4ffdfacc783b3fe4bad395a6e16ae296b3d1.

4 years agoty: add `ty::ConstKind::Error` to replace `tcx.consts.err`.
Eduard-Mihai Burtescu [Thu, 16 Apr 2020 10:47:47 +0000 (13:47 +0300)]
ty: add `ty::ConstKind::Error` to replace `tcx.consts.err`.

4 years agoMiri error messages: avoid try terminology
Ralf Jung [Thu, 16 Apr 2020 15:41:28 +0000 (17:41 +0200)]
Miri error messages: avoid try terminology

4 years agoRemove inline attribute from `into_vec()`
Yuki Okushi [Thu, 16 Apr 2020 15:23:44 +0000 (00:23 +0900)]
Remove inline attribute from `into_vec()`

4 years agorustc_target::abi: add Primitive variant to FieldsShape.
Ana-Maria Mihalache [Thu, 16 Apr 2020 15:15:46 +0000 (15:15 +0000)]
rustc_target::abi: add Primitive variant to FieldsShape.

4 years agoMove the explanation why adjust_global_const is called for all constants.
Vytautas Astrauskas [Thu, 16 Apr 2020 15:09:42 +0000 (08:09 -0700)]
Move the explanation why adjust_global_const is called for all constants.

4 years agoRename Machine::eval_maybe_thread_local_static_const to adjust_global_const and add...
Vytautas Astrauskas [Thu, 16 Apr 2020 14:47:10 +0000 (07:47 -0700)]
Rename Machine::eval_maybe_thread_local_static_const to adjust_global_const and add an additional comment.

4 years agoRollup merge of #71191 - GuillaumeGomez:cleanup-e0520, r=Dylan-DPC
Dylan DPC [Thu, 16 Apr 2020 14:34:32 +0000 (16:34 +0200)]
Rollup merge of #71191 - GuillaumeGomez:cleanup-e0520, r=Dylan-DPC

Clean up E0520 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPC
Dylan DPC [Thu, 16 Apr 2020 14:34:30 +0000 (16:34 +0200)]
Rollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPC

fix more clippy warnings

4 years agoRollup merge of #71149 - RalfJung:check-const-call, r=eddyb
Dylan DPC [Thu, 16 Apr 2020 14:34:29 +0000 (16:34 +0200)]
Rollup merge of #71149 - RalfJung:check-const-call, r=eddyb

remove an impossible branch from check_consts

All function calleess are either `FnPtr` or `FnDef`, so we can remove the alternative from check_consts and just make it ICE instead.

4 years agoRollup merge of #71141 - Duddino:master, r=estebank
Dylan DPC [Thu, 16 Apr 2020 14:34:27 +0000 (16:34 +0200)]
Rollup merge of #71141 - Duddino:master, r=estebank

Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa

Fixes #71089

4 years agoRollup merge of #70566 - jumbatm:exceeding-bitshifts-constprop, r=RalfJung
Dylan DPC [Thu, 16 Apr 2020 14:34:23 +0000 (16:34 +0200)]
Rollup merge of #70566 - jumbatm:exceeding-bitshifts-constprop, r=RalfJung

Don't bail out before linting in generic contexts.

Fixes #69021.

cc #70017

r? @RalfJung

4 years agoAuto merge of #70755 - wesleywiser:simplify_locals_2_electric_boogaloo, r=oli-obk
bors [Thu, 16 Apr 2020 14:26:43 +0000 (14:26 +0000)]
Auto merge of #70755 - wesleywiser:simplify_locals_2_electric_boogaloo, r=oli-obk

[mir-opt] Run SimplifyLocals to a fixedpoint and handle most rvalues

Follow up to review feedback left on #70595.

4 years agosort unused unsafe blocks by Span instead of NodeId
ljedrz [Thu, 16 Apr 2020 12:53:09 +0000 (14:53 +0200)]
sort unused unsafe blocks by Span instead of NodeId

4 years agoRespond to code review feedback
Wesley Wiser [Thu, 16 Apr 2020 12:34:37 +0000 (08:34 -0400)]
Respond to code review feedback

- Remove reads of indirect `Place`s
- Add comments explaining what the algorithm does

4 years agosimplify unused unsafe block handling
ljedrz [Thu, 16 Apr 2020 12:24:52 +0000 (14:24 +0200)]
simplify unused unsafe block handling

4 years agoFixed issue with self: &Box<Self>
Duddino [Thu, 16 Apr 2020 12:04:12 +0000 (14:04 +0200)]
Fixed issue with self: &Box<Self>

4 years agoClean up E0520 explanation
Guillaume Gomez [Thu, 16 Apr 2020 11:51:02 +0000 (13:51 +0200)]
Clean up E0520 explanation

4 years ago./x.py fmt
Duddino [Thu, 16 Apr 2020 09:34:26 +0000 (11:34 +0200)]
./x.py fmt

4 years agofixed missing trait method suggests incorrect code (self parameter not named self)
Duddino [Thu, 16 Apr 2020 09:28:49 +0000 (11:28 +0200)]
fixed missing trait method suggests incorrect code (self parameter not named self)

4 years agotest fast path offset reporting
Ralf Jung [Thu, 16 Apr 2020 11:21:23 +0000 (13:21 +0200)]
test fast path offset reporting

4 years agoswitch back to 'bytes'
Ralf Jung [Thu, 16 Apr 2020 11:19:51 +0000 (13:19 +0200)]
switch back to 'bytes'

4 years agoAuto merge of #70831 - sfackler:shrink-future-stack, r=matthewjasper
bors [Thu, 16 Apr 2020 09:13:07 +0000 (09:13 +0000)]
Auto merge of #70831 - sfackler:shrink-future-stack, r=matthewjasper

Remove a stack frame from .await calls

The stack frames when `.await`ing one async fn from another currently look like this:

```
  12: foo::b::{{closure}}
             at src/main.rs:2
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:66
  14: core::future::poll_with_context
             at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:84
  15: foo::a::{{closure}}
             at src/main.rs:6
```

Since the move away from using TLS to pass the Context around, it's now easy to remove frame 14 by removing poll_with_context in favor of calling Future::poll directly. This still leaves the `GenFuture` frame, but that seems significantly harder to deal with.

It also improves diagnostics a bit since they no longer talk about the private poll_with_context function.

4 years agoAuto merge of #71173 - RalfJung:miri, r=RalfJung
bors [Thu, 16 Apr 2020 05:47:24 +0000 (05:47 +0000)]
Auto merge of #71173 - RalfJung:miri, r=RalfJung

bump Miri

Fixes https://github.com/rust-lang/rust/issues/71110
r? @ghost Cc @rust-lang/miri

4 years agoAuto merge of #71159 - topecongiro:rustfmt-1.4.14, r=Dylan-DPC
bors [Thu, 16 Apr 2020 02:10:29 +0000 (02:10 +0000)]
Auto merge of #71159 - topecongiro:rustfmt-1.4.14, r=Dylan-DPC

Bump rustfmt and rls

Close #71076. Close #71077.

r? @Xanewok

4 years agoAdd note about Layout::pad_to_align to Layout::extend
CAD97 [Wed, 15 Apr 2020 23:54:55 +0000 (19:54 -0400)]
Add note about Layout::pad_to_align to Layout::extend

4 years agobump Miri
Ralf Jung [Wed, 15 Apr 2020 16:32:41 +0000 (18:32 +0200)]
bump Miri

4 years agoAuto merge of #71180 - Dylan-DPC:rollup-pscpg6q, r=Dylan-DPC
bors [Wed, 15 Apr 2020 22:58:54 +0000 (22:58 +0000)]
Auto merge of #71180 - Dylan-DPC:rollup-pscpg6q, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #69903 (Do not ICE in the face of invalid enum discriminant)
 - #70354 (Update RELEASES.md for 1.43.0)
 - #70774 (End cleanup on rustdoc-js tools)
 - #70990 (Improve rustdoc source code a bit)
 - #71145 (Add illumos triple)
 - #71166 (Clean up E0518 explanation)

Failed merges:

r? @ghost

4 years agoRollup merge of #71166 - GuillaumeGomez:cleanup-e0518, r=Dylan-DPC
Dylan DPC [Wed, 15 Apr 2020 22:39:27 +0000 (00:39 +0200)]
Rollup merge of #71166 - GuillaumeGomez:cleanup-e0518, r=Dylan-DPC

Clean up E0518 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71145 - pfmooney:illumos-triple, r=nagisa
Dylan DPC [Wed, 15 Apr 2020 22:39:25 +0000 (00:39 +0200)]
Rollup merge of #71145 - pfmooney:illumos-triple, r=nagisa

Add illumos triple

This fixes rust-lang/rust#55553 and adds support for `illumos` as a `target_os` on `x86_64`.  In addition to the compile spec and libstd additions, several library dependencies have been bumped in order to permit working builds of cargo and rustup for the new target.

Work originally started by @jasonbking, with subsequent additions by @pfmooney and @jclulow.

4 years agoRollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27
Dylan DPC [Wed, 15 Apr 2020 22:39:24 +0000 (00:39 +0200)]
Rollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27

Improve rustdoc source code a bit

Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`.

r? @kinnison

cc @ollie27

4 years agoRollup merge of #70774 - GuillaumeGomez:clean-rustdoc-js-tools, r=ollie27
Dylan DPC [Wed, 15 Apr 2020 22:39:22 +0000 (00:39 +0200)]
Rollup merge of #70774 - GuillaumeGomez:clean-rustdoc-js-tools, r=ollie27

End cleanup on rustdoc-js tools

Fixes #70689.

It removes a lot of code, which is pretty nice. :3

We now only have one entry point and a small set of options.

r? @ollie27

4 years agoRollup merge of #70354 - XAMPPRocky:master, r=Mark-Simulacrum
Dylan DPC [Wed, 15 Apr 2020 22:39:17 +0000 (00:39 +0200)]
Rollup merge of #70354 - XAMPPRocky:master, r=Mark-Simulacrum

Update RELEASES.md for 1.43.0

### [Rendered](https://github.com/XAMPPRocky/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum

cc @rust-lang/release

4 years agoRollup merge of #69903 - estebank:icemation, r=oli-obk
Dylan DPC [Wed, 15 Apr 2020 22:39:13 +0000 (00:39 +0200)]
Rollup merge of #69903 - estebank:icemation, r=oli-obk

Do not ICE in the face of invalid enum discriminant

Fix #67377.

r? @pnkfelix

4 years agodon't clone types that are copy (clippy::clone_on_copy)
Matthias Krüger [Wed, 15 Apr 2020 22:00:22 +0000 (00:00 +0200)]
don't clone types that are copy (clippy::clone_on_copy)

4 years agoFix clippy warnings
Matthias Krüger [Wed, 15 Apr 2020 13:15:31 +0000 (15:15 +0200)]
Fix clippy warnings

clippy::{filter_next,single_char_pattern,unit_arg,identity_conversion,nonminimal_bool}

4 years agoRemove now unnecessary resolve_maybe_global_alloc.
Vytautas Astrauskas [Wed, 15 Apr 2020 21:05:14 +0000 (14:05 -0700)]
Remove now unnecessary resolve_maybe_global_alloc.

4 years agoemphasize *no trailing padding*
Christopher Durham [Wed, 15 Apr 2020 19:50:31 +0000 (15:50 -0400)]
emphasize *no trailing padding*

4 years agoInlined everything into a single trait and trait impl
Rakshith Ravi [Wed, 15 Apr 2020 19:49:51 +0000 (01:19 +0530)]
Inlined everything into a single trait and trait impl

4 years agoAuto merge of #71139 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Wed, 15 Apr 2020 19:47:56 +0000 (19:47 +0000)]
Auto merge of #71139 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from af5940b7 to d236b30a

Changes:
````
rustup https://github.com/rust-lang/rust/pull/70643
Explain panic on `E0463` in integration tests
Temporarily disable rustfmt integration test
Cleanup: Use rustc's is_proc_macro_attr
Cleanup: Use our `sym!` macro more
Fixes #5405: redundant clone false positive with arrays
update lints
verbose_bit_mask: fix bit mask used in docs
Update documentation for new_ret_no_self
````

Fixes #71114

4 years agoDirectly modify the `used_locals` vec
Wesley Wiser [Tue, 14 Apr 2020 01:02:03 +0000 (21:02 -0400)]
Directly modify the `used_locals` vec

Fixes perf regression in `optimized_mir` query

4 years agoRun `SimplifyLocals` iteratively until we get to a fixedpoint
Wesley Wiser [Sat, 4 Apr 2020 00:28:07 +0000 (20:28 -0400)]
Run `SimplifyLocals` iteratively until we get to a fixedpoint

4 years agosubmodules: update clippy from af5940b7 to 6651c1b9
Matthias Krüger [Wed, 15 Apr 2020 18:54:39 +0000 (20:54 +0200)]
submodules: update clippy from af5940b7 to 6651c1b9

Changes:
````
Rename dummy_hir_id -> parent_hir_id
rustup https://github.com/rust-lang/rust/pull/71116
Change default many single char names threshold
Better precedence case management + more tests
Use only check_expr with parent expr and precedence
Check for Deref trait impl + add fixed version
Report using stmts and expr + tests
Global rework + fix imports
Working basic dereference clip
Add test for zero single char names
Make the single char threshold strict inequality
large_enum_variant: Report sizes of variants
Refactor: Use rustc's `match_def_path`
deps: bump compiletest-rs from 0.4 to 0.5
rustup https://github.com/rust-lang/rust/pull/70643
Explain panic on `E0463` in integration tests
Temporarily disable rustfmt integration test
result_map_unit_fn: Fix incorrect UI tests
Cleanup: Use rustc's is_proc_macro_attr
Cleanup: Use our `sym!` macro more
Fixes #5405: redundant clone false positive with arrays
Disallow bit-shifting in `integer_arithmetic` lint
update lints
cargo dev fmt
Make use of Option/Result diagnostic items
Make use of some existing diagnostic items
Say that diagnostic items are preferred over paths
verbose_bit_mask: fix bit mask used in docs
Update documentation for new_ret_no_self
Update doc generation script
Add lint on large const arrays
Make the epsilon note spanless
Split check_fn function
Indicate when arrays are compared in error message
Make epsilon note spanless when comparing arrays
Add float cmp const tests for arrays
Add float cmp tests for arrays
Handle constant arrays with single value
Don't show comparison suggestion for arrays
Allow for const arrays of zeros
Handle evaluating constant index expression
Add handling of float arrays to miri_to_const
Update stderr of float_cmp test
Update field names in is_float
Add tests for float in array comparison
Add lint when comparing floats in an array
````

Fixes #71114