]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAdd an option to use LLD to link the compiler on Windows platforms
John Kåre Alsaker [Tue, 28 Jan 2020 18:21:22 +0000 (19:21 +0100)]
Add an option to use LLD to link the compiler on Windows platforms

4 years agoAuto merge of #68635 - JohnTitor:rollup-jsc34ac, r=JohnTitor
bors [Wed, 29 Jan 2020 13:40:58 +0000 (13:40 +0000)]
Auto merge of #68635 - JohnTitor:rollup-jsc34ac, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #67722 (Minor: note how Any is an unsafe trait in SAFETY comments)
 - #68586 (Make conflicting_repr_hints a deny-by-default c-future-compat lint)
 - #68598 (Fix null synthetic_implementors error)
 - #68603 (Changelog: Demonstrate final build-override syntax)
 - #68609 (Set lld flavor for MSVC to link.exe)
 - #68611 (Correct ICE caused by macros generating invalid spans.)
 - #68627 (Document that write_all will not call write if given an empty buffer)

Failed merges:

r? @ghost

4 years agoRollup merge of #68627 - joshtriplett:write-all-none, r=Dylan-DPC
Yuki Okushi [Wed, 29 Jan 2020 09:56:34 +0000 (18:56 +0900)]
Rollup merge of #68627 - joshtriplett:write-all-none, r=Dylan-DPC

Document that write_all will not call write if given an empty buffer

Some types of Write instances have a semantic meaning associated with
writing an empty buffer, such as sending an empty packet. This works
when calling `write` directly, and supplying an empty buffer. However,
calling `write_all` on an empty buffer will simply never call `write`,
because `write_all` assumes it has no work to do.

Document this behavior, to help prospective users of
datagram-packet-style Write instances.

4 years agoRollup merge of #68611 - MichaelBurge:master, r=estebank
Yuki Okushi [Wed, 29 Jan 2020 09:56:32 +0000 (18:56 +0900)]
Rollup merge of #68611 - MichaelBurge:master, r=estebank

Correct ICE caused by macros generating invalid spans.

Closes #68605

4 years agoRollup merge of #68609 - Zoxc:lld-msvc, r=alexcrichton
Yuki Okushi [Wed, 29 Jan 2020 09:56:31 +0000 (18:56 +0900)]
Rollup merge of #68609 - Zoxc:lld-msvc, r=alexcrichton

Set lld flavor for MSVC to link.exe

This enables linking with LLD on Windows with just `-C linker=rust-lld` instead of needing `-C linker=rust-lld -C linker-flavor=lld-link`.

4 years agoRollup merge of #68603 - kornelski:patch-1, r=pietroalbini
Yuki Okushi [Wed, 29 Jan 2020 09:56:29 +0000 (18:56 +0900)]
Rollup merge of #68603 - kornelski:patch-1, r=pietroalbini

Changelog: Demonstrate final build-override syntax

4 years agoRollup merge of #68598 - GuillaumeGomez:fix-null-synthetic_implementors, r=ollie27
Yuki Okushi [Wed, 29 Jan 2020 09:56:28 +0000 (18:56 +0900)]
Rollup merge of #68598 - GuillaumeGomez:fix-null-synthetic_implementors, r=ollie27

Fix null synthetic_implementors error

Fixes #68584.

r? @ollie27

cc @kinnison

4 years agoRollup merge of #68586 - Centril:repr-deny, r=pnkfelix
Yuki Okushi [Wed, 29 Jan 2020 09:56:26 +0000 (18:56 +0900)]
Rollup merge of #68586 - Centril:repr-deny, r=pnkfelix

Make conflicting_repr_hints a deny-by-default c-future-compat lint

Closes https://github.com/rust-lang/rust/issues/68428.
cc https://github.com/rust-lang/rust/issues/68585.

r? @petrochenkov @pnkfelix

4 years agoRollup merge of #67722 - petertodd:2019-improve-any-comment, r=Mark-Simulacrum
Yuki Okushi [Wed, 29 Jan 2020 09:56:22 +0000 (18:56 +0900)]
Rollup merge of #67722 - petertodd:2019-improve-any-comment, r=Mark-Simulacrum

Minor: note how Any is an unsafe trait in SAFETY comments

Motivation: helpful to people like myself reading the standard library source to better understand how to use Any, especially if we do go ahead with https://github.com/rust-lang/rust/pull/67562 and make it an unsafe trait.

4 years agoAuto merge of #68572 - tmiasko:sanitizer-use-after-scope, r=nikic
bors [Wed, 29 Jan 2020 07:44:36 +0000 (07:44 +0000)]
Auto merge of #68572 - tmiasko:sanitizer-use-after-scope, r=nikic

Detect use-after-scope bugs with AddressSanitizer

Enable use-after-scope checks by default when using AddressSanitizer.
They allow to detect incorrect use of stack objects after their scope
have already ended. The detection is based on LLVM lifetime intrinsics.

To facilitate the use of this functionality, the lifetime intrinsics are
now emitted regardless of optimization level if enabled sanitizer makes
use of them.

4 years agoAuto merge of #68512 - spastorino:local-is-copy, r=oli-obk
bors [Wed, 29 Jan 2020 04:36:50 +0000 (04:36 +0000)]
Auto merge of #68512 - spastorino:local-is-copy, r=oli-obk

Local is copy

r? @oli-obk

4 years agoMinor: note why we can rely on Any trait for safety
Peter Todd [Wed, 29 Jan 2020 01:53:45 +0000 (20:53 -0500)]
Minor: note why we can rely on Any trait for safety

4 years agoAuto merge of #68625 - JohnTitor:rollup-20pfcru, r=JohnTitor
bors [Wed, 29 Jan 2020 01:28:55 +0000 (01:28 +0000)]
Auto merge of #68625 - JohnTitor:rollup-20pfcru, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #68289 (Don't ICE on path-collision in dep-graph)
 - #68378 (Add BTreeMap::remove_entry)
 - #68553 (Fix run button positionning in case of scrolling)
 - #68556 (rustdoc: Fix re-exporting primitive types)
 - #68582 (Add E0727 long explanation)
 - #68592 (fix: typo in vec.rs)
 - #68619 (Fix a few spelling mistakes)
 - #68620 (Update links to WASI docs in time.rs module)

Failed merges:

r? @ghost

4 years agoDocument that write_all will not call write if given an empty buffer
Josh Triplett [Wed, 29 Jan 2020 01:22:38 +0000 (17:22 -0800)]
Document that write_all will not call write if given an empty buffer

Some types of Write instances have a semantic meaning associated with
writing an empty buffer, such as sending an empty packet. This works
when calling `write` directly, and supplying an empty buffer. However,
calling `write_all` on an empty buffer will simply never call `write`,
because `write_all` assumes it has no work to do.

Document this behavior, to help prospective users of
datagram-packet-style Write instances.

4 years agoRollup merge of #68620 - kubkon:patch-1, r=Dylan-DPC
Yuki Okushi [Wed, 29 Jan 2020 00:34:54 +0000 (09:34 +0900)]
Rollup merge of #68620 - kubkon:patch-1, r=Dylan-DPC

Update links to WASI docs in time.rs module

Since the docs for the WASI API are now evolving in [WebAssembly/WASI] repo,
I thought it might be useful to update the links in the docs to point to that location
instead of using the outdated `CraneStation/wasmtime` destination.

[WebAssembly/WASI]: https://github.com/WebAssembly/WASI

r? @steveklabnik

cc @alexcrichton

4 years agoRollup merge of #68619 - gorilskij:master, r=varkor
Yuki Okushi [Wed, 29 Jan 2020 00:34:52 +0000 (09:34 +0900)]
Rollup merge of #68619 - gorilskij:master, r=varkor

Fix a few spelling mistakes

4 years agoRollup merge of #68592 - pdbrito:master, r=jonas-schievink
Yuki Okushi [Wed, 29 Jan 2020 00:34:51 +0000 (09:34 +0900)]
Rollup merge of #68592 - pdbrito:master, r=jonas-schievink

fix: typo in vec.rs

4 years agoRollup merge of #68582 - LeSeulArtichaut:code-explanations, r=Dylan-DPC
Yuki Okushi [Wed, 29 Jan 2020 00:34:49 +0000 (09:34 +0900)]
Rollup merge of #68582 - LeSeulArtichaut:code-explanations, r=Dylan-DPC

Add E0727 long explanation

Add long explanation for the `E0727` error code (async generators not yet supported).
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #68556 - ollie27:rustdoc_primitive_re-export, r=GuillaumeGomez
Yuki Okushi [Wed, 29 Jan 2020 00:34:48 +0000 (09:34 +0900)]
Rollup merge of #68556 - ollie27:rustdoc_primitive_re-export, r=GuillaumeGomez

rustdoc: Fix re-exporting primitive types

* Generate links to the primitive type docs for re-exports.
* Don't ICE on cross crate primitive type re-exports.
* Make primitive type re-exports show up cross crate.

Fixes #67646
Closes #67972

r? @GuillaumeGomez

4 years agoRollup merge of #68553 - GuillaumeGomez:fix-run-button-scroll-pos, r=kinnison
Yuki Okushi [Wed, 29 Jan 2020 00:34:47 +0000 (09:34 +0900)]
Rollup merge of #68553 - GuillaumeGomez:fix-run-button-scroll-pos, r=kinnison

Fix run button positionning in case of scrolling

Fixes #68337.

r? @kinnison

4 years agoRollup merge of #68378 - billyrieger:btreemap-remove-entry, r=KodrAus
Yuki Okushi [Wed, 29 Jan 2020 00:34:45 +0000 (09:34 +0900)]
Rollup merge of #68378 - billyrieger:btreemap-remove-entry, r=KodrAus

Add BTreeMap::remove_entry

Implements https://github.com/rust-lang/rust/issues/66714.

4 years agoRollup merge of #68289 - pnkfelix:issue-62649-dont-ice-on-path-collision-in-dep-graph...
Yuki Okushi [Wed, 29 Jan 2020 00:34:43 +0000 (09:34 +0900)]
Rollup merge of #68289 - pnkfelix:issue-62649-dont-ice-on-path-collision-in-dep-graph, r=michaelwoerister

Don't ICE on path-collision in dep-graph

Collisions in the dep-graph due to path-reuse are rare but can occur.

So, instead of ICE'ing, just fail to mark green in such cases (for `DepKind::{Hir, HirBody, CrateMetadata}`).

Fix #62649.

4 years agoUpdate links to WASI docs in time.rs module
Jakub Konka [Tue, 28 Jan 2020 22:34:00 +0000 (23:34 +0100)]
Update links to WASI docs in time.rs module

Since the docs for the WASI API are now evolving in [WebAssembly/WASI] repo,
I thought it might be useful to update the links in the docs to point to that location
instead of using the outdated `CraneStation/wasmtime` destination.

[WebAssembly/WASI]: https://github.com/WebAssembly/WASI

4 years agoFix null synthetic_implementors error
Guillaume Gomez [Tue, 28 Jan 2020 12:48:08 +0000 (13:48 +0100)]
Fix null synthetic_implementors error

4 years agoFix a few spelling mistakes
gorilskij [Tue, 28 Jan 2020 22:06:58 +0000 (23:06 +0100)]
Fix a few spelling mistakes

4 years agoAuto merge of #68606 - jonas-schievink:normalize-fastpath, r=Zoxc
bors [Tue, 28 Jan 2020 20:26:24 +0000 (20:26 +0000)]
Auto merge of #68606 - jonas-schievink:normalize-fastpath, r=Zoxc

Add an early-exit to `QueryNormalizer::fold_ty`

Pulled out from https://github.com/rust-lang/rust/pull/68524, this results in a ~60-70% reduction in compile time for the await-call-tree benchmarks. This should unblock https://github.com/rust-lang/rust/issues/67982 as well.

r? @Zoxc

4 years agoAdd E0727 long explanation
LeSeulArtichaut [Mon, 27 Jan 2020 20:22:05 +0000 (21:22 +0100)]
Add E0727 long explanation

4 years agoCorrect ICE caused by macros generating invalid spans.
Michael Burge [Tue, 28 Jan 2020 18:57:03 +0000 (10:57 -0800)]
Correct ICE caused by macros generating invalid spans.

4 years agoDemonstrate final build-override syntax
Kornel [Tue, 28 Jan 2020 15:53:21 +0000 (15:53 +0000)]
Demonstrate final build-override syntax

4 years agoSet lld flavor for MSVC to link.exe
John Kåre Alsaker [Tue, 28 Jan 2020 16:58:44 +0000 (17:58 +0100)]
Set lld flavor for MSVC to link.exe

4 years agoAdd an early-exit to `QueryNormalizer::fold_ty`
Jonas Schievink [Mon, 27 Jan 2020 23:52:21 +0000 (00:52 +0100)]
Add an early-exit to `QueryNormalizer::fold_ty`

4 years agoAuto merge of #68533 - tmiasko:compiletest, r=nikomatsakis
bors [Tue, 28 Jan 2020 16:25:35 +0000 (16:25 +0000)]
Auto merge of #68533 - tmiasko:compiletest, r=nikomatsakis

compiletest: Unit tests for `EarlyProps` (+ small cleanup)

* Parse `EarlyProps` from a reader
* Add unit tests for `EarlyProps`
* Remove unused `llvm-cxxflags` option
* Remove unnecessary memory allocations in `iter_header`
* Update mode list displayed in `--help`

4 years agoFix some wrong dereferences after rebase
Santiago Pastorino [Tue, 28 Jan 2020 15:17:02 +0000 (12:17 -0300)]
Fix some wrong dereferences after rebase

4 years agoRemove unneeded & on match pattern
Santiago Pastorino [Fri, 24 Jan 2020 16:27:01 +0000 (13:27 -0300)]
Remove unneeded & on match pattern

4 years ago./x.py fmt
Santiago Pastorino [Fri, 24 Jan 2020 15:50:13 +0000 (12:50 -0300)]
./x.py fmt

4 years agoPlace::ty_from takes local by value
Santiago Pastorino [Tue, 14 Jan 2020 05:21:42 +0000 (02:21 -0300)]
Place::ty_from takes local by value

4 years agoLocal field on PlaceRef and RootPlace is not a reference anymore
Santiago Pastorino [Tue, 14 Jan 2020 05:10:05 +0000 (02:10 -0300)]
Local field on PlaceRef and RootPlace is not a reference anymore

4 years agocodegen_place and related functions can take PlaceRef by value
Santiago Pastorino [Tue, 14 Jan 2020 04:51:59 +0000 (01:51 -0300)]
codegen_place and related functions can take PlaceRef by value

4 years agomake_integrate_local takes Local by value
Santiago Pastorino [Tue, 14 Jan 2020 04:26:11 +0000 (01:26 -0300)]
make_integrate_local takes Local by value

4 years agorecord_killed_borrows_for_local takes Local by value
Santiago Pastorino [Tue, 14 Jan 2020 04:23:51 +0000 (01:23 -0300)]
record_killed_borrows_for_local takes Local by value

4 years agoPlace conflict functions take Local by value
Santiago Pastorino [Tue, 14 Jan 2020 04:21:10 +0000 (01:21 -0300)]
Place conflict functions take Local by value

4 years agoAuto merge of #68529 - TimDiekmann:rename-alloc, r=Amanieu
bors [Tue, 28 Jan 2020 08:44:20 +0000 (08:44 +0000)]
Auto merge of #68529 - TimDiekmann:rename-alloc, r=Amanieu

Rename `Alloc` to `AllocRef`

The allocator-wg has decided to merge this change upstream in https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-577122958.

This renames `Alloc` to `AllocRef` because types that implement `Alloc` are a reference, smart pointer, or ZSTs. It is not possible to have an allocator like `MyAlloc([u8; N])`, that owns the memory and also implements `Alloc`, since that would mean, that moving a `Vec<T, MyAlloc>` would need to correct the internal pointer, which is not possible as we don't have move constructors.

For further explanation please see https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-489464843 and the comments after that one.

Additionally it clarifies the semantics of `Clone` on an allocator. In the case of `AllocRef`, it is clear that the cloned handle still points to the same allocator instance, and that you can free data allocated from one handle with another handle.

The initial proposal was to rename `Alloc` to `AllocHandle`, but `Ref` expresses the semantics better than `Handle`. Also, the only appearance of `Handle` in `std` are for windows specific resources, which might be confusing.

Blocked on https://github.com/rust-lang/miri/pull/1160

4 years agofix: typo in vec.rs
Pedro de Brito [Tue, 28 Jan 2020 06:59:07 +0000 (07:59 +0100)]
fix: typo in vec.rs

4 years agoAdd BTreeMap::remove_entry
Billy Rieger [Mon, 20 Jan 2020 02:44:46 +0000 (21:44 -0500)]
Add BTreeMap::remove_entry

Mainly for API parity with HashMap.

- Add BTreeMap::remove_entry
- Rewrite BTreeMap::remove to use remove_entry
- Use btreemap_remove_entry feature in doc comment

4 years agoAuto merge of #68234 - CAD97:slice-from-raw-parts, r=KodrAus
bors [Tue, 28 Jan 2020 05:31:34 +0000 (05:31 +0000)]
Auto merge of #68234 - CAD97:slice-from-raw-parts, r=KodrAus

Stabilize ptr::slice_from_raw_parts[_mut]

Closes #36925, the tracking issue.
Initial impl: #60667

r? @rust-lang/libs

In addition to stabilizing, I've adjusted the example of `ptr::slice_from_raw_parts` to use `slice_from_raw_parts` instead of `slice_from_raw_parts_mut`, which was unnecessary for the example as written.

4 years agoAuto merge of #68587 - JohnTitor:rollup-fz45xwc, r=JohnTitor
bors [Tue, 28 Jan 2020 02:17:10 +0000 (02:17 +0000)]
Auto merge of #68587 - JohnTitor:rollup-fz45xwc, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #68200 (Stabilize the debug_map_key_value feature)
 - #68383 (Clean up E0205 explanation)
 - #68412 (Clean up E0207 explanation)
 - #68454 (clean up E0214 explanation)
 - #68482 (clean up error codes explanation)
 - #68563 (Don't call `tcx.fn_sig` on closures)
 - #68570 (Bump LLVM submodule to fix LLVM assertion failure in MSP430 interrupt generation.)
 - #68571 (check_match: extract common logic)
 - #68573 (Clean up E0262 explanation)
 - #68575 (Disable the testcase for Vxworks.)
 - #68581 (Add support for icebreakers-cleanup-crew commands)

Failed merges:

r? @ghost

4 years agoRollup merge of #68581 - spastorino:support-ice-breaker-cleanup-crew, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:23 +0000 (10:48 +0900)]
Rollup merge of #68581 - spastorino:support-ice-breaker-cleanup-crew, r=Dylan-DPC

Add support for icebreakers-cleanup-crew commands

r? @nikomatsakis

4 years agoRollup merge of #68575 - Wind-River:master_2020, r=alexcrichton
Yuki Okushi [Tue, 28 Jan 2020 01:48:21 +0000 (10:48 +0900)]
Rollup merge of #68575 - Wind-River:master_2020, r=alexcrichton

Disable the testcase for Vxworks.

r? @alexcrichton

4 years agoRollup merge of #68573 - GuillaumeGomez:clean-up-e0262, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:20 +0000 (10:48 +0900)]
Rollup merge of #68573 - GuillaumeGomez:clean-up-e0262, r=Dylan-DPC

Clean up E0262 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68571 - Centril:check_in_cx, r=oli-obk
Yuki Okushi [Tue, 28 Jan 2020 01:48:19 +0000 (10:48 +0900)]
Rollup merge of #68571 - Centril:check_in_cx, r=oli-obk

check_match: extract common logic

This is part of work on `hir::ExprKind::Let` which I thought made sense on its own (though makes even more sense with `::Let`).

r? @oli-obk

4 years agoRollup merge of #68570 - cr1901:msp430-fix-1-2020, r=alexcrichton
Yuki Okushi [Tue, 28 Jan 2020 01:48:17 +0000 (10:48 +0900)]
Rollup merge of #68570 - cr1901:msp430-fix-1-2020, r=alexcrichton

Bump LLVM submodule to fix LLVM assertion failure in MSP430 interrupt generation.

This PR brings in changes introduced by [this cherry-pick](https://github.com/rust-lang/llvm-project/pull/37) to the Rust repository.

Nightlies downloaded from `rustup` do not appear to have llvm assertions enabled; the assertion failure [sometimes](https://github.com/YuhanLiin/msp430fr2355-quickstart/issues/3) causes link errors that shouldn't occur. I couldn't find any indication of other bugs; however, it should still be fixed.

4 years agoRollup merge of #68563 - Aaron1011:fix/fn-sig-closure, r=varkor
Yuki Okushi [Tue, 28 Jan 2020 01:48:16 +0000 (10:48 +0900)]
Rollup merge of #68563 - Aaron1011:fix/fn-sig-closure, r=varkor

Don't call `tcx.fn_sig` on closures

Fixes #68542

4 years agoRollup merge of #68482 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:14 +0000 (10:48 +0900)]
Rollup merge of #68482 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC

clean up error codes explanation

r? @Dylan-DPC

4 years agoRollup merge of #68454 - GuillaumeGomez:clean-up-e0214, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:12 +0000 (10:48 +0900)]
Rollup merge of #68454 - GuillaumeGomez:clean-up-e0214, r=Dylan-DPC

clean up E0214 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68412 - GuillaumeGomez:clean-up-e0207, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:10 +0000 (10:48 +0900)]
Rollup merge of #68412 - GuillaumeGomez:clean-up-e0207, r=Dylan-DPC

Clean up E0207 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68383 - GuillaumeGomez:clean-up-e0205, r=Dylan-DPC
Yuki Okushi [Tue, 28 Jan 2020 01:48:05 +0000 (10:48 +0900)]
Rollup merge of #68383 - GuillaumeGomez:clean-up-e0205, r=Dylan-DPC

Clean up E0205 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68200 - KodrAus:stabilize/debug_map_key_value, r=alexcrichton
Yuki Okushi [Tue, 28 Jan 2020 01:48:04 +0000 (10:48 +0900)]
Rollup merge of #68200 - KodrAus:stabilize/debug_map_key_value, r=alexcrichton

Stabilize the debug_map_key_value feature

RFC: https://github.com/rust-lang/rfcs/pull/2696
Tracking issue: #62482

Stabilizes the `debug_map_key_value` feature, which covers:

```rust
impl<'a, 'b> DebugMap<'a, 'b> {
    pub fn key(&mut self, key: &dyn fmt::Debug) -> &mut DebugMap<'a, 'b> {}
    pub fn value(&mut self, value: &dyn fmt::Debug) -> &mut DebugMap<'a, 'b> {}
}
```

These methods are small and self-contained, and are used as the basis for the existing `DebugMap::entry` method, so have been used in the wild for the last 6 months or so.

4 years agostabilize the debug_map_key_value feature
Ashley Mannix [Tue, 14 Jan 2020 04:43:05 +0000 (14:43 +1000)]
stabilize the debug_map_key_value feature

4 years agolintify conflicting_repr_hints
Mazdak Farrokhzad [Mon, 27 Jan 2020 23:27:57 +0000 (00:27 +0100)]
lintify conflicting_repr_hints

4 years agoAuto merge of #68580 - Mark-Simulacrum:rollup-r80xhus, r=Mark-Simulacrum
bors [Mon, 27 Jan 2020 22:59:38 +0000 (22:59 +0000)]
Auto merge of #68580 - Mark-Simulacrum:rollup-r80xhus, r=Mark-Simulacrum

Rollup of 3 pull requests

Successful merges:

 - #68459 (don't clone types that are copy, round two.)
 - #68576 (update miri)
 - #68579 (Update cargo)

Failed merges:

r? @ghost

4 years agoRename `Alloc` to `AllocRef`
Tim Diekmann [Thu, 23 Jan 2020 00:49:29 +0000 (01:49 +0100)]
Rename `Alloc` to `AllocRef`

4 years agoAdd support for icebreakers-cleanup-crew commands
Santiago Pastorino [Mon, 27 Jan 2020 18:58:27 +0000 (15:58 -0300)]
Add support for icebreakers-cleanup-crew commands

4 years agoRollup merge of #68579 - ehuss:update-cargo, r=Mark-Simulacrum
Mark Rousskov [Mon, 27 Jan 2020 18:42:03 +0000 (13:42 -0500)]
Rollup merge of #68579 - ehuss:update-cargo, r=Mark-Simulacrum

Update cargo

2 commits in b68b0978ab8012f871c80736fb910d14b89c4498..9d32b7b01409024b165545c568b1525d86e2b7cb
2020-01-24 18:26:23 +0000 to 2020-01-26 18:27:29 +0000
- Polish code to clarify meaning (rust-lang/cargo#7836)
- Store maximum queue length (rust-lang/cargo#7829)

4 years agoRollup merge of #68576 - jonhoo:bump-miri, r=oli-obk
Mark Rousskov [Mon, 27 Jan 2020 18:42:02 +0000 (13:42 -0500)]
Rollup merge of #68576 - jonhoo:bump-miri, r=oli-obk

update miri

Bump miri for rust-lang/miri#1150

r? @oli-obk

4 years agoRollup merge of #68459 - matthiaskrgr:clone_on_copy2, r=eddyb
Mark Rousskov [Mon, 27 Jan 2020 18:42:00 +0000 (13:42 -0500)]
Rollup merge of #68459 - matthiaskrgr:clone_on_copy2, r=eddyb

don't clone types that are copy, round two.

Apparently fixing some of these issues makes clippy find even more so I did a couple of rounds now.

r? @eddyb

4 years agoUpdate cargo
Eric Huss [Mon, 27 Jan 2020 18:30:44 +0000 (10:30 -0800)]
Update cargo

4 years agoBump miri for rust-lang/miri#1150
Jon Gjengset [Mon, 27 Jan 2020 17:47:51 +0000 (12:47 -0500)]
Bump miri for rust-lang/miri#1150

4 years agoDisable the testcase for Vxworks.
Umesh Kalappa [Mon, 6 Jan 2020 08:53:23 +0000 (00:53 -0800)]
Disable the testcase for Vxworks.

4 years agoClean up E0262 explanation
Guillaume Gomez [Mon, 27 Jan 2020 16:43:02 +0000 (17:43 +0100)]
Clean up E0262 explanation

4 years agoCollisions in the dep-graph due to path-reuse are rare but can occur.
Felix S. Klock II [Thu, 16 Jan 2020 19:33:18 +0000 (20:33 +0100)]
Collisions in the dep-graph due to path-reuse are rare but can occur.

So, instead of ICE'ing, just fail to mark green in such cases
(for `DepKind::{Hir, HirBody, CrateMetadata}`).

Fix #62649.

4 years agocheck_match: extract common logic
Mazdak Farrokhzad [Thu, 23 Jan 2020 02:30:56 +0000 (03:30 +0100)]
check_match: extract common logic

4 years agoFix LLVM assertion failure in MSP430 interrupt generation.
William D. Jones [Mon, 27 Jan 2020 14:05:31 +0000 (09:05 -0500)]
Fix LLVM assertion failure in MSP430 interrupt generation.

4 years agoUpdate src/librustc_error_codes/error_codes/E0220.md
Guillaume Gomez [Mon, 27 Jan 2020 15:06:38 +0000 (16:06 +0100)]
Update src/librustc_error_codes/error_codes/E0220.md

Co-Authored-By: Dylan DPC <dylan.dpc@gmail.com>
4 years agoAuto merge of #68566 - pietroalbini:rollup-22hbo3e, r=pietroalbini
bors [Mon, 27 Jan 2020 11:59:57 +0000 (11:59 +0000)]
Auto merge of #68566 - pietroalbini:rollup-22hbo3e, r=pietroalbini

Rollup of 4 pull requests

Successful merges:

 - #67928 (Update RELEASES.md for 1.41.0)
 - #68370 (Ensure that we error when calling "const extern fn" with wrong convention)
 - #68531 ([self-profiler] Two small cleanups)
 - #68562 (Fix spelling errors)

Failed merges:

r? @ghost

4 years agoRollup merge of #68562 - hjung4:spell, r=jonas-schievink
Pietro Albini [Mon, 27 Jan 2020 11:50:52 +0000 (12:50 +0100)]
Rollup merge of #68562 - hjung4:spell, r=jonas-schievink

Fix spelling errors

4 years agoRollup merge of #68531 - wesleywiser:cleanup_self_profiler, r=michaelwoerister
Pietro Albini [Mon, 27 Jan 2020 11:50:50 +0000 (12:50 +0100)]
Rollup merge of #68531 - wesleywiser:cleanup_self_profiler, r=michaelwoerister

[self-profiler] Two small cleanups

r? @michaelwoerister

4 years agoRollup merge of #68370 - Aaron1011:const-extern-test, r=RalfJung
Pietro Albini [Mon, 27 Jan 2020 11:50:49 +0000 (12:50 +0100)]
Rollup merge of #68370 - Aaron1011:const-extern-test, r=RalfJung

Ensure that we error when calling "const extern fn" with wrong convention

See #64926

4 years agoRollup merge of #67928 - XAMPPRocky:relnotes-1.41.0, r=pietroalbini
Pietro Albini [Mon, 27 Jan 2020 11:50:47 +0000 (12:50 +0100)]
Rollup merge of #67928 - XAMPPRocky:relnotes-1.41.0, r=pietroalbini

Update RELEASES.md for 1.41.0

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

cc @rust-lang/release

4 years agoAuto merge of #68165 - thomcc:lt_ones, r=sfackler
bors [Mon, 27 Jan 2020 08:42:56 +0000 (08:42 +0000)]
Auto merge of #68165 - thomcc:lt_ones, r=sfackler

Add leading_ones and trailing_ones methods to the primitive integer types

I was surprised these were missing (given that `leading_zeros` and `trailing_zeros` exist), and they seem trivial and hopefully not controversial.

Note that there's some precedent in that `count_ones` and `count_zeros` are both supported even though only one of these has an intrinsic.

I'm not sure if these need a `rustc_const_unstable` flag (the tests don't seem to mind that it's missing). I just made them const, since there's not really any reason for these to be non-const when the `_zeros` variants are const.

Note: My understanding is trivial stuff like (hopefully) this can land without an RFC, but I'm not fully sure about the process though. Questions like "when does the tracking issue get filed?", are a total mystery to me. So, any guidance is appreciated, and sorry in advance if I should have gone through some more involved process for this.

4 years agoDon't call `tcx.fn_sig` on closures
Aaron Hill [Mon, 27 Jan 2020 05:49:56 +0000 (00:49 -0500)]
Don't call `tcx.fn_sig` on closures

Fixes #68542

4 years agoupdate
comet [Mon, 27 Jan 2020 04:52:13 +0000 (22:52 -0600)]
update

4 years agoEnsure that we error when calling "const extern fn" with wrong convention
Aaron Hill [Sun, 19 Jan 2020 17:53:25 +0000 (12:53 -0500)]
Ensure that we error when calling "const extern fn" with wrong convention

See #64926

4 years agoAuto merge of #68447 - estebank:sugg-type-param, r=petrochenkov
bors [Mon, 27 Jan 2020 03:01:59 +0000 (03:01 +0000)]
Auto merge of #68447 - estebank:sugg-type-param, r=petrochenkov

Suggest defining type parameter when appropriate

```
error[E0412]: cannot find type `T` in this scope
 --> file.rs:3:12
  |
3 | impl Trait<T> for Struct {}
  |     -      ^ not found in this scope
  |     |
  |     help: you might be missing a type parameter: `<T>`
```

Fix #64298.

4 years agomake matches exhaustive
Matthias Krüger [Sun, 26 Jan 2020 13:17:22 +0000 (14:17 +0100)]
make matches exhaustive

4 years agodon't clone types that are copy, round two.
Matthias Krüger [Wed, 22 Jan 2020 15:30:15 +0000 (16:30 +0100)]
don't clone types that are copy, round two.

4 years agoAuto merge of #68122 - Centril:stabilize-transparent-enums, r=petrochenkov
bors [Mon, 27 Jan 2020 00:05:57 +0000 (00:05 +0000)]
Auto merge of #68122 - Centril:stabilize-transparent-enums, r=petrochenkov

Stabilize `#[repr(transparent)]` on `enum`s in Rust 1.42.0

# Stabilization report

The following is the stabilization report for `#![feature(transparent_enums)]`.

Tracking issue: https://github.com/rust-lang/rust/issues/60405
[Version target](https://forge.rust-lang.org/#current-release-versions): 1.42 (2020-01-30 => beta, 2020-03-12 => stable).

## User guide

A `struct` with only a single non-ZST field (let's call it `foo`) can be marked as `#[repr(transparent)]`. Such a `struct` has the same layout and ABI as `foo`. Here, we also extend this ability to `enum`s with only one variant, subject to the same restrictions as for the equivalent `struct`. That is, you can now write:

```rust
#[repr(transparent)]
enum Foo { Bar(u8) }
```

which, in terms of layout and ABI, is equivalent to:

```rust
#[repr(transparent)]
struct Foo(u8);
```

## Motivation

This is not a major feature that will unlock new and important use-cases. The utility of `repr(transparent)` `enum`s is indeed limited. However, there is still some value in it:

1. It provides conceptual simplification of the language in terms of treating univariant `enum`s and `struct`s the same, as both are product types. Indeed, languages like Haskell only have `data` as the only way to construct user-defined ADTs in the language.

2. In rare occasions, it might be that the user started out with a univariant `enum` for whatever reason (e.g. they thought they might extend it later). Now they want to make this `enum` `transparent` without breaking users by turning it into a `struct`. By lifting the restriction here, now they can.

## Technical specification

The reference specifies [`repr(transparent)` on a `struct`](https://doc.rust-lang.org/nightly/reference/type-layout.html#the-transparent-representation) as:

> ### The transparent Representation
>
>  The `transparent` representation can only be used on `struct`s that have:
>  - a single field with non-zero size, and
>  - any number of fields with size 0 and alignment 1 (e.g. `PhantomData<T>`).
>
> Structs with this representation have the same layout and ABI as the single non-zero sized field.
>
> This is different than the `C` representation because a struct with the `C` representation will always have the ABI of a `C` `struct` while, for example, a struct with the `transparent` representation with a primitive field will have the ABI of the primitive field.
>
> Because this representation delegates type layout to another type, it cannot be used with any other representation.

Here, we amend this to include univariant `enum`s as well with the same static restrictions and the same effects on dynamic semantics.

## Tests

All the relevant tests are adjusted in the PR diff but are recounted here:

- `src/test/ui/repr/repr-transparent.rs` checks that `repr(transparent)` on an `enum` must be univariant, rather than having zero or more than one variant. Restrictions on the fields inside the only variants, like for those on `struct`s, are also checked here.

- A number of codegen tests are provided as well:
    - `src/test/codegen/repr-transparent.rs` (the canonical test)
    - `src/test/codegen/repr-transparent-aggregates-1.rs`
    - `src/test/codegen/repr-transparent-aggregates-2.rs`
    - `src/test/codegen/repr-transparent-aggregates-3.rs`

- `src/test/ui/lint/lint-ctypes-enum.rs` tests the interactions with the `improper_ctypes` lint.

## History

- 2019-04-30, RFC https://github.com/rust-lang/rfcs/pull/2645
  Author: @mjbshaw
  Reviewers: The Language Team

  This is the RFC that proposes allowing `#[repr(transparent)]` on `enum`s and `union`.

- 2019-06-11, PR https://github.com/rust-lang/rust/pull/60463
  Author: @mjbshaw
  Reviewers: @varkor and @rkruppe

  The PR implements the RFC aforementioned in full.

- 2019, PR https://github.com/rust-lang/rust/pull/67323
  Author: @Centril
  Reviewers: @davidtwco

  The PR reorganizes the static checks taking advantage of the fact that `struct`s and `union`s are internally represented as ADTs with a single variant.

- This PR stabilizes `transparent_enums`.

## Related / possible future work

The remaining work here is to figure out the semantics of `#[repr(transparent)]` on `union`s and stabilize those. This work continues to be tracked in https://github.com/rust-lang/rust/issues/60405.

4 years agoMove sanitizer tests to a separate directory
Tomasz Miąsko [Mon, 27 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Move sanitizer tests to a separate directory

4 years agoAdd use after scope example to the unstable book
Tomasz Miąsko [Mon, 27 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Add use after scope example to the unstable book

4 years agoDetect use-after-scope bugs with AddressSanitizer
Tomasz Miąsko [Mon, 27 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Detect use-after-scope bugs with AddressSanitizer

Enable use-after-scope checks by default when using AddressSanitizer.
They allow to detect incorrect use of stack objects after their scope
have already ended. The detection is based on LLVM lifetime intrinsics.

To facilitate the use of this functionality, the lifetime intrinsics are
now emitted regardless of optimization level if enabled sanitizer makes
use of them.

4 years agocompiletest: Don't load TestProps from a directories
Tomasz Miąsko [Mon, 27 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Don't load TestProps from a directories

4 years agocompiletest: Derive Default for EarlyProps
Tomasz Miąsko [Mon, 27 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Derive Default for EarlyProps

4 years agocompiletest: Remove unused llvm-cxxflags option
Tomasz Miąsko [Fri, 24 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Remove unused llvm-cxxflags option

4 years agocompiletest: Add unit tests for EarlyProps
Tomasz Miąsko [Fri, 24 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Add unit tests for EarlyProps

4 years agocompiletest: Update mode list displayed in `--help`
Tomasz Miąsko [Fri, 24 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Update mode list displayed in `--help`

4 years agocompiletest: Parse EarlyProps from a reader
Tomasz Miąsko [Fri, 24 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Parse EarlyProps from a reader

4 years agocompiletest: Remove unnecessary memory allocation in iter_header
Tomasz Miąsko [Fri, 24 Jan 2020 00:00:00 +0000 (00:00 +0000)]
compiletest: Remove unnecessary memory allocation in iter_header

Replace `BufRead::lines` with `BuRead::read_line` to reduce memory allocations.

4 years agorustdoc: Fix re-exporting primitive types
Oliver Middleton [Sun, 26 Jan 2020 21:28:09 +0000 (21:28 +0000)]
rustdoc: Fix re-exporting primitive types

* Generate links to the primitive type docs for re-exports.
* Don't ICE on cross crate primitive type re-exports.
* Make primitive type re-exports show up cross crate.

4 years agoAuto merge of #68407 - eddyb:iter-macro-backtrace, r=petrochenkov
bors [Sun, 26 Jan 2020 21:01:13 +0000 (21:01 +0000)]
Auto merge of #68407 - eddyb:iter-macro-backtrace, r=petrochenkov

rustc_span: return an impl Iterator instead of a Vec from macro_backtrace.

Having `Span::macro_backtrace` produce an `impl Iterator<Item = ExpnData>` allows #67359 to use it instead of rolling its own similar functionality.

The move from `MacroBacktrace` to `ExpnData` (which the first two commits are prerequisites for) both eliminates unnecessary allocations, and is strictly more flexible (exposes more information).

r? @petrochenkov

4 years agoSuggest defining type parameter when appropriate
Esteban Küber [Wed, 22 Jan 2020 07:01:21 +0000 (23:01 -0800)]
Suggest defining type parameter when appropriate

```
error[E0412]: cannot find type `T` in this scope
 --> file.rs:3:12
  |
3 | impl Trait<T> for Struct {}
  |     -      ^ not found in this scope
  |     |
  |     help: you might be missing a type parameter: `<T>`
```

Fix #64298.

4 years agoFix run button positionning in case of scrolling
Guillaume Gomez [Sun, 26 Jan 2020 16:24:40 +0000 (17:24 +0100)]
Fix run button positionning in case of scrolling