Commit Graph

109519 Commits

Author SHA1 Message Date
bors
58dd1ce838 Auto merge of #70638 - Dylan-DPC:rollup-2tgfxjt, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #68770 (BTreeMap/BTreeSet: implement drain_filter )
 - #70081 (add `unused_braces` lint)
 - #70556 (parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.)
 - #70605 (Add missing -lmsvcrt on mingw after -lpthread)
 - #70630 (Update books.)
 - #70632 (expand vec![] to Vec::new())

Failed merges:

r? @ghost
2020-03-31 22:28:18 +00:00
Dylan DPC
8310320ebd
Rollup merge of #70632 - tspiteri:vec-new, r=sfackler
expand vec![] to Vec::new()

The current expansion of `vec![]` calls `into_vec` on a boxed slice, which results in longer IR, and even after optimization, some unwinding artifacts are still present in the IR. This PR uses `Vec::new()` for `vec![]`.

This also allows `vec![]` to be used in const expressions.
2020-04-01 00:27:26 +02:00
Dylan DPC
0979a2871c
Rollup merge of #70630 - ehuss:update-books, r=ehuss
Update books.

## reference

2 commits in e2f11fe4d6a5ecb471c70323197da43c70cb96b6..89dd146154474559536d5d4049a03831c501deea
2020-03-10 06:59:24 +0100 to 2020-03-31 09:42:10 -0700
- Clarify rule for end-of-line backslashes in strings (rust-lang-nursery/reference#784)
- Fix and clarify section on re-export (rust-lang-nursery/reference#780)

## book

1 commits in 6fb3705e5230311b096d47f7e2c91f9ce24393d0..c8841f2841a2d26124319ddadd1b6a245f9a1856
2020-02-12 13:48:57 -0500 to 2020-03-22 09:07:01 -0500
- Fix broken front_of_house.rs test on nightly. (rust-lang/book#2289)

## rust-by-example

7 commits in cb369ae95ca36b841960182d26f6d5d9b2e3cc18..edd2a7e687358712608896730c083cb76c7b401a
2020-03-14 12:13:22 -0500 to 2020-03-30 09:37:29 -0300
- feat: add doc attributes section to documentation (rust-lang/rust-by-example#1323)
- feat: add playpen topic (rust-lang/rust-by-example#1324)
- feat: add sentence about rustdoc & std library (rust-lang/rust-by-example#1322)
- fix: make spelling/style of rustdoc consistent (rust-lang/rust-by-example#1321)
- Rewrite section on 'static lifetime. (rust-lang/rust-by-example#1320)
- Remove deprecated `std::error::Error` functions and other minor changes (rust-lang/rust-by-example#1319)
- Remove mdbook version flags from README (rust-lang/rust-by-example#1318)

## nomicon

1 commits in 9f797e65e6bcc79419975b17aff8e21c9adc039f..411197b0e77590c967e37e8f6ec681abd359afe8
2020-03-04 03:45:13 +0100 to 2020-03-31 20:46:09 +0200
- Fix negative_impls feature. (rust-lang-nursery/nomicon#205)
2020-04-01 00:27:25 +02:00
Dylan DPC
ddcc281e89
Rollup merge of #70605 - Amanieu:pthread_msvcrt, r=varkor
Add missing -lmsvcrt on mingw after -lpthread

Fixes #70316
2020-04-01 00:27:23 +02:00
Dylan DPC
81f19ec909
Rollup merge of #70556 - Centril:fix-70552, r=estebank
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.

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

r? @estebank
cc @daboross
2020-04-01 00:27:22 +02:00
Dylan DPC
8993358e77
Rollup merge of #70081 - lcnr:issue68387, r=varkor
add `unused_braces` lint

Add the lint `unused_braces` which is warn by default.

`unused_parens` is also extended and now checks anon consts.

closes #68387

r? @varkor
2020-04-01 00:27:20 +02:00
Dylan DPC
718ba0d23b
Rollup merge of #68770 - ssomers:btree_drain_filter, r=Amanieu
BTreeMap/BTreeSet: implement drain_filter

Provide an implementation of drain_filter for BTreeMap and BTreeSet. Should be optimal when the predicate picks only elements in leaf nodes with at least MIN_LEN remaining elements, which is a common case, at least when draining only a fraction of the map/set, and also when the predicate picks elements stored in internal nodes where the right subtree can easily let go of a replacement element.

The first commit adds benchmarks with an external, naive implementation. to compare how much this claimed optimality-in-some-cases is actually worth.
2020-04-01 00:27:18 +02:00
Santiago Pastorino
b46754ea99
Use Place directly in apply_call_return_effect on framework/tests, it's Copy 2020-03-31 18:49:24 -03:00
Santiago Pastorino
017608f5d2
Use Place directly in codegen_place_to_pointer, it's Copy 2020-03-31 17:37:55 -03:00
Santiago Pastorino
a865e779b0
Use Place directly in evaluate_array_len, it's Copy 2020-03-31 17:37:55 -03:00
Santiago Pastorino
1f5338cfd6
Use Place directly in codegen_transmute, it's Copy 2020-03-31 17:37:54 -03:00
Santiago Pastorino
5f8a6edbbb
Use Place directly on make_return_dest, it's Copy 2020-03-31 17:37:53 -03:00
Santiago Pastorino
afcd7fc51d
Use Place directly on codegen_drop_terminator, it's Copy 2020-03-31 17:37:52 -03:00
Santiago Pastorino
017620fdfc
Use Place directly in peek_at, it's Copy 2020-03-31 17:37:51 -03:00
Santiago Pastorino
947c1dcf92
Use Place directly on place_contents_drop_state_cannot_differ, it's Copy 2020-03-31 17:37:50 -03:00
Santiago Pastorino
5987b0f8be
Use Place directly in place_as_reborrow, it's Copy 2020-03-31 17:37:48 -03:00
Santiago Pastorino
f37d2b8a63
Use Place directly in librustc_mir_build, it's Copy 2020-03-31 17:37:24 -03:00
Trevor Spiteri
4d8273dea5 expand vec![] to Vec::new() 2020-03-31 21:37:13 +02:00
Eric Huss
388f61b7f7 Update cargo 2020-03-31 12:15:13 -07:00
bors
a5b09d3547 Auto merge of #70625 - Dylan-DPC:rollup-o8n2hw8, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #69425 (add fn make_contiguous to VecDeque)
 - #69458 (improve folder name for persistent doc tests)
 - #70268 (Document ThreadSanitizer in unstable-book)
 - #70600 (Ensure there are versions of test code for aarch64 windows)
 - #70606 (Clean up E0466 explanation)
 - #70614 (remove unnecessary relocation check in const_prop)
 - #70623 (Fix broken link in README)

Failed merges:

r? @ghost
2020-03-31 19:12:14 +00:00
Eric Huss
722d3d8ef0 Update books. 2020-03-31 11:53:48 -07:00
Pietro Albini
824dcd424f
ci: disable cancel-outdated-builds for the try branch
While for auto, try and PR builds we only want the latest commit to be
tested, that's not true for try builds: each commit pushed to the branch
is a different PR being tested, and we want multiple PRs to be tested in
parallel if there is enough demand.

Fixes #70569
2020-03-31 19:49:36 +02:00
Santiago Pastorino
6a95bf884f
Use Place directly on Operand::place and friends, it's Copy 2020-03-31 14:45:07 -03:00
Santiago Pastorino
890b39381f
Use Place directly, it's Copy even more use cases 2020-03-31 14:45:05 -03:00
Santiago Pastorino
25528c1e28
Use Place directly, it's Copy more use cases 2020-03-31 14:44:01 -03:00
Santiago Pastorino
760bca4f5b
Use Place directly on check_mut_borrowing_layout_constrained_field, it's Copy 2020-03-31 14:44:00 -03:00
Santiago Pastorino
32a761809b
Use Place directly on remove_never_initialized_mut_locals, it's Copy 2020-03-31 14:43:58 -03:00
Santiago Pastorino
a67b28a96e
Use Place directly on borrow_of_local_data, it's Copy 2020-03-31 14:42:21 -03:00
Santiago Pastorino
f026441e32
Use Place directly on propagate_closure_used_mut_place, it's Copy 2020-03-31 14:42:21 -03:00
Santiago Pastorino
d45dca390c
Use Place directly, it's Copy 2020-03-31 14:42:20 -03:00
Dylan DPC
011c0906cd
Rollup merge of #70623 - rcoh:patch-2, r=jonas-schievink
Fix broken link in README

Crate name for rustc entry point docs changed. Fixes #70603
2020-03-31 19:29:36 +02:00
Dylan DPC
59809bc4c1
Rollup merge of #70614 - RalfJung:cons-prop-reloc, r=wesleywiser
remove unnecessary relocation check in const_prop

Unnecessary as per https://github.com/rust-lang/rust/issues/70356#issuecomment-606615292

Fixes https://github.com/rust-lang/rust/issues/70356
r? @oli-obk Cc @wesleywiser
2020-03-31 19:29:35 +02:00
Dylan DPC
6248b59316
Rollup merge of #70606 - GuillaumeGomez:cleanup-e0466, r=Dylan-DPC
Clean up E0466 explanation

r? @Dylan-DPC
2020-03-31 19:29:33 +02:00
Dylan DPC
b9546075ac
Rollup merge of #70600 - danielframpton:aarch64-windows-tests, r=alexcrichton
Ensure there are versions of test code for aarch64 windows

Remove the `cfg` flags that were preventing some tests from running on `aarch64-pc-windows-msvc`.

All the existing `target_os = windows` targets had the same `align()` and `size()` values, so this change just removes the `target_arch` flags.

r? @alexcrichton
2020-03-31 19:29:31 +02:00
Dylan DPC
0203ad2195
Rollup merge of #70268 - tmiasko:sanitizer-docs, r=steveklabnik
Document ThreadSanitizer in unstable-book
2020-03-31 19:29:29 +02:00
Dylan DPC
3e31006f3c
Rollup merge of #69458 - Luro02:master, r=GuillaumeGomez,ollie27
improve folder name for persistent doc tests

This fixes #69411, by using the entire path as folder name and storing already visited paths in a HashMap + appending a number to the file name for duplicates.
2020-03-31 19:29:28 +02:00
Dylan DPC
f62cfa76c5
Rollup merge of #69425 - lcnr:make_contiguous, r=Amanieu
add fn make_contiguous to VecDeque

Adds the following method to VecDeque:

```rust
pub fn make_contiguous(&mut self) -> &mut [T];
```

Taken from https://github.com/rust-lang/rust/pull/69400, after a suggestion by @CryZe https://github.com/rust-lang/rust/pull/69400#issuecomment-590216089

I am in favor of merging this instead of https://github.com/rust-lang/rust/pull/69400.
2020-03-31 19:29:26 +02:00
Pietro Albini
0110634c83
cargotest: remove webrender
The current webrender commit occasionally fails without a reason, and
the latest webrender commit is missing a dependency on our Windows
builders. It's not worth installing an extra dependency for cargotest,
and the spurious failure makes keeping this test not worth it.
2020-03-31 19:28:06 +02:00
Bastian Kauschke
bab327c725 update unused_braces wording 2020-03-31 19:01:49 +02:00
Bastian Kauschke
bcf35b1d80 add tests for unused_braces 2020-03-31 19:01:49 +02:00
Bastian Kauschke
698b20eeda update tests 2020-03-31 19:01:49 +02:00
Bastian Kauschke
21c5ccab10 fix internal lint fallout 2020-03-31 19:01:48 +02:00
Russell Cohen
7eb3e9a8a8
Fix broken link in README
Crate name for rustc entry point docs changed. Fixes #70603
2020-03-31 12:57:31 -04:00
Ralf Jung
96deb950ac const backtrace: do not skip first frame 2020-03-31 17:58:14 +02:00
Ralf Jung
ad74480cb2 avoid an unreachable fallback 2020-03-31 17:58:14 +02:00
Bastian Kauschke
e1afd26c52 fix docs 2020-03-31 16:50:06 +02:00
Russell Cohen
55a5eea763 Fix tests to handle debug_assert 2020-03-31 10:27:07 -04:00
bors
75ff3110ac Auto merge of #70617 - Centril:rollup-063ycso, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #69784 (Optimize strip_prefix and strip_suffix with str patterns)
 - #70548 (Add long error code for error E0226)
 - #70555 (resolve, `try_resolve_as_non_binding`: use `delay_span_bug` due to parser recovery)
 - #70561 (remove obsolete comment)
 - #70562 (infer array len from pattern)
 - #70585 (std: Fix over-aligned allocations on wasm32-wasi)
 - #70587 (Add `Rust` to the code snippet)
 - #70588 (Fix incorrect documentation for `str::{split_at, split_at_mut}`)
 - #70613 (more clippy fixes)

Failed merges:

r? @ghost
2020-03-31 14:00:55 +00:00
Mazdak Farrokhzad
976f8d59dd
Rollup merge of #70613 - matthiaskrgr:cl5ppy_squashed, r=Centril
more clippy fixes

* use is_empty() instead of len comparison (clippy::len_zero)
* use if let instead of while let loop that never loops (clippy::never_loop)
* remove redundant returns (clippy::needless_return)
* remove redundant closures (clippy::redundant_closure)
* use if let instead of match and wildcard pattern (clippy::single_match)
* don't repeat field names redundantly (clippy::redundant_field_names)

r? @Centril
2020-03-31 15:59:52 +02:00
Mazdak Farrokhzad
4aeeb81db5
Rollup merge of #70588 - Coder-256:str-split-at-docs, r=Dylan-DPC
Fix incorrect documentation for `str::{split_at, split_at_mut}`

The documentation for each method currently states:

> Panics if `mid` is not on a UTF-8 code point boundary, or if it is beyond the last code point of the string slice.

However, this is not consistent with the real behavior, or that of the corresponding methods for `[T]` slices. A comment inside each of the `str` methods states:

> is_char_boundary checks that the index is in [0, .len()]

That is what I would expect the behavior to be, and in fact this seems to be the real behavior. For example ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8e03dcc209d4dd176df2297523f9fee1)):

```rust
fn main() {
    // Prints ("abc", "") and doesn't panic
    println!("{:?}", "abc".split_at(3));
}
```

In this case, I would interpret "the last code point of the string slice" to mean the byte at index 2 in UTF-8. However, it is possible to pass an index of 3, which is definitely "beyond the last code point of the string slice".

I think that this is much clearer, but feel free to bikeshed.
2020-03-31 15:59:50 +02:00