]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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

4 years agoAuto merge of #70525 - Centril:rollup-vj3esv3, r=Centril
bors [Sun, 29 Mar 2020 09:50:52 +0000 (09:50 +0000)]
Auto merge of #70525 - Centril:rollup-vj3esv3, r=Centril

Rollup of 3 pull requests

Successful merges:

 - #68692 (impl From<[T; N]> for Vec<T>)
 - #70101 (Add copy bound to atomic & numeric intrinsics)
 - #70506 (BTreeMap testing: introduce symbolic constants and use height consistently)

Failed merges:

r? @ghost

4 years agoRollup merge of #70506 - ssomers:btreemap_testing_consts, r=RalfJung
Mazdak Farrokhzad [Sun, 29 Mar 2020 09:50:13 +0000 (11:50 +0200)]
Rollup merge of #70506 - ssomers:btreemap_testing_consts, r=RalfJung

BTreeMap testing: introduce symbolic constants and use height consistently

Doesn't change what or how much is tested, except for some exact integer types, just for convenience and because `node::CAPACITY` is a usize.

r? @RalfJung

4 years agoRollup merge of #70101 - tmiasko:intrinsics-copy, r=eddyb
Mazdak Farrokhzad [Sun, 29 Mar 2020 09:50:12 +0000 (11:50 +0200)]
Rollup merge of #70101 - tmiasko:intrinsics-copy, r=eddyb

Add copy bound to atomic & numeric intrinsics

4 years agoRollup merge of #68692 - jyn514:vec-from-array, r=LukasKalbertodt
Mazdak Farrokhzad [Sun, 29 Mar 2020 09:50:10 +0000 (11:50 +0200)]
Rollup merge of #68692 - jyn514:vec-from-array, r=LukasKalbertodt

impl From<[T; N]> for Vec<T>

Closes https://github.com/rust-lang/rust/issues/67963

4 years agoAuto merge of #70370 - petrochenkov:nosmatch, r=Centril
bors [Sun, 29 Mar 2020 06:33:42 +0000 (06:33 +0000)]
Auto merge of #70370 - petrochenkov:nosmatch, r=Centril

Remove attribute `#[structural_match]` and any references to it

A small remaining part of https://github.com/rust-lang/rust/issues/63438.

4 years agoAuto merge of #70518 - Dylan-DPC:rollup-n2gkh3a, r=Dylan-DPC
bors [Sun, 29 Mar 2020 00:56:47 +0000 (00:56 +0000)]
Auto merge of #70518 - Dylan-DPC:rollup-n2gkh3a, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #69937 (ASCII methods on OsStr)
 - #70235 (Validate git setup before accessing functionality)
 - #70503 (rename Scalar::{ptr_null -> null_ptr} and add "machine_" prefix like elsewhere)
 - #70508 (Miri: use more specialized Scalar::from_ constructors where appropriate)
 - #70510 (fix TryEnterCriticalSection return type)

Failed merges:

r? @ghost

4 years agoRollup merge of #70510 - RalfJung:bool-vs-boolean, r=Mark-Simulacrum
Dylan DPC [Sun, 29 Mar 2020 00:32:23 +0000 (01:32 +0100)]
Rollup merge of #70510 - RalfJung:bool-vs-boolean, r=Mark-Simulacrum

fix TryEnterCriticalSection return type

Source: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-tryentercriticalsection
Fixes https://github.com/rust-lang/rust/issues/70504

4 years agoRollup merge of #70508 - RalfJung:scalar-from, r=eddyb
Dylan DPC [Sun, 29 Mar 2020 00:32:22 +0000 (01:32 +0100)]
Rollup merge of #70508 - RalfJung:scalar-from, r=eddyb

Miri: use more specialized Scalar::from_ constructors where appropriate

4 years agoRollup merge of #70503 - RalfJung:null, r=varkor
Dylan DPC [Sun, 29 Mar 2020 00:32:21 +0000 (01:32 +0100)]
Rollup merge of #70503 - RalfJung:null, r=varkor

rename Scalar::{ptr_null -> null_ptr} and add "machine_" prefix like elsewhere

"NULL pointer" is just much more common terminology than "pointer-null".
Also I forgot two methods when renaming all the `Scalar` things to `(to|from)_machine_(u|i)size`.

4 years agoRollup merge of #70235 - dillona:70182-check-before-using-git, r=Mark-Simulacrum
Dylan DPC [Sun, 29 Mar 2020 00:32:19 +0000 (01:32 +0100)]
Rollup merge of #70235 - dillona:70182-check-before-using-git, r=Mark-Simulacrum

Validate git setup before accessing functionality

Closes #70182

4 years agoRollup merge of #69937 - TyPR124:osstr_ascii, r=dtolnay
Dylan DPC [Sun, 29 Mar 2020 00:32:17 +0000 (01:32 +0100)]
Rollup merge of #69937 - TyPR124:osstr_ascii, r=dtolnay

ASCII methods on OsStr

Would close #69566

I don't know enough about encodings to know if this is a valid change, however the comment on the issue suggests it could be.

This does two things:

1. Makes ASCII methods available on OsStr

2. Makes it possible to obtain a `&mut OsStr`. This is necessary to actually use `OsStr::make_ascii_*case` methods since they modify the underlying value. As far as I can tell, the only way to modify a `&mut OsStr` is via the methods I just added.

My original hope was to have these methods on `OsStrExt` for Windows, since the standard library already assumes `make_ascii_uppercase` is valid in Windows (see the change I made to windows/process.rs). If it is found these are not valid changes on non-Windows platforms, I can move the methods to the ext trait instead.

4 years agoadd tracking issue
TyPR124 [Sat, 28 Mar 2020 23:23:49 +0000 (19:23 -0400)]
add tracking issue

4 years agomove doc links for consistency
TyPR124 [Thu, 12 Mar 2020 16:40:57 +0000 (12:40 -0400)]
move doc links for consistency

4 years agoremove unnecessary comments
TyPR124 [Wed, 11 Mar 2020 20:15:16 +0000 (16:15 -0400)]
remove unnecessary comments

4 years agouse make_ascii_uppercase in windows/process.rs
TyPR124 [Wed, 11 Mar 2020 20:05:11 +0000 (16:05 -0400)]
use make_ascii_uppercase in windows/process.rs

4 years agoascii methods on osstr
TyPR124 [Wed, 11 Mar 2020 19:53:55 +0000 (15:53 -0400)]
ascii methods on osstr

4 years agoBTreeMap testing: introduce symbolic constants and refer to height consistently.
Stein Somers [Sat, 8 Feb 2020 10:52:14 +0000 (11:52 +0100)]
BTreeMap testing: introduce symbolic constants and refer to height consistently.

4 years agoAuto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPC
bors [Sat, 28 Mar 2020 20:11:01 +0000 (20:11 +0000)]
Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPC

Add lint when no doc is present at the crate-level

Follow-up of #66267.

r? @kinnison

4 years agofix TryEnterCriticalSection return type
Ralf Jung [Sat, 28 Mar 2020 20:10:11 +0000 (21:10 +0100)]
fix TryEnterCriticalSection return type

4 years agorefmt
Ralf Jung [Sat, 28 Mar 2020 18:51:54 +0000 (19:51 +0100)]
refmt

4 years agoget rid of useless back-and-forth cast
Ralf Jung [Sat, 28 Mar 2020 18:40:58 +0000 (19:40 +0100)]
get rid of useless back-and-forth cast

4 years agouse more specialized Scalar::from_ constructors where appropriate
Ralf Jung [Sat, 28 Mar 2020 18:29:46 +0000 (19:29 +0100)]
use more specialized Scalar::from_ constructors where appropriate

4 years agoAuto merge of #70499 - Dylan-DPC:rollup-f9je1l8, r=Dylan-DPC
bors [Sat, 28 Mar 2020 17:15:32 +0000 (17:15 +0000)]
Auto merge of #70499 - Dylan-DPC:rollup-f9je1l8, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70418 (Add long error explanation for E0703)
 - #70448 (Create output dir in rustdoc markdown render)
 - #70486 (Shrink Unicode tables (even more))
 - #70493 (Fix rustdoc.css CSS tab-size property)
 - #70495 (Replace last mention of IRC with Discord)

Failed merges:

r? @ghost

4 years agouse machine_ prefix for target usize/isize
Ralf Jung [Sat, 28 Mar 2020 16:51:11 +0000 (17:51 +0100)]
use machine_ prefix for target usize/isize

4 years agorename Scalar::{ptr_null -> null_ptr}
Ralf Jung [Sat, 28 Mar 2020 15:57:33 +0000 (16:57 +0100)]
rename Scalar::{ptr_null -> null_ptr}

4 years agoRollup merge of #70495 - bkaestner:master, r=Mark-Simulacrum
Dylan DPC [Sat, 28 Mar 2020 14:22:03 +0000 (15:22 +0100)]
Rollup merge of #70495 - bkaestner:master, r=Mark-Simulacrum

Replace last mention of IRC with Discord

Mozilla's IRC service was shut down in March 2020. The official instant messaging variant has been Discord for a while, and most of the links were already replaced by #61524.

This was the last line that came up with `irc.mozilla.org` or any combination of "irc.*#[a-z]+" in a `git grep`:

    git grep -i -E "irc.*#[a-z]+"

As there is only one other link directly to Rust's discord, I used the same Markdown link `[rust-discord]` as in `bootstrap/README.md` to stay consistent. This might come in handy if the chat platform changes at a later point again.

4 years agoRollup merge of #70493 - 0xd4d:rustdoc-tab-size, r=GuillaumeGomez
Dylan DPC [Sat, 28 Mar 2020 14:22:01 +0000 (15:22 +0100)]
Rollup merge of #70493 - 0xd4d:rustdoc-tab-size, r=GuillaumeGomez

Fix rustdoc.css CSS tab-size property

This fixes the CSS tab size property names which are called `tab-size` / `-moz-tab-size` and not `tab-width`

Old issue https://github.com/rust-lang/rust/issues/49155 and related PR https://github.com/rust-lang/rust/pull/50947

tab-size: https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size

4 years agoRollup merge of #70486 - Mark-Simulacrum:unicode-shrink, r=dtolnay
Dylan DPC [Sat, 28 Mar 2020 14:22:00 +0000 (15:22 +0100)]
Rollup merge of #70486 - Mark-Simulacrum:unicode-shrink, r=dtolnay

Shrink Unicode tables (even more)

This shrinks the Unicode tables further, building upon the wins in #68232 (the previous counts differ due to an interim Unicode version update, see #69929.

The new data structure is slower by around 3x, on the benchmark of looking up every Unicode scalar value in each data set sequentially in every data set included. Note that for ASCII, the exposed functions on `char` optimize with direct branches, so ASCII will retain the same performance regardless of internal optimizations (or the reverse). Also, note that the size reduction due to the skip list (from where the performance losses come) is around 40%, and, as a result, I believe the performance loss is acceptable, as the routines are still quite fast. Anywhere where this is hot, should probably be using a custom data structure anyway (e.g., a raw bitset) or something optimized for frequently seen values, etc.

This PR updates both the bitset data structure, and introduces a new data structure similar to a skip list. For more details, see the [main.rs] of the table generator, which describes both. The commits mostly work individually and document size wins.

As before, this is tested on all valid chars to have the same results as nightly (and the canonical Unicode data sets), happily, no bugs were found.

[main.rs]: https://github.com/rust-lang/rust/blob/fb4a715e18b/src/tools/unicode-table-generator/src/main.rs

Set             | Previous |  New  |  % of old  | Codepoints | Ranges |
----------------|---------:|------:|-----------:|-----------:|-------:|
Alphabetic      |     3055 |  1599 |        52% |     132875 |    695 |
Case Ignorable  |     2136 |   949 |        44% |       2413 |    410 |
Cased           |      934 |   359 |        38% |       4286 |    141 |
Cc              |       43 |     9 |        20% |         65 |      2 |
Grapheme Extend |     1774 |   813 |        46% |       1979 |    344 |
Lowercase       |      985 |   867 |        88% |       2344 |    652 |
N               |     1266 |   419 |        33% |       1781 |    133 |
Uppercase       |      934 |   777 |        83% |       1911 |    643 |
White_Space     |      140 |    37 |        26% |         25 |     10 |
----------------|----------|-------|------------|------------|--------|
Total           |    11267 |  5829 |        51% |     -      |   -    |

4 years agoRollup merge of #70448 - TimotheeGerber:rustdoc-create-output-dir, r=GuillaumeGomez
Dylan DPC [Sat, 28 Mar 2020 14:21:58 +0000 (15:21 +0100)]
Rollup merge of #70448 - TimotheeGerber:rustdoc-create-output-dir, r=GuillaumeGomez

Create output dir in rustdoc markdown render

`rustdoc` command on a standalone markdown document fails because the output directory (which default to `doc/`) is not created, even when specified with the `--output` argument.

This PR adds the creation of the output directory before the file creation to avoid an unexpected error which is unclear.

I am not sure about the returned error code. I did not find a table explaining them. So I simply put the same error code that is returned when `File::create` fails because they are both related to file-system errors.

Resolve #70431

4 years agoRollup merge of #70418 - PankajChaudhary5:master, r=Dylan-DPC
Dylan DPC [Sat, 28 Mar 2020 14:21:57 +0000 (15:21 +0100)]
Rollup merge of #70418 - PankajChaudhary5:master, r=Dylan-DPC

Add long error explanation for E0703

Add long explanation for the E0703 error code
Part of #61137

r? @GuillaumeGomez

4 years agoAuto merge of #70485 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Sat, 28 Mar 2020 14:15:27 +0000 (14:15 +0000)]
Auto merge of #70485 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from 1ff81c1b to 70b93aab

Changes:
````
remove redundant import
rustup https://github.com/rust-lang/rust/pull/68404
rustup https://github.com/rust-lang/rust/pull/69644
rustup https://github.com/rust-lang/rust/pull/70344
Move verbose_file_reads to restriction
move redundant_pub_crate to nursery
readme: explain how to run only a single lint on a codebase
Remove dependency on `matches` crate
Move useless_transmute to nursery
nursery group -> style
Update for PR feedback
Auto merge of #5314 - ehuss:remove-git2, r=flip1995
Lint for `pub(crate)` items that are not crate visible due to the visibility of the module that contains them
````

Fixes #70456

4 years agoReplace last mention of IRC with Discord
Benjamin Kästner [Sat, 28 Mar 2020 11:23:42 +0000 (12:23 +0100)]
Replace last mention of IRC with Discord

Mozilla's IRC service was shut down in March 2020. The official
instant messaging variant has been Discord for a while, and most of
the links were already replaced by #61524.

This was the last line that came up with `irc.mozilla.org` or any
combination of "irc.*#[a-z]+" in a `git grep`:

    git grep -i -E "irc.*#[a-z]+"

As there is only one other link directly to Rust's discord, I used the
same Markdown link `[rust-discord]` as in `bootstrap/README.md` to
stay consistent. This might come in handy if the chat platform changes
at a later point again.

As an aside: for those interested in the use of IRC, Mozilla's [wiki]
still offers a lot of in-depth knowledge.

 [wiki]: https://wiki.mozilla.org/IRC

4 years agoAuto merge of #70261 - Centril:angle-args-partition, r=varkor
bors [Sat, 28 Mar 2020 11:13:09 +0000 (11:13 +0000)]
Auto merge of #70261 - Centril:angle-args-partition, r=varkor

Move arg/constraint partition check to validation & improve recovery

- In the first commit, we move the check rejecting e.g., `<'a, Item = u8, String>` from the parser into AST validation.
- We then use this to improve the code for parsing generic arguments.
- And we add recovery for e.g., `<Item = >` (missing), `<Item = 42>` (constant), and `<Item = 'a>` (lifetime).

This is also preparatory work for supporting https://github.com/rust-lang/rust/issues/70256.

r? @varkor

4 years agoFix rustdoc.css CSS tab-size property
0xd4d [Sat, 28 Mar 2020 10:49:12 +0000 (11:49 +0100)]
Fix rustdoc.css CSS tab-size property

4 years agoAuto merge of #70095 - jsgf:link-native, r=nagisa
bors [Sat, 28 Mar 2020 08:16:47 +0000 (08:16 +0000)]
Auto merge of #70095 - jsgf:link-native, r=nagisa

Implement -Zlink-native-libraries

This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then
native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged
behaviour).

If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link
line. The assumption is that the outer build system driving the build already knows about the native
libraries and will specify them to the linker directly (for example via `-Clink-arg=`).

Addresses issue #70093

4 years agoAuto merge of #70483 - Centril:rollup-slli4yf, r=Centril
bors [Sat, 28 Mar 2020 00:36:57 +0000 (00:36 +0000)]
Auto merge of #70483 - Centril:rollup-slli4yf, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #70345 (Remove `no_integrated_as` mode.)
 - #70434 (suggest `;` on expr `mac!()` which is good as stmt `mac!()`)
 - #70457 (non-exhastive diagnostic: add note re. scrutinee type)
 - #70478 (Refactor type_of for constants)
 - #70480 (clarify hir_id <-> node_id method names)

Failed merges:

r? @ghost

4 years agoUpdate the documentation comment
Mark Rousskov [Fri, 27 Mar 2020 22:13:22 +0000 (18:13 -0400)]
Update the documentation comment

4 years agoRemove separate encoding for a single nonzero-mapping byte
Mark Rousskov [Fri, 27 Mar 2020 22:01:14 +0000 (18:01 -0400)]
Remove separate encoding for a single nonzero-mapping byte

In practice, for the two data sets that still use the bitset encoding (uppercase
and lowercase) this is not a significant win, so just drop it entirely. It costs
us about 5 bytes, and the complexity is nontrivial.

4 years agoAdd skip list based implementation for smaller encoding
Mark Rousskov [Thu, 26 Mar 2020 01:00:01 +0000 (21:00 -0400)]
Add skip list based implementation for smaller encoding

This arranges for the sparser sets (everything except lower and uppercase) to be
encoded in a significantly smaller context. However, it is also a performance
trade-off (roughly 3x slower than the bitset encoding). The 40% size reduction
is deemed to be sufficiently important to merit this performance loss,
particularly as it is unlikely that this code is hot anywhere (and if it is,
paying the memory cost for a bitset that directly represents the data seems
worthwhile).

Alphabetic     : 1599 bytes     (- 937 bytes)
Case_Ignorable : 949 bytes      (- 822 bytes)
Cased          : 359 bytes      (- 429 bytes)
Cc             : 9 bytes        (-  15 bytes)
Grapheme_Extend: 813 bytes      (- 675 bytes)
Lowercase      : 863 bytes
N              : 419 bytes      (- 619 bytes)
Uppercase      : 776 bytes
White_Space    : 37 bytes       (-  46 bytes)
Total table sizes: 5824 bytes   (-3543 bytes)

4 years agosubmodules: update clippy from 1ff81c1b to 70b93aab
Matthias Krüger [Fri, 27 Mar 2020 22:42:25 +0000 (23:42 +0100)]
submodules: update clippy from 1ff81c1b to 70b93aab

Changes:
````
remove redundant import
rustup https://github.com/rust-lang/rust/pull/68404
rustup https://github.com/rust-lang/rust/pull/69644
rustup https://github.com/rust-lang/rust/pull/70344
Move verbose_file_reads to restriction
move redundant_pub_crate to nursery
readme: explain how to run only a single lint on a codebase
Remove dependency on `matches` crate
Move useless_transmute to nursery
nursery group -> style
Update for PR feedback
Auto merge of #5314 - ehuss:remove-git2, r=flip1995
Lint for `pub(crate)` items that are not crate visible due to the visibility of the module that contains them
````

Fixes #70456

4 years agoRollup merge of #70480 - lcnr:appayupyup, r=eddyb
Mazdak Farrokhzad [Fri, 27 Mar 2020 21:39:42 +0000 (22:39 +0100)]
Rollup merge of #70480 - lcnr:appayupyup, r=eddyb

clarify hir_id <-> node_id method names

resolves 2 FIXME.

r? @eddyb

4 years agoRollup merge of #70478 - lcnr:refactor-type_of, r=varkor
Mazdak Farrokhzad [Fri, 27 Mar 2020 21:39:41 +0000 (22:39 +0100)]
Rollup merge of #70478 - lcnr:refactor-type_of, r=varkor

Refactor type_of for constants

If I have to look at this function for a few hours I want it to at least look good.

r? @varkor

4 years agoRollup merge of #70457 - Centril:non-exhaustive-scrutinee-type, r=estebank
Mazdak Farrokhzad [Fri, 27 Mar 2020 21:39:39 +0000 (22:39 +0100)]
Rollup merge of #70457 - Centril:non-exhaustive-scrutinee-type, r=estebank

non-exhastive diagnostic: add note re. scrutinee type

This fixes https://github.com/rust-lang/rust/issues/67259 by adding a note:
```
    = note: the matched value is of type &[i32]
```
to non-exhaustive pattern matching errors.

r? @varkor @estebank

4 years agoRollup merge of #70434 - Centril:fix-34421, r=estebank
Mazdak Farrokhzad [Fri, 27 Mar 2020 21:39:38 +0000 (22:39 +0100)]
Rollup merge of #70434 - Centril:fix-34421, r=estebank

suggest `;` on expr `mac!()` which is good as stmt `mac!()`

Fixes https://github.com/rust-lang/rust/issues/34421 by implementing @jseyfried's suggestion in https://github.com/rust-lang/rust/issues/34421#issuecomment-301578683.

r? @petrochenkov

4 years agoRollup merge of #70345 - nnethercote:rm-no_integrated_as, r=alexcrichton
Mazdak Farrokhzad [Fri, 27 Mar 2020 21:39:37 +0000 (22:39 +0100)]
Rollup merge of #70345 - nnethercote:rm-no_integrated_as, r=alexcrichton

Remove `no_integrated_as` mode.

Specifically, remove both `-Z no_integrated_as` and
`TargetOptions::no_integrated_as`. The latter was only used for the
`msp430_none_elf` platform, for which it's no longer required.

r? @alexcrichton

4 years agoAuto merge of #70162 - cjgillot:split_query, r=Zoxc
bors [Fri, 27 Mar 2020 21:36:51 +0000 (21:36 +0000)]
Auto merge of #70162 - cjgillot:split_query, r=Zoxc

Move the query system to a dedicated crate

The query system `rustc::ty::query` is split out into the `rustc_query_system` crate.

Some commits are unformatted, to ease rebasing.

Based on #67761 and #69910.

r? @Zoxc

4 years agoadd the label back but make it shorter
Mazdak Farrokhzad [Fri, 27 Mar 2020 20:52:09 +0000 (21:52 +0100)]
add the label back but make it shorter

4 years agoImplement -Zlink-native-libraries
Jeremy Fitzhardinge [Wed, 18 Mar 2020 02:10:56 +0000 (19:10 -0700)]
Implement -Zlink-native-libraries

This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then
native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged
behaviour).

If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link
line. The assumption is that the outer build system driving the build already knows about the native
libraries and will specify them to the linker directly (for example via `-Clink-arg=`).

Addresses issue #70093

4 years agoRename TyLayout to TyAndLayout.
Ana-Maria Mihalache [Wed, 4 Mar 2020 14:50:21 +0000 (14:50 +0000)]
Rename TyLayout to TyAndLayout.

4 years agoAuto merge of #70474 - Dylan-DPC:rollup-0lsxmmk, r=Dylan-DPC
bors [Fri, 27 Mar 2020 16:09:48 +0000 (16:09 +0000)]
Auto merge of #70474 - Dylan-DPC:rollup-0lsxmmk, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #65222 (Proposal: `fold_self` and `try_fold_self` for Iterators)
 - #69887 (clean up E0404 explanation)
 - #70068 (use "gcc" instead of "cc" on *-sun-solaris systems when linking)
 - #70470 (Clean up E0463 explanation)

Failed merges:

r? @ghost

4 years agorefactor type_of for consts
Bastian Kauschke [Fri, 27 Mar 2020 15:44:40 +0000 (16:44 +0100)]
refactor type_of for consts

4 years agoclarify hir_id <-> node_id method names
Bastian Kauschke [Fri, 27 Mar 2020 15:43:20 +0000 (16:43 +0100)]
clarify hir_id <-> node_id method names

4 years agoRefactor changes
PankajChaudhary5 [Fri, 27 Mar 2020 14:30:49 +0000 (20:00 +0530)]
Refactor changes

4 years agoRollup merge of #70470 - GuillaumeGomez:cleanup-e0463, r=Dylan-DPC
Dylan DPC [Fri, 27 Mar 2020 14:09:59 +0000 (15:09 +0100)]
Rollup merge of #70470 - GuillaumeGomez:cleanup-e0463, r=Dylan-DPC

Clean up E0463 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70068 - jclulow:illumos-gcc, r=cramertj
Dylan DPC [Fri, 27 Mar 2020 14:09:57 +0000 (15:09 +0100)]
Rollup merge of #70068 - jclulow:illumos-gcc, r=cramertj

use "gcc" instead of "cc" on *-sun-solaris systems when linking

On illumos and Solaris systems, Rust will use GCC as the link editor.
Rust does this by invoking "cc", which on many (Linux and perhaps BSD)
systems is generally either GCC or a GCC-compatible front-end.  On
historical Solaris systems, "cc" was often the Sun Studio compiler.
This history casts a long shadow, and as such, even most modern
illumos-based operating systems tend to install GCC as "gcc", without
also making it available as "cc".

We should invoke GCC as "gcc" on such systems to ensure we get the right
compiler driver.

4 years agoRollup merge of #69887 - GuillaumeGomez:cleanup-e0404, r=Dylan-DPC
Dylan DPC [Fri, 27 Mar 2020 14:09:54 +0000 (15:09 +0100)]
Rollup merge of #69887 - GuillaumeGomez:cleanup-e0404, r=Dylan-DPC

clean up E0404 explanation

r? @Dylan-DPC

4 years agoRollup merge of #65222 - Lucretiel:fold_self, r=kodrAus
Dylan DPC [Fri, 27 Mar 2020 14:09:48 +0000 (15:09 +0100)]
Rollup merge of #65222 - Lucretiel:fold_self, r=kodrAus

Proposal: `fold_self` and `try_fold_self` for Iterators

This pull request proposes & implements two new methods on Iterators: `fold_self` and `try_fold_self`. These are variants of `fold` and `try_fold` that use the first element in the iterator as the initial accumulator.

Let me know if a public feature like this requires an RFC, or if this pull request is sufficient as place for discussion.

4 years agoclean up E0404 explanation
Guillaume Gomez [Tue, 10 Mar 2020 11:54:17 +0000 (12:54 +0100)]
clean up E0404 explanation

4 years agoRefactor changes
PankajChaudhary5 [Fri, 27 Mar 2020 13:46:32 +0000 (19:16 +0530)]
Refactor changes

4 years agoAuto merge of #69916 - oli-obk:mir_bless, r=eddyb
bors [Fri, 27 Mar 2020 12:58:34 +0000 (12:58 +0000)]
Auto merge of #69916 - oli-obk:mir_bless, r=eddyb

Enable blessing of mir opt tests

cc @rust-lang/wg-mir-opt
cc @RalfJung

Long overdue, but now you can finally just add a

```rust
// EMIT_MIR rustc.function_name.MirPassName.before.mir
```

(or `after.mir` since most of the time you want to know the MIR after a pass). A `--bless` invocation will automatically create the files for you.

I suggest we do this for all mir opt tests that have all of the MIR in their source anyway

If you use `rustc.function.MirPass.diff` you only get the diff that the MIR pass causes on the MIR.

Fixes #67865

4 years agoClean up E0463 explanation
Guillaume Gomez [Fri, 27 Mar 2020 12:35:00 +0000 (13:35 +0100)]
Clean up E0463 explanation

4 years agoAuto merge of #70282 - ssomers:btreemap_gdb_pretty_print, r=Mark-Simulacrum
bors [Fri, 27 Mar 2020 09:54:02 +0000 (09:54 +0000)]
Auto merge of #70282 - ssomers:btreemap_gdb_pretty_print, r=Mark-Simulacrum

Test and fix gdb pretty printing more

Over time I had oversimplified the test case for #68098: it does not have an internal node to print so it did not test what it pretended to test. And then I also realized not spotting the same mistake reviewing #70111, and more likely to occur in the wild. Now, both test cases fail if you put back the flawed python code.

r? @Mark-Simulacrum

4 years agoaddress some review comments
Mazdak Farrokhzad [Fri, 27 Mar 2020 06:39:10 +0000 (07:39 +0100)]
address some review comments

4 years agoImplement HashStable directly.
Camille GILLOT [Fri, 27 Mar 2020 07:33:37 +0000 (08:33 +0100)]
Implement HashStable directly.

4 years agoCleanups.
Camille GILLOT [Fri, 27 Mar 2020 06:50:28 +0000 (07:50 +0100)]
Cleanups.

4 years agoMove QueryContext to the parent module.
Camille GILLOT [Fri, 27 Mar 2020 06:43:11 +0000 (07:43 +0100)]
Move QueryContext to the parent module.

4 years agoparse: improve recovery for assoc eq constraints.
Mazdak Farrokhzad [Sun, 22 Mar 2020 05:09:24 +0000 (06:09 +0100)]
parse: improve recovery for assoc eq constraints.

4 years agoextract parse_generic_arg
Mazdak Farrokhzad [Sun, 22 Mar 2020 04:12:51 +0000 (05:12 +0100)]
extract parse_generic_arg

4 years agoparse_angle_arg: parse constraints first
Mazdak Farrokhzad [Sun, 22 Mar 2020 04:01:38 +0000 (05:01 +0100)]
parse_angle_arg: parse constraints first

4 years agosplit parse_angle_args into loop / single step
Mazdak Farrokhzad [Sun, 22 Mar 2020 03:54:46 +0000 (04:54 +0100)]
split parse_angle_args into loop / single step

4 years agoparse: move constraint/arg restriction to ast_validation.
Mazdak Farrokhzad [Sun, 22 Mar 2020 03:40:05 +0000 (04:40 +0100)]
parse: move constraint/arg restriction to ast_validation.

4 years agoRemove the QueryGetter trait.
Camille GILLOT [Fri, 27 Mar 2020 06:35:32 +0000 (07:35 +0100)]
Remove the QueryGetter trait.

4 years agoAuto merge of #69470 - mati865:deps, r=Mark-Simulacrum
bors [Fri, 27 Mar 2020 06:31:49 +0000 (06:31 +0000)]
Auto merge of #69470 - mati865:deps, r=Mark-Simulacrum

Upgrade rustc and bootstrap dependencies