]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #70414 - lopsided98:armv6-gcc-8, r=pietroalbini
bors [Wed, 1 Apr 2020 03:56:44 +0000 (03:56 +0000)]
Auto merge of #70414 - lopsided98:armv6-gcc-8, r=pietroalbini

Upgrade GCC to 8.3.0, glibc to 2.17.0 and crosstool-ng to 1.24.0 for dist-arm-linux and dist-armhf-linux

Attempt to fix #69420 in the same manner as #65302 did for armv7l. I have tested that this eliminates the segfault while building a `hello_world` package on `arm-unknown-linux-gnueabihf`.

I have not been able to test whether the bug exists for `arm-unknown-linux-gnueabi` as well, but I suspect it does, so I upgraded the toolchain for that platform as well.

4 years agoAuto merge of #70638 - Dylan-DPC:rollup-2tgfxjt, r=Dylan-DPC
bors [Tue, 31 Mar 2020 22:28:18 +0000 (22:28 +0000)]
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

4 years agoRollup merge of #70632 - tspiteri:vec-new, r=sfackler
Dylan DPC [Tue, 31 Mar 2020 22:27:26 +0000 (00:27 +0200)]
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.

4 years agoRollup merge of #70630 - ehuss:update-books, r=ehuss
Dylan DPC [Tue, 31 Mar 2020 22:27:25 +0000 (00:27 +0200)]
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)

4 years agoRollup merge of #70605 - Amanieu:pthread_msvcrt, r=varkor
Dylan DPC [Tue, 31 Mar 2020 22:27:23 +0000 (00:27 +0200)]
Rollup merge of #70605 - Amanieu:pthread_msvcrt, r=varkor

Add missing -lmsvcrt on mingw after -lpthread

Fixes #70316

4 years agoRollup merge of #70556 - Centril:fix-70552, r=estebank
Dylan DPC [Tue, 31 Mar 2020 22:27:22 +0000 (00:27 +0200)]
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

4 years agoRollup merge of #70081 - lcnr:issue68387, r=varkor
Dylan DPC [Tue, 31 Mar 2020 22:27:20 +0000 (00:27 +0200)]
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

4 years agoRollup merge of #68770 - ssomers:btree_drain_filter, r=Amanieu
Dylan DPC [Tue, 31 Mar 2020 22:27:18 +0000 (00:27 +0200)]
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.

4 years agoexpand vec![] to Vec::new()
Trevor Spiteri [Tue, 31 Mar 2020 19:37:13 +0000 (21:37 +0200)]
expand vec![] to Vec::new()

4 years agoAuto merge of #70625 - Dylan-DPC:rollup-o8n2hw8, r=Dylan-DPC
bors [Tue, 31 Mar 2020 19:12:14 +0000 (19:12 +0000)]
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

4 years agoUpdate books.
Eric Huss [Tue, 31 Mar 2020 18:41:31 +0000 (11:41 -0700)]
Update books.

4 years agoRollup merge of #70623 - rcoh:patch-2, r=jonas-schievink
Dylan DPC [Tue, 31 Mar 2020 17:29:36 +0000 (19:29 +0200)]
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

4 years agoRollup merge of #70614 - RalfJung:cons-prop-reloc, r=wesleywiser
Dylan DPC [Tue, 31 Mar 2020 17:29:35 +0000 (19:29 +0200)]
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

4 years agoRollup merge of #70606 - GuillaumeGomez:cleanup-e0466, r=Dylan-DPC
Dylan DPC [Tue, 31 Mar 2020 17:29:33 +0000 (19:29 +0200)]
Rollup merge of #70606 - GuillaumeGomez:cleanup-e0466, r=Dylan-DPC

Clean up E0466 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70600 - danielframpton:aarch64-windows-tests, r=alexcrichton
Dylan DPC [Tue, 31 Mar 2020 17:29:31 +0000 (19:29 +0200)]
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

4 years agoRollup merge of #70268 - tmiasko:sanitizer-docs, r=steveklabnik
Dylan DPC [Tue, 31 Mar 2020 17:29:29 +0000 (19:29 +0200)]
Rollup merge of #70268 - tmiasko:sanitizer-docs, r=steveklabnik

Document ThreadSanitizer in unstable-book

4 years agoRollup merge of #69458 - Luro02:master, r=GuillaumeGomez,ollie27
Dylan DPC [Tue, 31 Mar 2020 17:29:28 +0000 (19:29 +0200)]
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.

4 years agoRollup merge of #69425 - lcnr:make_contiguous, r=Amanieu
Dylan DPC [Tue, 31 Mar 2020 17:29:26 +0000 (19:29 +0200)]
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.

4 years agoupdate unused_braces wording
Bastian Kauschke [Tue, 31 Mar 2020 16:42:54 +0000 (18:42 +0200)]
update unused_braces wording

4 years agoadd tests for `unused_braces`
Bastian Kauschke [Fri, 27 Mar 2020 20:56:58 +0000 (21:56 +0100)]
add tests for `unused_braces`

4 years agoupdate tests
Bastian Kauschke [Fri, 27 Mar 2020 20:56:19 +0000 (21:56 +0100)]
update tests

4 years agofix internal lint fallout
Bastian Kauschke [Fri, 27 Mar 2020 20:55:15 +0000 (21:55 +0100)]
fix internal lint fallout

4 years agoFix broken link in README
Russell Cohen [Tue, 31 Mar 2020 16:57:31 +0000 (12:57 -0400)]
Fix broken link in README

Crate name for rustc entry point docs changed. Fixes #70603

4 years agofix docs
Bastian Kauschke [Tue, 31 Mar 2020 14:50:06 +0000 (16:50 +0200)]
fix docs

4 years agoAuto merge of #70617 - Centril:rollup-063ycso, r=Centril
bors [Tue, 31 Mar 2020 14:00:55 +0000 (14:00 +0000)]
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

4 years agoRollup merge of #70613 - matthiaskrgr:cl5ppy_squashed, r=Centril
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:52 +0000 (15:59 +0200)]
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

4 years agoRollup merge of #70588 - Coder-256:str-split-at-docs, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:50 +0000 (15:59 +0200)]
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.

4 years agoRollup merge of #70587 - DutchGhost:patch-1, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:49 +0000 (15:59 +0200)]
Rollup merge of #70587 - DutchGhost:patch-1, r=Dylan-DPC

Add `Rust` to the code snippet

Adds `Rust` to the snippet where the code causing the ICE should be placed, so github can render it as Rust code rather than plain code.

4 years agoRollup merge of #70585 - alexcrichton:fix-wasi-align-alloc, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:47 +0000 (15:59 +0200)]
Rollup merge of #70585 - alexcrichton:fix-wasi-align-alloc, r=Mark-Simulacrum

std: Fix over-aligned allocations on wasm32-wasi

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.

4 years agoRollup merge of #70562 - lcnr:const-arr_len, r=Centril
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:46 +0000 (15:59 +0200)]
Rollup merge of #70562 - lcnr:const-arr_len, r=Centril

infer array len from pattern

closes #70529

This still errors in the following case

```rust
#![feature(const_generics)]
fn arr<const N: usize>() -> [u8; N] {
    todo!()
}

fn main() {
    match arr() {
        [5, ..] => (),
        //~^ ERROR cannot pattern-match on an array without a fixed length
        [_, _] => (),
    }
}
```
Considering that this should be rare and is harder to implement I would merge this PR without *fixing* the above.

4 years agoRollup merge of #70561 - tshepang:obsolete-comment, r=petrochenkov
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:44 +0000 (15:59 +0200)]
Rollup merge of #70561 - tshepang:obsolete-comment, r=petrochenkov

remove obsolete comment

Made obsolete by b5e35b128efeed4bfdb4b1ee9d0697389ec9f164

4 years agoRollup merge of #70555 - Centril:fix-70549, r=petrochenkov
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:43 +0000 (15:59 +0200)]
Rollup merge of #70555 - Centril:fix-70549, r=petrochenkov

resolve, `try_resolve_as_non_binding`: use `delay_span_bug` due to parser recovery

Fixes #70549

r? @petrochenkov

4 years agoRollup merge of #70548 - Ersikan:master, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:41 +0000 (15:59 +0200)]
Rollup merge of #70548 - Ersikan:master, r=GuillaumeGomez

Add long error code for error E0226

Added a long description message for error E0226, which previously did not exist.
As requested in issue #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69784 - benesch:fast-strip-prefix-suffix, r=kennytm
Mazdak Farrokhzad [Tue, 31 Mar 2020 13:59:40 +0000 (15:59 +0200)]
Rollup merge of #69784 - benesch:fast-strip-prefix-suffix, r=kennytm

Optimize strip_prefix and strip_suffix with str patterns

As mentioned in https://github.com/rust-lang/rust/issues/67302#issuecomment-585639226.
I'm not sure whether adding these methods to `Pattern` is desirable—but they have default implementations so the change is backwards compatible. Plus it seems like they're slated for wholesale replacement soon anyway? #56345

----

Constructing a Searcher in strip_prefix and strip_suffix is
unnecessarily slow when the pattern is a fixed-length string. Add
strip_prefix and strip_suffix methods to the Pattern trait, and add
optimized implementations of these methods in the str implementation.
The old implementation is retained as the default for these methods.

4 years agoupdate `VecDeque::as_(mut)_slice` docs
Bastian Kauschke [Tue, 31 Mar 2020 13:39:56 +0000 (15:39 +0200)]
update `VecDeque::as_(mut)_slice` docs

4 years agoremove unnecessary relocation check in const_prop
Ralf Jung [Tue, 31 Mar 2020 13:25:12 +0000 (15:25 +0200)]
remove unnecessary relocation check in const_prop

4 years agomore clippy fixes
Matthias Krüger [Sun, 29 Mar 2020 18:19:14 +0000 (20:19 +0200)]
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)

4 years agoClean up E0466 explanation
Guillaume Gomez [Tue, 31 Mar 2020 11:55:58 +0000 (13:55 +0200)]
Clean up E0466 explanation

4 years agoimprove folder name for persistent doc tests
Luro02 [Sun, 1 Mar 2020 09:34:08 +0000 (10:34 +0100)]
improve folder name for persistent doc tests

4 years agoAdd missing -lmsvcrt on mingw after -lpthread
Amanieu d'Antras [Tue, 31 Mar 2020 11:27:09 +0000 (12:27 +0100)]
Add missing -lmsvcrt on mingw after -lpthread

Fixes #70316

4 years agoDeduplicate crosstool-ng.sh
Ben Wolsieffer [Tue, 31 Mar 2020 00:09:45 +0000 (20:09 -0400)]
Deduplicate crosstool-ng.sh

4 years agoFix incorrect documentation for `str::{split_at, split_at_mut}`
Jacob Greenfield [Mon, 30 Mar 2020 19:48:52 +0000 (15:48 -0400)]
Fix incorrect documentation for `str::{split_at, split_at_mut}`

4 years agoAdd `Rust` to the code snippet
DutchGhost [Mon, 30 Mar 2020 19:33:42 +0000 (21:33 +0200)]
Add `Rust` to the code snippet

4 years agostd: Fix over-aligned allocations on wasm32-wasi
Alex Crichton [Mon, 30 Mar 2020 19:30:06 +0000 (12:30 -0700)]
std: Fix over-aligned allocations on wasm32-wasi

The wasm32-wasi target delegates its malloc implementation to the
functions in wasi-libc, but the invocation of `aligned_alloc` was
incorrect by passing the number of bytes requested first rather than the
alignment. This commit swaps the order of these two arguments to ensure
that we allocate over-aligned memory correctly.

4 years agoAuto merge of #70574 - matthiaskrgr:submodule_upd, r=Centril
bors [Mon, 30 Mar 2020 17:54:18 +0000 (17:54 +0000)]
Auto merge of #70574 - matthiaskrgr:submodule_upd, r=Centril

submodules: update clippy from 70b93aab to e170c849

Changes:
````
rustup  https://github.com/rust-lang/rust/pull/70536
Rustup to https://github.com/rust-lang/rust/pull/70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes #70554

4 years agoupdate tests, improve variable names
Bastian Kauschke [Mon, 30 Mar 2020 17:34:16 +0000 (19:34 +0200)]
update tests, improve variable names

4 years agoadd test for array len inference
Bastian Kauschke [Mon, 30 Mar 2020 17:13:20 +0000 (19:13 +0200)]
add test for array len inference

4 years agodedup docs
Bastian Kauschke [Mon, 30 Mar 2020 17:09:59 +0000 (19:09 +0200)]
dedup docs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoCorrect long error message according to reviews
Julien Philippon [Mon, 30 Mar 2020 17:02:01 +0000 (19:02 +0200)]
Correct long error message according to reviews

4 years agoDocument ThreadSanitizer in unstable-book
Tomasz Miąsko [Sun, 22 Mar 2020 00:00:00 +0000 (00:00 +0000)]
Document ThreadSanitizer in unstable-book

4 years agoinfer arr len from pattern
Bastian Kauschke [Mon, 30 Mar 2020 16:13:14 +0000 (18:13 +0200)]
infer arr len from pattern

4 years agosubmodules: update clippy from 70b93aab to e170c849
Matthias Krüger [Mon, 30 Mar 2020 15:56:08 +0000 (17:56 +0200)]
submodules: update clippy from 70b93aab to e170c849

Changes:
````
rustup  https://github.com/rust-lang/rust/pull/70536
Rustup to https://github.com/rust-lang/rust/pull/70449
readme: move "how to run single lint" instructions to "Allowing/denying lints" section.
git attribute macros not allowed in submodules
Deprecate REPLACE_CONSTS lint
Bump itertools
````

Fixes #70554

4 years agoOptimize strip_prefix and strip_suffix with str patterns
Nikhil Benesch [Fri, 6 Mar 2020 20:11:24 +0000 (15:11 -0500)]
Optimize strip_prefix and strip_suffix with str patterns

Constructing a Searcher in strip_prefix and strip_suffix is
unnecessarily slow when the pattern is a fixed-length string. Add
strip_prefix and strip_suffix methods to the Pattern trait, and add
optimized implementations of these methods in the str implementation.
The old implementation is retained as the default for these methods.

4 years agoAuto merge of #70568 - Dylan-DPC:rollup-em6vnpx, r=Dylan-DPC
bors [Mon, 30 Mar 2020 14:25:34 +0000 (14:25 +0000)]
Auto merge of #70568 - Dylan-DPC:rollup-em6vnpx, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #70479 (avoid creating unnecessary reference in Windows Env iterator)
 - #70546 (Polonius: update to 0.12.1, fix more move errors false positives, update test expectations)
 - #70559 (fix BTreeMap test compilation with Miri)
 - #70567 (Fix broken link in README)

Failed merges:

r? @ghost

4 years agoRollup merge of #70567 - JOE1994:patch-3, r=Centril
Dylan DPC [Mon, 30 Mar 2020 14:24:52 +0000 (16:24 +0200)]
Rollup merge of #70567 - JOE1994:patch-3, r=Centril

Fix broken link in README

Fix broken link to `rustc-dev-guide` section for `codegen`

4 years agoRollup merge of #70559 - RalfJung:btree-test-miri, r=Mark-Simulacrum
Dylan DPC [Mon, 30 Mar 2020 14:24:51 +0000 (16:24 +0200)]
Rollup merge of #70559 - RalfJung:btree-test-miri, r=Mark-Simulacrum

fix BTreeMap test compilation with Miri

This got broken by https://github.com/rust-lang/rust/pull/70506

4 years agoRollup merge of #70546 - lqd:polonius_update, r=nikomatsakis
Dylan DPC [Mon, 30 Mar 2020 14:24:49 +0000 (16:24 +0200)]
Rollup merge of #70546 - lqd:polonius_update, r=nikomatsakis

Polonius: update to 0.12.1, fix more move errors false positives, update test expectations

This PR:
- updates `polonius-engine` to version 0.12.1 to fix some move errors false positives
- fixes a fact generation mistake creating the other move errors false positives
- updates the test expectations for the polonius compare-mode so that all (minus the 2 OOMs) ui tests pass again (matching the [analysis doc](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?view) starting at case 34)

In my opinion, this is safe to rollup.

r? @nikomatsakis

4 years agoRollup merge of #70479 - RalfJung:win-env, r=Mark-Simulacrum
Dylan DPC [Mon, 30 Mar 2020 14:24:44 +0000 (16:24 +0200)]
Rollup merge of #70479 - RalfJung:win-env, r=Mark-Simulacrum

avoid creating unnecessary reference in Windows Env iterator

Discovered in https://github.com/rust-lang/miri/pull/1225: the Windows `Env` iterator violates Stacked Borrows by creating an `&u16`, turning it into a raw pointer, and then accessing memory outside the range of that type.

There is no need to create a reference here in the first place, so the fix is trivial.
Cc @JOE1994
Cc https://github.com/rust-lang/unsafe-code-guidelines/issues/134

4 years agoFix broken link in README
Youngsuk Kim [Mon, 30 Mar 2020 14:09:51 +0000 (10:09 -0400)]
Fix broken link in README

4 years agoremove obsolete comment
Tshepang Lekhonkhobe [Mon, 30 Mar 2020 11:38:17 +0000 (13:38 +0200)]
remove obsolete comment

Made obsolete by b5e35b128efeed4bfdb4b1ee9d0697389ec9f164

4 years agotry_resolve_as_non_binding: span_bug -> delay_span_bug
Mazdak Farrokhzad [Mon, 30 Mar 2020 06:40:23 +0000 (08:40 +0200)]
try_resolve_as_non_binding: span_bug -> delay_span_bug

4 years agofix BTreeMap test compilation with Miri
Ralf Jung [Mon, 30 Mar 2020 10:03:55 +0000 (12:03 +0200)]
fix BTreeMap test compilation with Miri

4 years agoAuto merge of #70326 - matthiaskrgr:cl1ppy_single_match, r=Centril
bors [Mon, 30 Mar 2020 09:16:21 +0000 (09:16 +0000)]
Auto merge of #70326 - matthiaskrgr:cl1ppy_single_match, r=Centril

Use if let instead of match when only matching a single variant (clippy::single_match)

Makes code more compact and reduces nesting.

4 years agoUse if let instead of match when only matching a single variant (clippy::single_match)
Matthias Krüger [Sun, 22 Mar 2020 12:36:56 +0000 (13:36 +0100)]
Use if let instead of match when only matching a single variant (clippy::single_match)

Makes code more compact and reduces nestig.

4 years agoparse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.
Mazdak Farrokhzad [Mon, 30 Mar 2020 07:20:55 +0000 (09:20 +0200)]
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.

4 years agoAuto merge of #70536 - Centril:rustc-middle, r=eddyb
bors [Mon, 30 Mar 2020 05:26:27 +0000 (05:26 +0000)]
Auto merge of #70536 - Centril:rustc-middle, r=eddyb

Rename `librustc` to `librustc_middle`

Here we rename `librustc` to `librustc_middle`.

This crate is not nearly as large or central as it was previously and so it doesn't make much sense to give it such a central name as `librustc` ("the entry point to the compiler"). Moreover, there is already a `rustc` crate which is has the actual `fn main` of `rustc`, so having `librustc` is confusing relative to that.

r? @eddyb

4 years agorustc -> rustc_middle part 5 -- fix tests
Mazdak Farrokhzad [Sun, 29 Mar 2020 16:08:01 +0000 (18:08 +0200)]
rustc -> rustc_middle part 5 -- fix tests

4 years agorustc -> rustc_middle part 4 -- pacify tidy
Mazdak Farrokhzad [Sun, 29 Mar 2020 15:29:12 +0000 (17:29 +0200)]
rustc -> rustc_middle part 4 -- pacify tidy

4 years agorustc -> rustc_middle part 3 (rustfmt)
Mazdak Farrokhzad [Sun, 29 Mar 2020 15:19:48 +0000 (17:19 +0200)]
rustc -> rustc_middle part 3 (rustfmt)

4 years agorustc -> rustc_middle part 2
Mazdak Farrokhzad [Sun, 29 Mar 2020 14:41:09 +0000 (16:41 +0200)]
rustc -> rustc_middle part 2

4 years agorustc -> rustc_middle part 1
Mazdak Farrokhzad [Sun, 29 Mar 2020 13:24:45 +0000 (15:24 +0200)]
rustc -> rustc_middle part 1

4 years agoAuto merge of #70449 - ecstatic-morse:visit-body, r=oli-obk
bors [Mon, 30 Mar 2020 02:04:00 +0000 (02:04 +0000)]
Auto merge of #70449 - ecstatic-morse:visit-body, r=oli-obk

Make `Visitor::visit_body` take a plain `&Body`

`ReadOnlyBodyAndCache` has replaced `&Body` in many parts of the code base that don't care about basic block predecessors. This includes the MIR `Visitor` trait, which I suspect resulted in many unnecessary changes in #64736. This reverts part of that PR to reduce the number of places where we need to pass a `ReadOnlyBodyAndCache`.

In the long term, we should either give `ReadOnlyBodyAndCache` more ergonomic name and replace all uses of `&mir::Body` with it at the cost of carrying an extra pointer everywhere, or use it only in places that actually need access to the predecessor cache. Perhaps there is an even nicer alternative.

r? @Nashenas88

4 years agoAdd long error code for error E0226
Julien Philippon [Mon, 30 Mar 2020 00:50:53 +0000 (02:50 +0200)]
Add long error code for error E0226

4 years agobless output of ui test nll/user-annotations/closure-substs.rs
Remy Rakic [Sun, 29 Mar 2020 23:30:26 +0000 (01:30 +0200)]
bless output of ui test nll/user-annotations/closure-substs.rs

Trivial diagnostics grammar change

4 years agobless output of ui test impl-trait/multiple-lifetimes/error-handling.rs
Remy Rakic [Sun, 29 Mar 2020 23:28:27 +0000 (01:28 +0200)]
bless output of ui test impl-trait/multiple-lifetimes/error-handling.rs

Some impl Trait fixes lead to locating more accurately the cause of
a universal region error with a user annotation

4 years agobless output of ui test closures/closure-expected-type/expect-region-supply-region.rs
Remy Rakic [Sun, 29 Mar 2020 23:24:52 +0000 (01:24 +0200)]
bless output of ui test closures/closure-expected-type/expect-region-supply-region.rs

trivial diagnostics grammar change

4 years agobless output of ui test nll/outlives-suggestion-simple.rs
Remy Rakic [Sun, 29 Mar 2020 23:22:59 +0000 (01:22 +0200)]
bless output of ui test nll/outlives-suggestion-simple.rs

trivial diagnostics wording change

4 years agobless output of ui test hrtb/hrtb-perfect-forwarding.rs
Remy Rakic [Sun, 29 Mar 2020 23:18:27 +0000 (01:18 +0200)]
bless output of ui test hrtb/hrtb-perfect-forwarding.rs

trivial formatting changes

4 years agoPolonius fact generation: fix path access fact location
Remy Rakic [Sun, 29 Mar 2020 23:13:03 +0000 (01:13 +0200)]
Polonius fact generation: fix path access fact location

This will fix the other move errors false positives:
emitting the fact at the start point caused accesses to be at the
same point as an initialization fact of the return place of a call
on the following block, which emitted an error.

4 years agoupdate polonius-engine to 0.12.1
Remy Rakic [Sun, 29 Mar 2020 23:11:44 +0000 (01:11 +0200)]
update polonius-engine to 0.12.1

This will fix some move errors false positives

4 years agoAuto merge of #70009 - estebank:sugg-bound, r=Centril
bors [Sun, 29 Mar 2020 22:50:59 +0000 (22:50 +0000)]
Auto merge of #70009 - estebank:sugg-bound, r=Centril

Tweak `suggest_constraining_type_param`

Some of the bound restriction structured suggestions were incorrect while others had subpar output.

The only issue left is a suggestion for an already present bound when dealing with `const`s that should be handled independently.

Fix #69983.

4 years agoUse `&` to do deref coercion for `ReadOnlyBodyAndCache`
Dylan MacKenzie [Sat, 28 Mar 2020 21:54:41 +0000 (14:54 -0700)]
Use `&` to do deref coercion for `ReadOnlyBodyAndCache`

4 years agoTweak `suggest_constraining_type_param`
Esteban Küber [Sat, 14 Mar 2020 02:28:14 +0000 (19:28 -0700)]
Tweak `suggest_constraining_type_param`

Some of the bound restriction structured suggestions were incorrect
while others had subpar output.

4 years agoAuto merge of #70544 - Dylan-DPC:rollup-pj86j17, r=Dylan-DPC
bors [Sun, 29 Mar 2020 19:43:24 +0000 (19:43 +0000)]
Auto merge of #70544 - Dylan-DPC:rollup-pj86j17, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #69702 (Rename TyLayout to TyAndLayout.)
 - #70539 (add test for 62220)
 - #70540 (#[link]: mention wasm_import_module instead of cfg)
 - #70541 (prohibit_generics: update has_err for consts)

Failed merges:

r? @ghost

4 years agoRollup merge of #70541 - lcnr:patch-1, r=varkor
Dylan DPC [Sun, 29 Mar 2020 19:23:55 +0000 (21:23 +0200)]
Rollup merge of #70541 - lcnr:patch-1, r=varkor

prohibit_generics: update has_err for consts

r? @eddyb

4 years agoRollup merge of #70540 - jonas-schievink:link-attr-template, r=varkor
Dylan DPC [Sun, 29 Mar 2020 19:23:53 +0000 (21:23 +0200)]
Rollup merge of #70540 - jonas-schievink:link-attr-template, r=varkor

#[link]: mention wasm_import_module instead of cfg

`#[link(cfg)]` is perma-unstable and is not documented anywhere else. It makes more sense to mention `wasm_import_module` here since it's stable.

This makes it harder to hit https://github.com/rust-lang/rust/issues/70538 (if it weren't for this text, I wouldn't even know this feature existed).

4 years agoRollup merge of #70539 - DutchGhost:test-62220, r=Dylan-DPC
Dylan DPC [Sun, 29 Mar 2020 19:23:52 +0000 (21:23 +0200)]
Rollup merge of #70539 - DutchGhost:test-62220, r=Dylan-DPC

add test for 62220

Closes #62220

Adds a test for https://github.com/rust-lang/rust/issues/62220.

Im not sure whether `check-pass` is sufficient here. I didn't put `run-pass` in, as I'm afraid that'll fail due to the `unimplemented!()` return in the code.

4 years agoRollup merge of #69702 - anyska:tylayout-rename, r=oli-obk
Dylan DPC [Sun, 29 Mar 2020 19:23:50 +0000 (21:23 +0200)]
Rollup merge of #69702 - anyska:tylayout-rename, r=oli-obk

Rename TyLayout to TyAndLayout.

4 years agoMake `Visitor::visit_body` take a simple `Body`
Dylan MacKenzie [Thu, 26 Mar 2020 23:02:10 +0000 (16:02 -0700)]
Make `Visitor::visit_body` take a simple `Body`

4 years agoprohibit_generics: update has_err for consts
Bastian Kauschke [Sun, 29 Mar 2020 16:34:42 +0000 (18:34 +0200)]
prohibit_generics: update has_err for consts

4 years agoadd a build-pass test for issue 62220
Dodo [Sun, 29 Mar 2020 16:27:54 +0000 (18:27 +0200)]
add a build-pass test for issue 62220

4 years ago#[link]: mention wasm_import_module instead of cfg
Jonas Schievink [Sun, 29 Mar 2020 15:40:04 +0000 (17:40 +0200)]
#[link]: mention wasm_import_module instead of cfg

4 years agoAuto merge of #70534 - Centril:rollup-t59tcx2, r=Centril
bors [Sun, 29 Mar 2020 14:48:58 +0000 (14:48 +0000)]
Auto merge of #70534 - Centril:rollup-t59tcx2, r=Centril

Rollup of 3 pull requests

Successful merges:

 - #70140 (Add Result<Result<T, E>, E>::flatten -> Result<T, E>)
 - #70526 (reduce `rustc_attr` usage in places)
 - #70527 (Update LLVM submodule)

Failed merges:

r? @ghost

4 years agoRollup merge of #70527 - Amanieu:fix_fastisel, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 29 Mar 2020 14:48:24 +0000 (16:48 +0200)]
Rollup merge of #70527 - Amanieu:fix_fastisel, r=Mark-Simulacrum

Update LLVM submodule

Fixes #70148

4 years agoRollup merge of #70526 - Centril:less-attr, r=eddyb
Mazdak Farrokhzad [Sun, 29 Mar 2020 14:48:23 +0000 (16:48 +0200)]
Rollup merge of #70526 - Centril:less-attr, r=eddyb

reduce `rustc_attr` usage in places

This cleans up some unused `rustc_attr` dependencies.

4 years agoRollup merge of #70140 - Nemo157:result-flatten, r=Amanieu
Mazdak Farrokhzad [Sun, 29 Mar 2020 14:48:21 +0000 (16:48 +0200)]
Rollup merge of #70140 - Nemo157:result-flatten, r=Amanieu

Add Result<Result<T, E>, E>::flatten -> Result<T, E>

This PR makes this possible (modulo type inference):

```rust
assert_eq!(Ok(6), Ok(Ok(6)).flatten());
```

Tracking issue: #70142

<sub>largely cribbed directly from <https://github.com/rust-lang/rust/pull/60256></sub>

4 years agoBTreeMap/BTreeSet: implement and test drain_filter
Stein Somers [Sat, 8 Feb 2020 10:52:14 +0000 (11:52 +0100)]
BTreeMap/BTreeSet: implement and test drain_filter

4 years agoAdd benchmarks of drain_filter-like behaviour
Stein Somers [Sun, 2 Feb 2020 11:11:41 +0000 (12:11 +0100)]
Add benchmarks of drain_filter-like behaviour

4 years agoUpdate LLVM submodule
Amanieu d'Antras [Sun, 29 Mar 2020 10:12:55 +0000 (11:12 +0100)]
Update LLVM submodule

4 years agoreduce rustc_attr usage in places
Mazdak Farrokhzad [Sun, 29 Mar 2020 10:01:11 +0000 (12:01 +0200)]
reduce rustc_attr usage in places