]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakis
Dylan DPC [Tue, 28 Apr 2020 15:55:43 +0000 (17:55 +0200)]
Rollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakis

Moving more build-pass tests to check-pass

One or two tests became build-pass without the FIXME because they really
needed build-pass (were failing without it).

Helps with #62277

---
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/rust-lang/rust/71340)
<!-- Reviewable:end -->

4 years agoUpdate cargo
Eric Huss [Tue, 28 Apr 2020 15:34:58 +0000 (08:34 -0700)]
Update cargo

4 years agoUpdate books
Eric Huss [Tue, 28 Apr 2020 14:46:36 +0000 (07:46 -0700)]
Update books

4 years agoAuto merge of #71636 - Dylan-DPC:rollup-9gc24ak, r=Dylan-DPC
bors [Tue, 28 Apr 2020 12:28:24 +0000 (12:28 +0000)]
Auto merge of #71636 - Dylan-DPC:rollup-9gc24ak, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71311 (On `FnDef` type annotation suggestion, use fn-pointer output)
 - #71488 (normalize field projection ty to fix broken MIR issue)
 - #71489 (Fix off by one in treat err as bug)
 - #71585 (remove obsolete comment)
 - #71634 (Revert #71372 ("Fix #! (shebang) stripping account space issue").)

Failed merges:

r? @ghost

4 years agoRollup merge of #71634 - eddyb:revert-71372, r=petrochenkov
Dylan DPC [Tue, 28 Apr 2020 11:12:17 +0000 (13:12 +0200)]
Rollup merge of #71634 - eddyb:revert-71372, r=petrochenkov

Revert #71372 ("Fix #! (shebang) stripping account space issue").

While #71372 fixed some of the problems `#!`-stripping had, it introduced others:
* inefficient implementation (`.chars().filter(...).collect()` on the entire input file)
  * this also means the length returned isn't always correct, leading to e.g. #71471
* it ignores whitespace anywhere, stripping ` # ! ...` which isn't a valid shebang
  * the definition of "whitespace" it uses includes newlines, which means even `\n#\n!\n...` is stripped as a shebang (and anything matching the regex `\s*#\s*!\s*`, and not followed by `[`, really)
* it's backward-incompatible but didn't go through Crater

Now, #71487 is already open and will solve all of these issues. But for running Crater, and just in case #71487 takes a bit longer, I decided it's safer to just revert #71372.

This will also make #71372's diff clearer, as it will start again from the original whitespace-unaware version.

r? @petrochenkov

4 years agoRollup merge of #71585 - tshepang:obsolete-comment, r=Dylan-DPC
Dylan DPC [Tue, 28 Apr 2020 11:12:15 +0000 (13:12 +0200)]
Rollup merge of #71585 - tshepang:obsolete-comment, r=Dylan-DPC

remove obsolete comment

Not sure if it's better to have an outdated comment or no comment at all (made obsolete by 2b9fea1300b515e0f8929bb3a09d4fb6fef3f0ea).

4 years agoRollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb
Dylan DPC [Tue, 28 Apr 2020 11:12:14 +0000 (13:12 +0200)]
Rollup merge of #71489 - spastorino:fix-treat-err-as-bug-handling, r=eddyb

Fix off by one in treat err as bug

`-Ztreat-err-as-bug` doesn't work properly with delay_span_bug.

r? @eddyb

4 years agoRollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r=eddyb
Dylan DPC [Tue, 28 Apr 2020 11:12:12 +0000 (13:12 +0200)]
Rollup merge of #71488 - spastorino:normalize-ty-to-fix-broken-mir, r=eddyb

normalize field projection ty to fix broken MIR issue

Fixes #71344

r? @eddyb

4 years agoRollup merge of #71311 - estebank:fn-type-param, r=varkor
Dylan DPC [Tue, 28 Apr 2020 11:12:09 +0000 (13:12 +0200)]
Rollup merge of #71311 - estebank:fn-type-param, r=varkor

On `FnDef` type annotation suggestion, use fn-pointer output

Address the last point in #71209.

4 years agoRevert "Rollup merge of #71372 - ayushmishra2005:shebang_stripping, r=estebank"
Eduard-Mihai Burtescu [Tue, 28 Apr 2020 10:02:58 +0000 (13:02 +0300)]
Revert "Rollup merge of #71372 - ayushmishra2005:shebang_stripping, r=estebank"

This reverts commit 46a8dcef5c9e4de0d412c6ac3c4765cb4aef4f7f, reversing
changes made to f28e3873c55eb4bdcfc496e1f300b97aeb0d189c.

4 years agoAdd inlining.
Camille GILLOT [Tue, 28 Apr 2020 09:57:38 +0000 (11:57 +0200)]
Add inlining.

4 years agoMove a few queries to using an arena.
Camille GILLOT [Tue, 14 Apr 2020 22:07:31 +0000 (00:07 +0200)]
Move a few queries to using an arena.

4 years agoFix fulldeps tests.
Camille GILLOT [Fri, 3 Apr 2020 15:15:02 +0000 (17:15 +0200)]
Fix fulldeps tests.

4 years agoFix incremental compilation.
Camille GILLOT [Fri, 3 Apr 2020 07:49:21 +0000 (09:49 +0200)]
Fix incremental compilation.

4 years agoFix unused parentheses warning.
Camille GILLOT [Thu, 2 Apr 2020 08:13:38 +0000 (10:13 +0200)]
Fix unused parentheses warning.

4 years agoStop leaking memory.
Camille GILLOT [Wed, 1 Apr 2020 12:29:55 +0000 (14:29 +0200)]
Stop leaking memory.

4 years agoUse the query system to allocate.
Camille GILLOT [Fri, 27 Mar 2020 19:26:20 +0000 (20:26 +0100)]
Use the query system to allocate.

4 years agoIntroduce ArenaStorage.
Camille GILLOT [Fri, 27 Mar 2020 17:46:25 +0000 (18:46 +0100)]
Introduce ArenaStorage.

4 years agoAllow the QueryCache to specify storage.
Camille GILLOT [Fri, 27 Mar 2020 17:41:13 +0000 (18:41 +0100)]
Allow the QueryCache to specify storage.

4 years agoAuto merge of #71444 - RalfJung:test-async-no-opt, r=jonas-schievink
bors [Tue, 28 Apr 2020 09:06:55 +0000 (09:06 +0000)]
Auto merge of #71444 - RalfJung:test-async-no-opt, r=jonas-schievink

smoke-test for async fn with mir-opt-level=0

MIR opt levels heavily influence which MIR transformations run, and we barely test non-default opt levels. I am particularly worried about `async fn` lowering and how it might (not) work when the set of preceding MIR passes changes -- see https://github.com/rust-lang/rust/pull/70073.

This adds some basic smoke testing, where at least a few `async fn` `run-pass` test are ensured to also work with mir-opt-level=0.

4 years agoalso run some generator tests without MIR optimizations
Ralf Jung [Tue, 28 Apr 2020 06:22:08 +0000 (08:22 +0200)]
also run some generator tests without MIR optimizations

4 years agoAuto merge of #71292 - marmeladema:queries-local-def-id, r=eddyb
bors [Tue, 28 Apr 2020 05:01:27 +0000 (05:01 +0000)]
Auto merge of #71292 - marmeladema:queries-local-def-id, r=eddyb

Convert more queries to use `LocalDefId`

This PR is based on commits in https://github.com/rust-lang/rust/pull/71215 and should partially solve #70853

4 years agoPolished documentation, removed not-so-useful-anymore traces, and added some doc...
Félix Fischer [Thu, 23 Apr 2020 02:43:52 +0000 (22:43 -0400)]
Polished documentation, removed not-so-useful-anymore traces, and added some doc comments in `mir/transform/const_prop.rs`

4 years agoChanged `simplify_match` output query because it had become outdated
Félix Fischer [Mon, 27 Apr 2020 23:05:44 +0000 (19:05 -0400)]
Changed `simplify_match` output query because it had become outdated

4 years agoAdded MIR const-prop diff tests to show why some assertions now fail at compile-time
Félix Fischer [Mon, 27 Apr 2020 22:57:58 +0000 (18:57 -0400)]
Added MIR const-prop diff tests to show why some assertions now fail at compile-time

4 years agoAdded new ui tests to show what errors MIR can now find at compile time
Félix Fischer [Mon, 27 Apr 2020 22:43:18 +0000 (18:43 -0400)]
Added new ui tests to show what errors MIR can now find at compile time

4 years agoAllow Locals to be propagated into and from, but restricted to their own block
Félix Fischer [Thu, 23 Apr 2020 16:25:28 +0000 (12:25 -0400)]
Allow Locals to be propagated into and from, but restricted to their own block

4 years agoAuto merge of #71606 - Xanewok:update-rls, r=Xanewok
bors [Tue, 28 Apr 2020 01:46:47 +0000 (01:46 +0000)]
Auto merge of #71606 - Xanewok:update-rls, r=Xanewok

Update RLS to unbreak toolstate

Breakage caused by https://github.com/rust-lang/rust/pull/71263.

r? @ghost

4 years agoBlocked `MutatingUseContext::Projection` for all locals of kind `LocalKind::Temp...
Félix Fischer [Thu, 23 Apr 2020 01:53:51 +0000 (21:53 -0400)]
Blocked `MutatingUseContext::Projection` for all locals of kind `LocalKind::Temp`. Added a cache of `LocalKind`s to `CanConstProp`

4 years agoAdded regression test for literal propagation and for scalar pair propagation
Félix Fischer [Thu, 23 Apr 2020 01:39:47 +0000 (21:39 -0400)]
Added regression test for literal propagation and for scalar pair propagation

4 years agoFix wrong argument in autoderef process
Donough Liu [Tue, 28 Apr 2020 00:05:24 +0000 (08:05 +0800)]
Fix wrong argument in autoderef process

4 years agoAccept `LocalDefId` as key for `check_impl_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:12:02 +0000 (17:12 +0100)]
Accept `LocalDefId` as key for `check_impl_item_well_formed` query

4 years agoAccept `LocalDefId` as key for `check_trait_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:10:50 +0000 (17:10 +0100)]
Accept `LocalDefId` as key for `check_trait_item_well_formed` query

4 years agoAccept `LocalDefId` as key for `check_item_well_formed` query
marmeladema [Sat, 18 Apr 2020 16:08:30 +0000 (17:08 +0100)]
Accept `LocalDefId` as key for `check_item_well_formed` query

4 years agoChange return type of `entry_fn` query to return a `LocalDefId`
marmeladema [Sat, 18 Apr 2020 15:34:41 +0000 (16:34 +0100)]
Change return type of `entry_fn` query to return a `LocalDefId`

4 years agoDeclare `body_owner` and `subject_def_id` as `LocalDefId` in `RegionCtxt`
marmeladema [Sat, 18 Apr 2020 15:12:51 +0000 (16:12 +0100)]
Declare `body_owner` and `subject_def_id` as `LocalDefId` in `RegionCtxt`

4 years agoDeclare `body_owner` as `LocalDefId` in `MemCategorizationContext`
marmeladema [Sat, 18 Apr 2020 15:06:06 +0000 (16:06 +0100)]
Declare `body_owner` as `LocalDefId` in `MemCategorizationContext`

4 years agoAccept `LocalDefId` as key for `check_mod_privacy` query
marmeladema [Sat, 18 Apr 2020 14:25:53 +0000 (15:25 +0100)]
Accept `LocalDefId` as key for `check_mod_privacy` query

4 years agoAccept `LocalDefId` as key for `lint_mod` query
marmeladema [Sat, 18 Apr 2020 14:19:56 +0000 (15:19 +0100)]
Accept `LocalDefId` as key for `lint_mod` query

4 years agoAccept `LocalDefId` as argument for `mir_build::lint::check`
marmeladema [Sat, 18 Apr 2020 14:16:01 +0000 (15:16 +0100)]
Accept `LocalDefId` as argument for `mir_build::lint::check`

4 years agoAccept `LocalDefId` as key for `mir_validated` query
marmeladema [Sat, 18 Apr 2020 12:41:52 +0000 (13:41 +0100)]
Accept `LocalDefId` as key for `mir_validated` query

4 years agoUpdate link to unstable book for llvm_asm macro
Zach Reizner [Mon, 27 Apr 2020 22:51:51 +0000 (15:51 -0700)]
Update link to unstable book for llvm_asm macro

4 years agoAuto merge of #71620 - Dylan-DPC:rollup-9wgtisb, r=Dylan-DPC
bors [Mon, 27 Apr 2020 22:49:05 +0000 (22:49 +0000)]
Auto merge of #71620 - Dylan-DPC:rollup-9wgtisb, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #67841 (Add Read/Write::can_read/write_vectored)
 - #71524 (Minimize parameter of coerce_borrowed_pointer())
 - #71558 (Cleanup and document `-Z tls-model` )
 - #71578 (linkchecker: fix typo in main.rs)
 - #71596 (Fix broken link in `QPath` documentation)
 - #71604 (make recursive-zst test unleashed)
 - #71605 (No need to whitelist E0750 anymore)

Failed merges:

r? @ghost

4 years agoDisable localization for all linkers
Vadim Petrochenkov [Mon, 27 Apr 2020 20:37:57 +0000 (23:37 +0300)]
Disable localization for all linkers

4 years agoAccept `LocalDefId` as key for `mir_borrowck` query
marmeladema [Sat, 18 Apr 2020 12:13:06 +0000 (13:13 +0100)]
Accept `LocalDefId` as key for `mir_borrowck` query

4 years agoReturn a `FxHashSet<LocalDefId>` from `mir_keys` query
marmeladema [Sat, 18 Apr 2020 11:58:53 +0000 (12:58 +0100)]
Return a `FxHashSet<LocalDefId>` from `mir_keys` query

4 years agoAccept `LocalDefId` as keyt for `names_imported_by_glob_use`
marmeladema [Sat, 18 Apr 2020 00:10:15 +0000 (01:10 +0100)]
Accept `LocalDefId` as keyt for `names_imported_by_glob_use`

and `maybe_unused_trait_import` queries

4 years agoUse `LocalDefId` for `type_param_predicates` query
marmeladema [Fri, 17 Apr 2020 20:58:04 +0000 (21:58 +0100)]
Use `LocalDefId` for `type_param_predicates` query

4 years agoUse `LocalDefId` in `mir_built` query
marmeladema [Fri, 17 Apr 2020 14:53:37 +0000 (15:53 +0100)]
Use `LocalDefId` in `mir_built` query

4 years agoUse `LocalDefId` in `unsafety_check_result` query
marmeladema [Fri, 17 Apr 2020 14:25:44 +0000 (15:25 +0100)]
Use `LocalDefId` in `unsafety_check_result` query

4 years agoUse `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queries
marmeladema [Fri, 17 Apr 2020 14:17:01 +0000 (15:17 +0100)]
Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queries

4 years agoRollup merge of #71605 - GuillaumeGomez:remove-e0750-from-whitelist, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:11 +0000 (22:15 +0200)]
Rollup merge of #71605 - GuillaumeGomez:remove-e0750-from-whitelist, r=Dylan-DPC

No need to whitelist E0750 anymore

Since #71304 has been fixed, no need to whitelist it anymore.

r? @Dylan-DPC

4 years agoRollup merge of #71604 - RalfJung:unleash-recursive-zst, r=oli-obk
Dylan DPC [Mon, 27 Apr 2020 20:15:09 +0000 (22:15 +0200)]
Rollup merge of #71604 - RalfJung:unleash-recursive-zst, r=oli-obk

make recursive-zst test unleashed

Make sure we find this issue even without const qualification.

r? @oli-obk @ecstatic-morse

4 years agoRollup merge of #71596 - LeSeulArtichaut:patch-1, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:07 +0000 (22:15 +0200)]
Rollup merge of #71596 - LeSeulArtichaut:patch-1, r=Dylan-DPC

Fix broken link in `QPath` documentation

r? @Dylan-DPC

4 years agoRollup merge of #71578 - ryzokuken:linkchecker, r=Dylan-DPC
Dylan DPC [Mon, 27 Apr 2020 20:15:06 +0000 (22:15 +0200)]
Rollup merge of #71578 - ryzokuken:linkchecker, r=Dylan-DPC

linkchecker: fix typo in main.rs

Came across this while reading the file.

4 years agoRollup merge of #71558 - petrochenkov:tlsm, r=Amanieu
Dylan DPC [Mon, 27 Apr 2020 20:15:04 +0000 (22:15 +0200)]
Rollup merge of #71558 - petrochenkov:tlsm, r=Amanieu

Cleanup and document `-Z tls-model`

r? @Amanieu

4 years agoRollup merge of #71524 - ldm0:ptrparam, r=matthewjasper
Dylan DPC [Mon, 27 Apr 2020 20:15:01 +0000 (22:15 +0200)]
Rollup merge of #71524 - ldm0:ptrparam, r=matthewjasper

Minimize parameter of coerce_borrowed_pointer()

Change last parameter of `coerce_borrowed_pointer()` from `TypeAndMut` to `Mutability` (similar to `coerce_unsafe_ptr()`), since the `TypeAndMut::ty` is never used directly in this function.

4 years agoRollup merge of #67841 - sfackler:can-vector, r=Amaneiu
Dylan DPC [Mon, 27 Apr 2020 20:14:55 +0000 (22:14 +0200)]
Rollup merge of #67841 - sfackler:can-vector, r=Amaneiu

Add Read/Write::can_read/write_vectored

When working with an arbitrary reader or writer, code that uses vectored
operations may end up being slower than code that copies into a single
buffer when the underlying reader or writer doesn't actually support
vectored operations. These new methods allow you to ask the reader or
witer up front if vectored operations are efficiently supported.

Currently, you have to use some heuristics to guess by e.g. checking if
the read or write only accessed the first buffer. Hyper is one concrete
example of a library that has to do this dynamically:
https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594

4 years agoAuto merge of #71200 - oli-obk:mir_bless, r=eddyb
bors [Mon, 27 Apr 2020 19:36:46 +0000 (19:36 +0000)]
Auto merge of #71200 - oli-obk:mir_bless, r=eddyb

Emit basic block info for stmts and terminators in MIR dumps only with -Zverbose

r? @eddyb

as per https://github.com/rust-lang/rust/pull/70755#discussion_r403419476

4 years agoSuggest `into` instead of `try_into` if possible with int types
Samrat Man Singh [Mon, 27 Apr 2020 18:43:37 +0000 (00:13 +0530)]
Suggest `into` instead of `try_into` if possible with int types

If it is possible to convert an integer type into another using
`into`, don't suggest `try_into`. This commit changes the suggested
method to convert from one integer type to another for the following
cases:

- u{n} -> i{m} where n < m
- u8 -> isize
- i{n} -> isize where n <= 16
- u{n} -> usize where n <= 16

4 years agofix typo
Esteban Kuber [Mon, 27 Apr 2020 17:59:44 +0000 (10:59 -0700)]
fix typo

Co-Authored-By: varkor <github@varkor.com>
4 years agoshare some common code for compile-time miri instances
Ralf Jung [Mon, 27 Apr 2020 17:01:30 +0000 (19:01 +0200)]
share some common code for compile-time miri instances

4 years agoAdd test for delay_span_bug and -Ztrear-err-as-bug
Santiago Pastorino [Fri, 24 Apr 2020 19:08:22 +0000 (16:08 -0300)]
Add test for delay_span_bug and -Ztrear-err-as-bug

4 years agokeep 'pointer' terminology around
Ralf Jung [Mon, 27 Apr 2020 15:52:50 +0000 (17:52 +0200)]
keep 'pointer' terminology around

4 years agoEmit basic block ids for statements and terminators in MIR only in -Zverbose mode
Oliver Scherer [Sat, 25 Apr 2020 09:01:43 +0000 (11:01 +0200)]
Emit basic block ids for statements and terminators in MIR only in -Zverbose mode

4 years agoFix off by one error for delay_span_bug
Santiago Pastorino [Fri, 24 Apr 2020 04:03:20 +0000 (01:03 -0300)]
Fix off by one error for delay_span_bug

delay_span_bug bumps error_count after checking treat_err_as_bug

4 years agoUpdate RLS to unbreak toolstate
Igor Matuszewski [Mon, 27 Apr 2020 12:14:06 +0000 (14:14 +0200)]
Update RLS to unbreak toolstate

Breakage caused by https://github.com/rust-lang/rust/pull/71263.

4 years agofix wasi
Steven Fackler [Mon, 27 Apr 2020 11:50:03 +0000 (04:50 -0700)]
fix wasi

4 years agomake recursive-zst test unleashed
Ralf Jung [Mon, 27 Apr 2020 11:08:02 +0000 (13:08 +0200)]
make recursive-zst test unleashed

4 years agoNo need to whitelist E0750 anymore
Guillaume Gomez [Mon, 27 Apr 2020 11:36:45 +0000 (13:36 +0200)]
No need to whitelist E0750 anymore

4 years agoAuto merge of #71268 - estebank:devectorize, r=eddyb
bors [Mon, 27 Apr 2020 10:00:05 +0000 (10:00 +0000)]
Auto merge of #71268 - estebank:devectorize, r=eddyb

Remove some `Vec` allocations to improve performance

This claws back most of the performance lost in https://github.com/rust-lang/rust/pull/69745.
r? @eddyb

4 years agoAuto merge of #70073 - wesleywiser:mir_opt_level_0, r=oli-obk
bors [Mon, 27 Apr 2020 07:04:46 +0000 (07:04 +0000)]
Auto merge of #70073 - wesleywiser:mir_opt_level_0, r=oli-obk

Don't run various MIR optimizations at mir-opt-level=0

Add missing checks for mir-opt-level to non-essential MIR passes.

I verified that this can still bootstrap even with these passes disabled.

r? @oli-obk cc @RalfJung

4 years agoAuto merge of #71600 - Dylan-DPC:rollup-7tvzi9n, r=Dylan-DPC
bors [Mon, 27 Apr 2020 02:38:50 +0000 (02:38 +0000)]
Auto merge of #71600 - Dylan-DPC:rollup-7tvzi9n, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #68716 (Stabilize `Span::mixed_site`)
 - #71263 (Remove unused abs_path method from rustc_span::source_map::FileLoader)
 - #71409 (Point at the return type on `.into()` failure caused by `?`)
 - #71419 (add message for resolution failure because wrong namespace)
 - #71438 (Tweak some suggestions in `rustc_resolve`)
 - #71589 (remove Unique::from for shared pointer types)

Failed merges:

r? @ghost

4 years agoRollup merge of #71589 - RalfJung:unique-no-shr, r=SimonSapin
Dylan DPC [Mon, 27 Apr 2020 01:26:18 +0000 (03:26 +0200)]
Rollup merge of #71589 - RalfJung:unique-no-shr, r=SimonSapin

remove Unique::from for shared pointer types

r? @SimonSapin

4 years agoRollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:17 +0000 (03:26 +0200)]
Rollup merge of #71438 - estebank:resolve-sugg-tiny, r=petrochenkov

Tweak some suggestions in `rustc_resolve`

4 years agoRollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:15 +0000 (03:26 +0200)]
Rollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkov

add message for resolution failure because wrong namespace

closes https://github.com/rust-lang/rust/issues/71406

4 years agoRollup merge of #71409 - estebank:point-at-ret-question-mark-op, r=petrochenkov
Dylan DPC [Mon, 27 Apr 2020 01:26:13 +0000 (03:26 +0200)]
Rollup merge of #71409 - estebank:point-at-ret-question-mark-op, r=petrochenkov

Point at the return type on `.into()` failure caused by `?`

Fix #35946.

4 years agoRollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok
Dylan DPC [Mon, 27 Apr 2020 01:26:11 +0000 (03:26 +0200)]
Rollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=Xanewok

Remove unused abs_path method from rustc_span::source_map::FileLoader

4 years agoRollup merge of #68716 - petrochenkov:stabmixed, r=dtolnay
Dylan DPC [Mon, 27 Apr 2020 01:26:05 +0000 (03:26 +0200)]
Rollup merge of #68716 - petrochenkov:stabmixed, r=dtolnay

Stabilize `Span::mixed_site`

Closes https://github.com/rust-lang/rust/issues/65049.
cc https://github.com/rust-lang/rust/issues/54727#issuecomment-580647446

Pre-requisite for https://github.com/rust-lang/rust/pull/68717 ("Stabilize fn-like proc macros in expression, pattern and statement positions").

Stabilization report: https://github.com/rust-lang/rust/pull/68716#issuecomment-581076337.

4 years agofix wasm build
Steven Fackler [Sun, 26 Apr 2020 23:34:14 +0000 (16:34 -0700)]
fix wasm build

4 years agoAuto merge of #71468 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Sun, 26 Apr 2020 23:31:54 +0000 (23:31 +0000)]
Auto merge of #71468 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from 891e1a85 to d01a4981

Changes:
````
`predecessors_for` will be removed soon
Rustup "Remove `BodyAndCache`"
span_lint_and_note now takes an Option<Span> for the note_span instead of just a span
Make lint also capture blocks and closures, adjust language to mention other mutex types
don't test the code in the lint docs
Switch to matching against full paths instead of just the last element of the path
Lint for holding locks across await points
fix crash on issue-69020-assoc-const-arith-overflow.rs
update stderr file
util/fetch_prs_between.sh: Add Markdown formatted Link
factor ifs into function, add differing mutex test
Update the changelog update documentation
Apply suggestions from PR review
update span_lint_and_help call to six args
test for mutex eq, add another test case
use if chain
cargo dev fmt
fix map import to rustc_middle
dev update_lints
fix internal clippy warnings
change visitor name to OppVisitor
use Visitor api to find Mutex::lock calls
add note about update-all-refs script, revert redundant pat to master
move closures to seperate fns, remove known problems
use span_lint_and_help, cargo dev fmt
creating suggestion
progress work on suggestion for auto fix
Implement unsafe_derive_deserialize lint
Update empty_enum.stderr
Formatting and naming
Formatting and naming
Cleanup: `node_id` -> `hir_id`
Fix issue #2907.
Don't trigger toplevel_ref_arg for `for` loops
Cleanup: future_not_send: use `return_ty` method
Remove badge FIXME from Cargo.toml
Change note_span argument for span_lint_and_note.
Add an Option<Span> argument to span_lint_and_help.
Fixes internal lint warning in code base.
Implement collapsible_span_lint_calls lint.
````

Fixes #71453

r? @Dylan-DPC

4 years agounstable-book: Document `-Z tls-model`
Vadim Petrochenkov [Sun, 26 Apr 2020 08:52:21 +0000 (11:52 +0300)]
unstable-book: Document `-Z tls-model`

4 years agorustc_target: Stop using "string typing" for TLS models
Vadim Petrochenkov [Sat, 25 Apr 2020 18:45:21 +0000 (21:45 +0300)]
rustc_target: Stop using "string typing" for TLS models

Introduce `enum TlsModel` instead.

4 years agoFix broken link in `QPath` documentation
LeSeulArtichaut [Sun, 26 Apr 2020 20:32:14 +0000 (22:32 +0200)]
Fix broken link in `QPath` documentation

4 years agoAuto merge of #71593 - Dylan-DPC:rollup-ms7j94u, r=Dylan-DPC
bors [Sun, 26 Apr 2020 20:12:48 +0000 (20:12 +0000)]
Auto merge of #71593 - Dylan-DPC:rollup-ms7j94u, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71421 (Add a function to turn Box<T> into Box<[T]>)
 - #71537 (Remove support for self-opening)
 - #71551 (Minor refactoring around IndexVec usage in generator transformation)
 - #71569 ([miri] Throw UB if target size and data size don't match)
 - #71576 (check that `AsRef` and `AsMut` are inlined)

Failed merges:

 - #71558 (Cleanup and document `-Z tls-model` )

r? @ghost

4 years agoRollup merge of #71576 - lcnr:inline-as_mut, r=oli-obk
Dylan DPC [Sun, 26 Apr 2020 19:02:40 +0000 (21:02 +0200)]
Rollup merge of #71576 - lcnr:inline-as_mut, r=oli-obk

check that `AsRef` and `AsMut` are inlined

Adds a regression test for #58867

r? @Dylan-DPC

4 years agoRollup merge of #71569 - samrat:miri-ub-on-size-mismatch, r=RalfJung
Dylan DPC [Sun, 26 Apr 2020 19:02:39 +0000 (21:02 +0200)]
Rollup merge of #71569 - samrat:miri-ub-on-size-mismatch, r=RalfJung

[miri] Throw UB if target size and data size don't match

Issue: https://github.com/rust-lang/miri/issues/1355

If an extern C function is defined as

```
extern "C" {
    fn malloc(size: u32) -> *mut std::ffi::c_void;
}
```

on a 64-bit machine(ie. pointer sizes don't match), return undefined behaviour from Miri when [converting the argument into machine_usize](https://github.com/rust-lang/miri/blob/master/src/shims/foreign_items.rs#L200)

4 years agoRollup merge of #71551 - gizmondo:gen-index-vec, r=jonas-schievink
Dylan DPC [Sun, 26 Apr 2020 19:02:36 +0000 (21:02 +0200)]
Rollup merge of #71551 - gizmondo:gen-index-vec, r=jonas-schievink

Minor refactoring around IndexVec usage in generator transformation

Replace hash map with IndexVec for liveness data.
Utilize IndexVec::push return value to avoid redundant object creation.

r? @eddyb

4 years agoRollup merge of #71537 - Mark-Simulacrum:no-self-open, r=davidtwco
Dylan DPC [Sun, 26 Apr 2020 19:02:35 +0000 (21:02 +0200)]
Rollup merge of #71537 - Mark-Simulacrum:no-self-open, r=davidtwco

Remove support for self-opening

This was only used for linkage test cases, which is already covered by
the [run-make-fulldeps/symbol-visibility test](https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/symbol-visibility/Makefile) -- which fairly extensively makes
sure we're correctly exporting the right symbols at the right visibility (for
various Rust crate types).

This fixes #10379 and resolves #10356 by removing the test case (and underlying support in the compiler). AFAICT, the better way to test visibility is via nm, like the symbol visibility test. It seems like that's sufficient; I suspect that given that we don't use this we should just drop it (android is tier 2 anyway). But happy to hear otherwise.

4 years agoRollup merge of #71421 - elichai:2020-04-boxed-slice, r=sfackler
Dylan DPC [Sun, 26 Apr 2020 19:02:32 +0000 (21:02 +0200)]
Rollup merge of #71421 - elichai:2020-04-boxed-slice, r=sfackler

Add a function to turn Box<T> into Box<[T]>

Hi,
I think this is very useful, as currently it's not possible in safe rust to do this without re-allocating.
an alternative implementation of the same function can be:
```rust
pub fn into_boxed_slice<T>(boxed: Box<T>) -> Box<[T]> {
    unsafe {
        let slice = slice::from_raw_parts_mut(Box::into_raw(boxed), 1);
        Box::from_raw(slice)
    }
}
```

The only thing that makes me a little uncomfortable is this line :
> The alignment of array types is greater or equal to the alignment of its element type

from https://rust-lang.github.io/unsafe-code-guidelines/layout/arrays-and-slices.html

But then I see:
> The alignment of &T, &mut T, *const T and *mut T are the same, and are at least the word size.
> The alignment of &[T] is the word size.

from https://rust-lang.github.io/unsafe-code-guidelines/layout/pointers.html#representation

So I do believe this is valid(FWIW it also passes in miri https://play.rust-lang.org/?gist=c002b99364ee6b29862aeb3565a91c19)

4 years agoPoint at the return type on `.into()` failure caused by `?`
Esteban Küber [Wed, 22 Apr 2020 00:20:12 +0000 (17:20 -0700)]
Point at the return type on `.into()` failure caused by `?`

Fix #35946.

4 years agoTweak some suggestions in `rustc_resolve`
Esteban Küber [Wed, 22 Apr 2020 18:58:21 +0000 (11:58 -0700)]
Tweak some suggestions in `rustc_resolve`

4 years agofmt
Ralf Jung [Sun, 26 Apr 2020 17:33:16 +0000 (19:33 +0200)]
fmt

4 years agoremove Unique::from for shared pointer types
Ralf Jung [Sun, 26 Apr 2020 17:00:57 +0000 (19:00 +0200)]
remove Unique::from for shared pointer types

4 years agoorganize Debug/Display impls a bit more; avoid sign-ignorant decimal display
Ralf Jung [Sun, 26 Apr 2020 16:59:20 +0000 (18:59 +0200)]
organize Debug/Display impls a bit more; avoid sign-ignorant decimal display

4 years agoAdjust style
Ralf Jung [Sun, 26 Apr 2020 16:44:38 +0000 (18:44 +0200)]
Adjust style

4 years agoprint pointers more compactly when they are too big
Ralf Jung [Sun, 26 Apr 2020 16:14:16 +0000 (18:14 +0200)]
print pointers more compactly when they are too big

4 years agoAuto merge of #71579 - Dylan-DPC:rollup-h9om2g3, r=Dylan-DPC
bors [Sun, 26 Apr 2020 15:48:58 +0000 (15:48 +0000)]
Auto merge of #71579 - Dylan-DPC:rollup-h9om2g3, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71490 (Cleanup and document `-C relocation-model`)
 - #71562 (fix more clippy warnings)
 - #71571 (Fix since attribute for nonzero_bitor impl's)
 - #71574 (proc_macro: Fix since attributes for new Span methods)
 - #71575 (Fix stable(since) attribute for BTreeMap::remove_entry)

Failed merges:

r? @ghost

4 years agoStabilize `Span::mixed_site`
Vadim Petrochenkov [Fri, 31 Jan 2020 21:18:14 +0000 (00:18 +0300)]
Stabilize `Span::mixed_site`

4 years agoRename ArgumentSizeMismatch to ScalarSizeMismatch
Samrat Man Singh [Sun, 26 Apr 2020 14:41:14 +0000 (20:11 +0530)]
Rename ArgumentSizeMismatch to ScalarSizeMismatch