]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkov
Dylan DPC [Tue, 28 Apr 2020 15:55:48 +0000 (17:55 +0200)]
Rollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkov

Minor formatting changes in `cfg-sanitize.md`

4 years agoRollup merge of #71615 - RalfJung:share-machine-code, r=oli-obk
Dylan DPC [Tue, 28 Apr 2020 15:55:46 +0000 (17:55 +0200)]
Rollup merge of #71615 - RalfJung:share-machine-code, r=oli-obk

share some common code for compile-time miri instances

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

r? @oli-obk

4 years agoRollup merge of #71456 - mzohreva:mz/sgx-no-dylib, r=nikomatsakis
Dylan DPC [Tue, 28 Apr 2020 15:55:44 +0000 (17:55 +0200)]
Rollup merge of #71456 - mzohreva:mz/sgx-no-dylib, r=nikomatsakis

Use lib crate type for SGX in `fn build_auxiliary`

since SGX does not support `dylib`

cc @Goirad

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 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 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 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 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 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 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 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 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 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 agoAdjust style
Ralf Jung [Sun, 26 Apr 2020 16:44:38 +0000 (18:44 +0200)]
Adjust style

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

4 years agoremove obsolete comment
Tshepang Lekhonkhobe [Sun, 26 Apr 2020 13:57:38 +0000 (15:57 +0200)]
remove obsolete comment

4 years agoAdd success and fail tests for into_boxed_slice
Elichai Turkel [Wed, 22 Apr 2020 14:23:20 +0000 (17:23 +0300)]
Add success and fail tests for into_boxed_slice

4 years agoAdd a function to turn Box<T> into Box<[T]> (into_boxed_slice)
Elichai Turkel [Wed, 22 Apr 2020 09:39:29 +0000 (12:39 +0300)]
Add a function to turn Box<T> into Box<[T]> (into_boxed_slice)

4 years agosubmodules: update clippy from 891e1a85 to b7c802b5
Matthias Krüger [Sun, 26 Apr 2020 12:33:18 +0000 (14:33 +0200)]
submodules: update clippy from 891e1a85 to b7c802b5

Changes:
````
rustup to https://github.com/rust-lang/rust/pull/70043
map_clone: avoid suggesting `copied()` for &mut
fix redundant_pattern_matching lint
Add tests for #1654
Don't trigger while_let_on_iterator when the iterator is recreated every iteration
Update issue_2356.stderr reference file
Update while_let_on_iterator tests
Fix while_let_on_iterator suggestion and make it MachineApplicable
Add lifetime test case for `new_ret_no_self`
rustup https://github.com/rust-lang/rust/pull/71215/
Downgrade match_bool to pedantic
Run fetch before testing if master contains beta
The beta branch update should not require a force push
Add a note to the beta sections of release.md
Remove apt-get upgrade again
Always use the deploy script and templates of the master branch
README: fix lit count line
clippy_dev: make it fatal when the regex for updating lint count does not match
`predecessors_for` will be removed soon
Rustup "Remove `BodyAndCache`"
Only run (late) internal lints, when they are warn/deny/forbid
Only run cargo lints, when they are warn/deny/forbid
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
Also mention `--fix` for nightly users
fix crash on issue-69020-assoc-const-arith-overflow.rs
Address review comments
remark fixes
Update CHANGELOG.md for Rust 1.43 and 1.44
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

4 years agoSuppress file length check temporarily
Steven Fackler [Sun, 26 Apr 2020 11:48:51 +0000 (04:48 -0700)]
Suppress file length check temporarily

Will clean up in a separate PR

4 years agoRollup merge of #71575 - jplatte:patch-4, r=Mark-Simulacrum
Dylan DPC [Sun, 26 Apr 2020 11:42:35 +0000 (13:42 +0200)]
Rollup merge of #71575 - jplatte:patch-4, r=Mark-Simulacrum

Fix stable(since) attribute for BTreeMap::remove_entry

Stabilized in #70712.

Maybe checking that the since attributes are added correctly should be automated through tidy? This is the third PR I'm opening that fixes a stable(since) attribute for something meant to be stabilized in 1.43 / 1.44 initially but then only stabilized in 1.45. (the other two are #71571, #71574)

4 years agoRollup merge of #71574 - jplatte:patch-2, r=petrochenkov
Dylan DPC [Sun, 26 Apr 2020 11:42:33 +0000 (13:42 +0200)]
Rollup merge of #71574 - jplatte:patch-2, r=petrochenkov

proc_macro: Fix since attributes for new Span methods

Added in #69041, took a while to merge so the since attributes went out of date.

4 years agoRollup merge of #71571 - jplatte:patch-1, r=jonas-schievink
Dylan DPC [Sun, 26 Apr 2020 11:42:32 +0000 (13:42 +0200)]
Rollup merge of #71571 - jplatte:patch-1, r=jonas-schievink

Fix since attribute for nonzero_bitor impl's

Added in #69813, took a while to merge so the since attributes went out of date.

4 years agoRollup merge of #71562 - matthiaskrgr:cl7ppy, r=Dylan-DPC
Dylan DPC [Sun, 26 Apr 2020 11:42:31 +0000 (13:42 +0200)]
Rollup merge of #71562 - matthiaskrgr:cl7ppy, r=Dylan-DPC

fix more clippy warnings

clippy::{redundant_pattern_matching, clone_on_copy, iter_cloned_collect, option_as_ref_deref, match_ref_pats}

r? @Dylan-DPC

4 years agoRollup merge of #71490 - petrochenkov:passcheck2, r=davidtwco
Dylan DPC [Sun, 26 Apr 2020 11:42:29 +0000 (13:42 +0200)]
Rollup merge of #71490 - petrochenkov:passcheck2, r=davidtwco

Cleanup and document `-C relocation-model`

As the title says, this is mostly a refactoring and documentation.

One potentially observable change here is that `-C relocation-model=default` now takes the default from the Rust target, rather than from the underlying LLVM target. In other words, `-C relocation-model=default` is now equivalent to not specifying the relocation model on command line at all.
Apparently no one used that option because it has other bugs as well, e.g. PIC `default` wasn't treated as PIC in some places.

4 years agolinkchecker: fix typo in main.rs
Ujjwal Sharma [Sun, 26 Apr 2020 11:39:15 +0000 (17:09 +0530)]
linkchecker: fix typo in main.rs

4 years agoFix stragglers
Steven Fackler [Thu, 12 Mar 2020 01:32:18 +0000 (18:32 -0700)]
Fix stragglers

4 years agoUpdate name
Steven Fackler [Thu, 12 Mar 2020 01:02:52 +0000 (18:02 -0700)]
Update name

4 years agoAdd Read/Write::can_read/write_vectored
Steven Fackler [Fri, 3 Jan 2020 19:26:05 +0000 (11:26 -0800)]
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 agocheck that `AsRef` and `AsMut` are inlined
Bastian Kauschke [Sun, 26 Apr 2020 10:43:00 +0000 (12:43 +0200)]
check that `AsRef` and `AsMut` are inlined

4 years agoFix stable(since) attribute for BTreeMap::remove_entry
Jonas Platte [Sun, 26 Apr 2020 10:31:05 +0000 (12:31 +0200)]
Fix stable(since) attribute for BTreeMap::remove_entry

4 years agoproc_macro: Fix since attributes for new Span methods
Jonas Platte [Sun, 26 Apr 2020 10:08:42 +0000 (12:08 +0200)]
proc_macro: Fix since attributes for new Span methods

4 years agoFix since attribute for nonzero_bitor impl's
Jonas Platte [Sun, 26 Apr 2020 09:28:44 +0000 (11:28 +0200)]
Fix since attribute for nonzero_bitor impl's

4 years agotests: Remove unnecessary `-C relocation-model=dynamic-no-pic`s
Vadim Petrochenkov [Thu, 23 Apr 2020 21:56:19 +0000 (00:56 +0300)]
tests: Remove unnecessary `-C relocation-model=dynamic-no-pic`s

The referenced `sanitizer-address/Makefile` no longer exists, so perhaps these options are no longer necessary as well.
Even if they are still necessary, they should use `-C relocation-model=static` instead.

4 years agorustc-book: Document `-C relocation-model`
Vadim Petrochenkov [Thu, 23 Apr 2020 21:53:25 +0000 (00:53 +0300)]
rustc-book: Document `-C relocation-model`

4 years agocodegen_llvm: Simplify logic for relaxing PIC into PIE
Vadim Petrochenkov [Thu, 23 Apr 2020 18:10:01 +0000 (21:10 +0300)]
codegen_llvm: Simplify logic for relaxing PIC into PIE

4 years agocodegen_llvm: `RelocMode` -> `RelocModel`
Vadim Petrochenkov [Thu, 23 Apr 2020 17:49:00 +0000 (20:49 +0300)]
codegen_llvm: `RelocMode` -> `RelocModel`

4 years agorustc_target: Stop using "string typing" for relocation models
Vadim Petrochenkov [Wed, 22 Apr 2020 21:46:45 +0000 (00:46 +0300)]
rustc_target: Stop using "string typing" for relocation models

Introduce `enum RelocModel` instead.