]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAdd Result<Result<T, E>, E>::flatten -> Result<T, E>
Wim Looman [Thu, 19 Mar 2020 08:57:37 +0000 (09:57 +0100)]
Add Result<Result<T, E>, E>::flatten -> Result<T, E>

4 years agoAuto merge of #69293 - Dylan-DPC:rollup-imcbvgo, r=Dylan-DPC
bors [Wed, 19 Feb 2020 19:10:58 +0000 (19:10 +0000)]
Auto merge of #69293 - Dylan-DPC:rollup-imcbvgo, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #68863 (ci: switch macOS builders to 10.15)
 - #69142 (Add shared script for linkchecking books.)
 - #69248 (Don't eliminate frame pointers on thumb targets)
 - #69280 (Remove special case for `simd_shuffle` arg promotion)
 - #69284 (Reword OpenOptions::{create, create_new} doc.)

Failed merges:

r? @ghost

4 years agoRollup merge of #69284 - jumbatm:openoptions-create-doc, r=Dylan-DPC
Dylan DPC [Wed, 19 Feb 2020 17:12:13 +0000 (18:12 +0100)]
Rollup merge of #69284 - jumbatm:openoptions-create-doc, r=Dylan-DPC

Reword OpenOptions::{create, create_new} doc.

Closes #69254.

Currently, the doc comment for `fs::OpenOptions::create` doesn't mention its behaviour when opening an existing file, and `fs::OpenOptions::create_new`'s doc comment is worded in a way that doesn't make it clear that it actually _fails_ if the file already exists, not overwrite the existing file with a new one.

This PR addresses addresses this by rewording the doc comments to be more explicit.

r? @GuillaumeGomez

4 years agoRollup merge of #69280 - ecstatic-morse:promote-shuffle-no-special-case, r=petrochenkov
Dylan DPC [Wed, 19 Feb 2020 17:12:11 +0000 (18:12 +0100)]
Rollup merge of #69280 - ecstatic-morse:promote-shuffle-no-special-case, r=petrochenkov

Remove special case for `simd_shuffle` arg promotion

After rust-lang/stdarch#825, these intrinsics are now defined with `#[rustc_args_required_const(2)]`, so the special-case is no longer necessary.

4 years agoRollup merge of #69248 - jonas-schievink:thumb-fp, r=japaric
Dylan DPC [Wed, 19 Feb 2020 17:12:10 +0000 (18:12 +0100)]
Rollup merge of #69248 - jonas-schievink:thumb-fp, r=japaric

Don't eliminate frame pointers on thumb targets

This should hopefully fix issues https://github.com/rust-lang/rust/issues/69231 and https://github.com/rust-embedded/cortex-m-rt/issues/139.

~~I couldn't test this locally as the rustc I produced does not create binaries (no idea why).~~ Resolved.

4 years agoRollup merge of #69142 - ehuss:linkcheck-script, r=alexcrichton
Dylan DPC [Wed, 19 Feb 2020 17:12:09 +0000 (18:12 +0100)]
Rollup merge of #69142 - ehuss:linkcheck-script, r=alexcrichton

Add shared script for linkchecking books.

This adds a script that can be used on each book's CI to ensure they don't break local links.

I've been running something similar on the reference CI.  The intent here is to add this to all the external books' CI scripts. This will help avoid dealing with broken links when updating submodules on rust-lang/rust.

4 years agoRollup merge of #68863 - pietroalbini:azure-macos-10.15, r=Mark-Simulacrum
Dylan DPC [Wed, 19 Feb 2020 17:12:07 +0000 (18:12 +0100)]
Rollup merge of #68863 - pietroalbini:azure-macos-10.15, r=Mark-Simulacrum

ci: switch macOS builders to 10.15

Azure Pipelines is deprecating the macOS 10.13 image we're currently running, [and they plan to remove them](https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/) on March 23, 2020. This PR switches our macOS builders to macOS 10.15.

r? @Mark-Simulacrum

4 years agoAuto merge of #69198 - ollie27:rustbuild_rustdoc-js, r=Mark-Simulacrum
bors [Wed, 19 Feb 2020 15:55:57 +0000 (15:55 +0000)]
Auto merge of #69198 - ollie27:rustbuild_rustdoc-js, r=Mark-Simulacrum

Fix running rustdoc-js test suite individually

Without `Compiletest.path` set running `x.py test src/test/rustdoc-js` would run the `rustdoc-js` test suite with everything filtered out.

As this was the only place setting `Compiletest.path` to `None` this removes the `Option` wrapper as well.

4 years agoAuto merge of #69278 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Wed, 19 Feb 2020 11:16:01 +0000 (11:16 +0000)]
Auto merge of #69278 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from b91ae16e to 2855b214

Changes:
````
Rustup to rust-lang/rust#69194
Rustup to rust-lang/rust#69181
Add `LOG2_10` and `LOG10_2` to `approx_const` lint
Clean up imports
Use `Vec::with_capacity()` as possible
needless_doctest_main: False positive for async fn
Remove use of `TyKind`.
Use `if_chain`.
Fix ICE.
Add tests and improve checks.
Add `Future` detection for `missing_errors_doc`.
````

Fixes #69269

4 years agoReword OpenOptions::{create, create_new} doc.
jumbatm [Wed, 19 Feb 2020 09:57:32 +0000 (19:57 +1000)]
Reword OpenOptions::{create, create_new} doc.

4 years agoAuto merge of #69265 - ehuss:update-cargo, r=Dylan-DPC
bors [Wed, 19 Feb 2020 08:07:42 +0000 (08:07 +0000)]
Auto merge of #69265 - ehuss:update-cargo, r=Dylan-DPC

Update cargo

9 commits in 3c53211c3d7fee4f430f170115af5baad17a3da9..e02974078a692d7484f510eaec0e88d1b6cc0203
2020-02-07 15:35:03 +0000 to 2020-02-18 15:24:43 +0000
- Set an environment variable for tests to find executables. (rust-lang/cargo#7697)
- Rework internal errors. (rust-lang/cargo#7896)
- Improvements to StringList config handling. (rust-lang/cargo#7891)
- Add new/old rustflags to fingerprint log. (rust-lang/cargo#7890)
- Fix inaccurate doc comment on `env_args`. (rust-lang/cargo#7889)
- Add some extra fingerprint debug information. (rust-lang/cargo#7888)
- Link the licenses into crates/cargo-platform (rust-lang/cargo#7886)
- Modify test to make `rustc` PR mergeable (rust-lang/cargo#7883)
- Keep environment variables in a BTreeMap to preserve sort order (rust-lang/cargo#7877)

4 years agoAdd `#[rustc_args_required_const]` to `simd_shuffle` tests
Dylan MacKenzie [Wed, 19 Feb 2020 07:17:21 +0000 (23:17 -0800)]
Add `#[rustc_args_required_const]` to `simd_shuffle` tests

4 years agoRemove mention of `simd_shuffle` promotion from comments
Dylan MacKenzie [Wed, 19 Feb 2020 05:32:38 +0000 (21:32 -0800)]
Remove mention of `simd_shuffle` promotion from comments

4 years agoRemove special case for `simd_shuffle` arg promotion
Dylan MacKenzie [Wed, 19 Feb 2020 05:28:56 +0000 (21:28 -0800)]
Remove special case for `simd_shuffle` arg promotion

After rust-lang/stdarch#825, these intrinsics are now defined with
`#[rustc_args_required_const(2)]`, so the special-case is no longer
necessary.

4 years agoAuto merge of #69113 - ecstatic-morse:unified-dataflow-borrowed, r=wesleywiser
bors [Wed, 19 Feb 2020 04:57:10 +0000 (04:57 +0000)]
Auto merge of #69113 - ecstatic-morse:unified-dataflow-borrowed, r=wesleywiser

Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis

This PR began as an attempt to port `HaveBeenBorrowedLocals` to the new dataflow framework (see #68241 for prior art). Along the way, I noticed that it could share most of its code with `IndirectlyMutableLocals` and then found a few bugs in the two analyses:
- Neither one marked locals as borrowed after an `Rvalue::AddressOf`.
- `IndirectlyMutableLocals` was missing a minor fix that `HaveBeenBorrowedLocals` got in #61069. This is not a problem today since it is only used during const-checking, where custom drop glue is forbidden. However, this may change some day.

I decided to combine the two analyses so that they wouldn't diverge in the future while ensuring that they remain distinct types (called `MaybeBorrowedLocals` and `MaybeMutBorrowedLocals` to be consistent with the `Maybe{Un,}InitializedPlaces` naming scheme). I fixed the bugs and switched to exhaustive matching where possible to make them less likely in the future. Finally, I added comments explaining some of the finer points of the transfer function for these analyses (see #61069 and #65006).

4 years agosubmodules: update clippy from b91ae16e to 2855b214
Matthias Krüger [Wed, 19 Feb 2020 02:45:10 +0000 (03:45 +0100)]
submodules: update clippy from b91ae16e to 2855b214

Changes:
````
Rustup to rust-lang/rust#69194
Rustup to rust-lang/rust#69181
Add `LOG2_10` and `LOG10_2` to `approx_const` lint
Clean up imports
Use `Vec::with_capacity()` as possible
needless_doctest_main: False positive for async fn
Remove use of `TyKind`.
Use `if_chain`.
Fix ICE.
Add tests and improve checks.
Add `Future` detection for `missing_errors_doc`.
````

Fixes #69269

4 years agoAuto merge of #69241 - shahn:checked_add_revert, r=Mark-Simulacrum,lqd
bors [Wed, 19 Feb 2020 01:36:31 +0000 (01:36 +0000)]
Auto merge of #69241 - shahn:checked_add_revert, r=Mark-Simulacrum,lqd

Revert "Remove `checked_add` in `Layout::repeat`"

This fixes a a segfault in safe code, a stable regression. Reported in #69225.

This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494.

4 years agoRevert "Remove `checked_add` in `Layout::repeat`"
Sebastian Hahn [Mon, 17 Feb 2020 17:55:41 +0000 (18:55 +0100)]
Revert "Remove `checked_add` in `Layout::repeat`"

This fixes a a segfault in safe code, a stable regression. Reported in
\#69225.

This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494.

Also adds a test for the expected behaviour.

4 years agoAuto merge of #69271 - Centril:rollup-iupsol6, r=Centril
bors [Tue, 18 Feb 2020 22:29:06 +0000 (22:29 +0000)]
Auto merge of #69271 - Centril:rollup-iupsol6, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #69146 (Always const qualify literals by type)
 - #69159 (Select an appropriate unused lifetime name in suggestion)
 - #69194 (parse: fuse associated and extern items up to defaultness)
 - #69211 (parser: Simplify treatment of macro variables in `Parser::bump`)
 - #69217 (Do not emit note suggesting to implement operation trait to foreign type)
 - #69236 (parse: recover `mut (x @ y)` as `(mut x @ mut y)`.)

Failed merges:

r? @ghost

4 years agoRollup merge of #69236 - Centril:mut-parens-at-recovery, r=estebank
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:31 +0000 (22:16 +0100)]
Rollup merge of #69236 - Centril:mut-parens-at-recovery, r=estebank

parse: recover `mut (x @ y)` as `(mut x @ mut y)`.

Follow up to https://github.com/rust-lang/rust/pull/68992#discussion_r376829749 and https://github.com/rust-lang/rust/pull/63945.

Specifically, when given `let mut (x @ y)` we recover with `let (mut x @ mut y)` as the suggestion:

```rust
error: `mut` must be attached to each individual binding
  --> $DIR/mut-patterns.rs:12:9
   |
LL |     let mut (x @ y) = 0;
   |         ^^^^^^^^^^^ help: add `mut` to each binding: `(mut x @ mut y)`
   |
   = note: `mut` may be followed by `variable` and `variable @ pattern`
```

r? @matthewjasper @estebank

4 years agoRollup merge of #69217 - LeSeulArtichaut:remove-lint-impl-op, r=estebank
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:29 +0000 (22:16 +0100)]
Rollup merge of #69217 - LeSeulArtichaut:remove-lint-impl-op, r=estebank

Do not emit note suggesting to implement operation trait to foreign type

When a binary operation isn't valid, you will get a lint proposing to add a trait implementation to make the operation possible. However, this cannot be done for foreign types, such as types from `core` or `std`.

For example:
```
= note: an implementation of `std::ops::Add` might be missing for `std::option::Option<i8>`
```
As mentioned in https://github.com/rust-lang/rust/issues/60497#issuecomment-562665539:
> The note suggesting implementing Add<i8> should only be emitted if Option<i8> were local to the current crate, which it isn't, so in this case it shouldn't be emitted.

(I will use the CI to check tests for me, or my computer will just burn... and running IDEs is not possible on a pile of ashes)

r? @estebank

4 years agoRollup merge of #69211 - petrochenkov:prevtok, r=Centril
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:28 +0000 (22:16 +0100)]
Rollup merge of #69211 - petrochenkov:prevtok, r=Centril

parser: Simplify treatment of macro variables in `Parser::bump`

Follow-up to https://github.com/rust-lang/rust/pull/69006.

Token normalization for `$ident` and `$lifetime` is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling (as a result `bump` also doesn't call itself recursively anymore and can't make `prev_token` inconsistent).

r? @Centril

4 years agoRollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkov
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:26 +0000 (22:16 +0100)]
Rollup merge of #69194 - Centril:assoc-extern-fuse, r=petrochenkov

parse: fuse associated and extern items up to defaultness

Language changes:

- The grammar of extern `type` aliases is unified with associated ones, and becomes:
  ```rust
  TypeItem = "type" ident generics {":" bounds}? where_clause {"=" type}? ";" ;
  ```

  Semantic restrictions (`ast_validation`) are added to forbid any parameters in `generics`, any bounds in `bounds`, and any predicates in `where_clause`, as well as the presence of a type expression (`= u8`).

  (Work still remains to fuse this with free `type` aliases, but this can be done later.)

- The grammar of constants and static items (free, associated, and extern) now permits the absence of an expression, and becomes:

  ```rust
  GlobalItem = {"const" {ident | "_"} | "static" "mut"? ident} {"=" expr}? ";" ;
  ```

  - A semantic restriction is added to enforce the presence of the expression (the body).
  - A semantic restriction is added to reject `const _` in associated contexts.

Together, these changes allow us to fuse the grammar of associated items and extern items up to `default`ness which is the main goal of the PR.

-----------------------

We are now very close to fully fusing the entirely of item parsing and their ASTs. To progress further, we must make a decision: should we parse e.g. `default use foo::bar;` and whatnot? Accepting that is likely easiest from a parsing perspective, as it does not require using look-ahead, but it is perhaps not too onerous to only accept it for `fn`s (and all their various qualifiers), `const`s, `static`s, and `type`s.

r? @petrochenkov

4 years agoRollup merge of #69159 - estebank:use-appropriate-lt-name, r=ecstatic-morse
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:24 +0000 (22:16 +0100)]
Rollup merge of #69159 - estebank:use-appropriate-lt-name, r=ecstatic-morse

Select an appropriate unused lifetime name in suggestion

Follow up to #69048.

4 years agoRollup merge of #69146 - matthewjasper:literal-qualif, r=eddyb
Mazdak Farrokhzad [Tue, 18 Feb 2020 21:16:23 +0000 (22:16 +0100)]
Rollup merge of #69146 - matthewjasper:literal-qualif, r=eddyb

Always const qualify literals by type

r? @eddyb

4 years agoAuto merge of #69262 - Dylan-DPC:rollup-m6dt9cn, r=Dylan-DPC
bors [Tue, 18 Feb 2020 17:51:29 +0000 (17:51 +0000)]
Auto merge of #69262 - Dylan-DPC:rollup-m6dt9cn, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #69181 (Change const eval to just return the value )
 - #69192 (Add more regression tests)
 - #69200 (Fix printing of `Yield` terminator)
 - #69205 (Allow whitespaces in revision flags)
 - #69233 (Clean up E0310 explanation)

Failed merges:

r? @ghost

4 years agoUpdate cargo
Eric Huss [Tue, 18 Feb 2020 17:21:34 +0000 (09:21 -0800)]
Update cargo

4 years agoRollup merge of #69233 - GuillaumeGomez:cleanup-e0310, r=Dylan-DPC
Dylan DPC [Tue, 18 Feb 2020 15:07:29 +0000 (16:07 +0100)]
Rollup merge of #69233 - GuillaumeGomez:cleanup-e0310, r=Dylan-DPC

Clean up E0310 explanation

r? @Dylan-DPC

4 years agoRollup merge of #69205 - JohnTitor:allow-whitespaces, r=Mark-Simulacrum
Dylan DPC [Tue, 18 Feb 2020 15:07:27 +0000 (16:07 +0100)]
Rollup merge of #69205 - JohnTitor:allow-whitespaces, r=Mark-Simulacrum

Allow whitespaces in revision flags

Allow whitespaces in revision flags, like `// [foo]`.

Fixes #69183

4 years agoRollup merge of #69200 - jonas-schievink:yield-print, r=eddyb,Zoxc
Dylan DPC [Tue, 18 Feb 2020 15:07:25 +0000 (16:07 +0100)]
Rollup merge of #69200 - jonas-schievink:yield-print, r=eddyb,Zoxc

Fix printing of `Yield` terminator

Addresses the bug found in https://github.com/rust-lang/rust/issues/69039#issuecomment-586633495

4 years agoRollup merge of #69192 - JohnTitor:add-tests, r=Centril
Dylan DPC [Tue, 18 Feb 2020 15:07:24 +0000 (16:07 +0100)]
Rollup merge of #69192 - JohnTitor:add-tests, r=Centril

Add more regression tests

Closes #39618
Closes #51798
Closes #62894
Closes #63952
Closes #68653

r? @Centril

4 years agoRollup merge of #69181 - skinny121:const-eval-return, r=oli-obk
Dylan DPC [Tue, 18 Feb 2020 15:07:22 +0000 (16:07 +0100)]
Rollup merge of #69181 - skinny121:const-eval-return, r=oli-obk

Change const eval to just return the value

As discussed in https://github.com/rust-lang/rust/pull/68505#discussion_r370956535, the type of consts shouldn't be returned from const eval queries.

r? @eddyb
cc @nikomatsakis

4 years agoAuto merge of #69234 - JohnTitor:clippy-up, r=JohnTitor
bors [Tue, 18 Feb 2020 14:49:28 +0000 (14:49 +0000)]
Auto merge of #69234 - JohnTitor:clippy-up, r=JohnTitor

Update Clippy

Fixes #69221

r? @ghost

4 years agoClean up E0310 explanation
Guillaume Gomez [Mon, 17 Feb 2020 13:16:45 +0000 (14:16 +0100)]
Clean up E0310 explanation

4 years agoAuto merge of #69258 - JohnTitor:rollup-n2hljai, r=JohnTitor
bors [Tue, 18 Feb 2020 11:10:51 +0000 (11:10 +0000)]
Auto merge of #69258 - JohnTitor:rollup-n2hljai, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #67272 (recursion_limit parsing handles overflows)
 - #68597 (Simplify `Skip::nth` and `Skip::last` implementations)
 - #68767 (macOS: avoid calling pthread_self() twice)
 - #69175 (Do not ICE when encountering `yield` inside `async` block)
 - #69223 (Ignore GDB versions with broken str printing.)
 - #69244 (configure: set LLVM flags with a value)
 - #69249 (Stabilize {f32, f64}::{LOG2_10, LOG10_2})
 - #69252 (Clean out unused directories for extra disk space)

Failed merges:

r? @ghost

4 years agoRollup merge of #69252 - Mark-Simulacrum:disk-try, r=pietroalbini
Yuki Okushi [Tue, 18 Feb 2020 11:09:11 +0000 (20:09 +0900)]
Rollup merge of #69252 - Mark-Simulacrum:disk-try, r=pietroalbini

Clean out unused directories for extra disk space

This cleans out some of the unused (but large) directories on our linux builders to hopefully allow them to complete without running out of disk space.

4 years agoRollup merge of #69249 - LeSeulArtichaut:stabilize-logs-consts, r=sfackler
Yuki Okushi [Tue, 18 Feb 2020 11:09:09 +0000 (20:09 +0900)]
Rollup merge of #69249 - LeSeulArtichaut:stabilize-logs-consts, r=sfackler

Stabilize {f32, f64}::{LOG2_10, LOG10_2}

Following the decision to stabilize `LOG2_10` and `LOG10_2` in https://github.com/rust-lang/rust/issues/50540#issuecomment-536627588.

Closes #50540.
r? @sfackler

4 years agoRollup merge of #69244 - cuviper:llvm-flags, r=Mark-Simulacrum
Yuki Okushi [Tue, 18 Feb 2020 11:09:08 +0000 (20:09 +0900)]
Rollup merge of #69244 - cuviper:llvm-flags, r=Mark-Simulacrum

configure: set LLVM flags with a value

Rather than a boolean `--enable-cflags` etc., these options should
reflect that they are for LLVM, and that they need a value. You would
now use `./configure --llvm-cflags="..."`.

4 years agoRollup merge of #69223 - spunit262:empty-string-gdb-version, r=Dylan-DPC
Yuki Okushi [Tue, 18 Feb 2020 11:09:06 +0000 (20:09 +0900)]
Rollup merge of #69223 - spunit262:empty-string-gdb-version, r=Dylan-DPC

Ignore GDB versions with broken str printing.

https://sourceware.org/bugzilla/show_bug.cgi?id=22236

4 years agoRollup merge of #69175 - estebank:shall-not-ice, r=petrochenkov
Yuki Okushi [Tue, 18 Feb 2020 11:09:05 +0000 (20:09 +0900)]
Rollup merge of #69175 - estebank:shall-not-ice, r=petrochenkov

Do not ICE when encountering `yield` inside `async` block

Fix #67158.

4 years agoRollup merge of #68767 - kubo39:patch-macos, r=shepmaster
Yuki Okushi [Tue, 18 Feb 2020 11:09:04 +0000 (20:09 +0900)]
Rollup merge of #68767 - kubo39:patch-macos, r=shepmaster

macOS: avoid calling pthread_self() twice

4 years agoRollup merge of #68597 - ollie27:skip_nth_last, r=Amanieu
Yuki Okushi [Tue, 18 Feb 2020 11:09:02 +0000 (20:09 +0900)]
Rollup merge of #68597 - ollie27:skip_nth_last, r=Amanieu

Simplify `Skip::nth` and `Skip::last` implementations

The main improvement is to make `last` no longer recursive.

4 years agoRollup merge of #67272 - fisherdarling:master, r=varkor,hellow554
Yuki Okushi [Tue, 18 Feb 2020 11:08:59 +0000 (20:08 +0900)]
Rollup merge of #67272 - fisherdarling:master, r=varkor,hellow554

recursion_limit parsing handles overflows

This PR adds overflow handling to `#![recursion_limit]` attribute parsing. If parsing the given value results in an `IntErrorKind::Overflow`, then the recursion_limit is set to `usize::max_value()`.

closes #67265

4 years agoClean out some default-installed directories
Mark Rousskov [Tue, 18 Feb 2020 00:39:38 +0000 (19:39 -0500)]
Clean out some default-installed directories

This helps us have enough disk space for our builders to be able to complete
successfully. For now, the choices are ad-hoc and 'definitely not needed'. This
should never fail the build, as everything our build needs should be inside
Docker.

4 years agoFix typo
Jonas Schievink [Mon, 17 Feb 2020 23:00:06 +0000 (00:00 +0100)]
Fix typo

4 years agoFix typo in comment
Dylan MacKenzie [Mon, 17 Feb 2020 21:43:13 +0000 (13:43 -0800)]
Fix typo in comment

4 years agoUse doc comment for explanation of `shared_borrow_allows_mutation`
Dylan MacKenzie [Mon, 17 Feb 2020 21:39:50 +0000 (13:39 -0800)]
Use doc comment for explanation of `shared_borrow_allows_mutation`

4 years agoDon't eliminate frame pointers on thumb targets
Jonas Schievink [Mon, 17 Feb 2020 20:44:32 +0000 (21:44 +0100)]
Don't eliminate frame pointers on thumb targets

4 years agoAdd a test for proc macro generating `$ IDENT`
Vadim Petrochenkov [Mon, 17 Feb 2020 19:47:40 +0000 (22:47 +0300)]
Add a test for proc macro generating `$ IDENT`

4 years agoparser: Remove `Option`s from unnormalized tokens
Vadim Petrochenkov [Sun, 16 Feb 2020 20:19:51 +0000 (23:19 +0300)]
parser: Remove `Option`s from unnormalized tokens

They are always set synchronously with normalized tokens now

4 years agoparser: Set previous and unnormalized tokens in couple more places
Vadim Petrochenkov [Sun, 16 Feb 2020 18:36:50 +0000 (21:36 +0300)]
parser: Set previous and unnormalized tokens in couple more places

4 years agoparser: Do not call `bump` recursively
Vadim Petrochenkov [Sun, 16 Feb 2020 13:47:24 +0000 (16:47 +0300)]
parser: Do not call `bump` recursively

Token normalization is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.

4 years agoconfigure: set LLVM flags with a value
Josh Stone [Mon, 17 Feb 2020 19:01:52 +0000 (11:01 -0800)]
configure: set LLVM flags with a value

Rather than a boolean `--enable-cflags` etc., these options should
reflect that they are for LLVM, and that they need a value. You would
now use `./configure --llvm-cflags="..."`.

4 years agoparse: recover `mut (x @ y)` as `(mut x @ mut y)`.
Mazdak Farrokhzad [Mon, 17 Feb 2020 15:03:07 +0000 (16:03 +0100)]
parse: recover `mut (x @ y)` as `(mut x @ mut y)`.

4 years agoDo not emit note suggesting to implement trait to foreign type
LeSeulArtichaut [Sun, 16 Feb 2020 20:42:37 +0000 (21:42 +0100)]
Do not emit note suggesting to implement trait to foreign type

Update tests

Extend to other operations

Refractor check in a separate function

Fix more tests

4 years agoUpdate Clippy
Yuki Okushi [Mon, 17 Feb 2020 04:28:03 +0000 (13:28 +0900)]
Update Clippy

4 years agoAuto merge of #69129 - Centril:macro-legacy-errors, r=petrochenkov
bors [Mon, 17 Feb 2020 11:54:49 +0000 (11:54 +0000)]
Auto merge of #69129 - Centril:macro-legacy-errors, r=petrochenkov

Transition macro_legacy_warnings into a hard error

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

r? @petrochenkov

4 years agoci: switch macOS builders to 10.15
Pietro Albini [Wed, 5 Feb 2020 14:47:01 +0000 (15:47 +0100)]
ci: switch macOS builders to 10.15

4 years agoast: add a FIXME
Mazdak Farrokhzad [Mon, 17 Feb 2020 10:16:28 +0000 (11:16 +0100)]
ast: add a FIXME

4 years agoAuto merge of #69226 - JohnTitor:rollup-syn03oj, r=JohnTitor
bors [Mon, 17 Feb 2020 06:44:35 +0000 (06:44 +0000)]
Auto merge of #69226 - JohnTitor:rollup-syn03oj, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #68495 (Updating str.chars docs to mention crates.io.)
 - #68701 (Improve #Safety of various methods in core::ptr)
 - #69158 (Don't print block exit state in dataflow graphviz if unchanged)
 - #69179 (Rename `FunctionRetTy` to `FnRetTy`)
 - #69186 ([tiny] parser: `macro_rules` is a weak keyword)
 - #69188 (Clean up E0309 explanation)

Failed merges:

r? @ghost

4 years agoRollup merge of #69188 - GuillaumeGomez:clean-up-e0309, r=Dylan-DPC
Yuki Okushi [Mon, 17 Feb 2020 04:46:59 +0000 (13:46 +0900)]
Rollup merge of #69188 - GuillaumeGomez:clean-up-e0309, r=Dylan-DPC

Clean up E0309 explanation

r? @Dylan-DPC

4 years agoRollup merge of #69186 - petrochenkov:kwrules, r=Centril
Yuki Okushi [Mon, 17 Feb 2020 04:46:57 +0000 (13:46 +0900)]
Rollup merge of #69186 - petrochenkov:kwrules, r=Centril

[tiny] parser: `macro_rules` is a weak keyword

r? @Centril

4 years agoRollup merge of #69179 - JohnTitor:rename-to-fnretty, r=Centril
Yuki Okushi [Mon, 17 Feb 2020 04:46:56 +0000 (13:46 +0900)]
Rollup merge of #69179 - JohnTitor:rename-to-fnretty, r=Centril

Rename `FunctionRetTy` to `FnRetTy`

As per FIXME comment

r? @Centril

4 years agoRollup merge of #69158 - ecstatic-morse:graphviz-diff, r=matthewjasper
Yuki Okushi [Mon, 17 Feb 2020 04:46:54 +0000 (13:46 +0900)]
Rollup merge of #69158 - ecstatic-morse:graphviz-diff, r=matthewjasper

Don't print block exit state in dataflow graphviz if unchanged

A small quality-of-life improvement I was using while working on #68528. It's pretty common to have a lot of zero-statement basic blocks, especially before a `SimplifyCfg` pass is run. When the dataflow state was dense, these blocks could take up a lot of vertical space since the full flow state was printed on both entry and exit. After this PR, we only print a block's exit state if it differs from that block's entry state. Take a look at the two basic blocks on the left.

Before:

![image](https://user-images.githubusercontent.com/29463364/74505395-e2d1dd00-4eab-11ea-8006-ec8f0dc9d1b6.png)

After:
![image](https://user-images.githubusercontent.com/29463364/74505277-98506080-4eab-11ea-8d95-5190bc378331.png)

4 years agoRollup merge of #68701 - amosonn:patch-2, r=RalfJung
Yuki Okushi [Mon, 17 Feb 2020 04:46:52 +0000 (13:46 +0900)]
Rollup merge of #68701 - amosonn:patch-2, r=RalfJung

Improve #Safety of various methods in core::ptr

For `read`, `read_unaligned`,`read_volatile`, `replace`, and `drop_in_place`:

- The value they point to must be properly initialized

For `replace`, additionally:

- The pointer must be readable

4 years agoRollup merge of #68495 - sdegutis:patch-1, r=Mark-Simulacrum
Yuki Okushi [Mon, 17 Feb 2020 04:46:48 +0000 (13:46 +0900)]
Rollup merge of #68495 - sdegutis:patch-1, r=Mark-Simulacrum

Updating str.chars docs to mention crates.io.

This might spare someone else a little time searching the stdlib for unicode/grapheme support.

4 years agoAuto merge of #68781 - ssomers:btree_miri_relief, r=RalfJung
bors [Mon, 17 Feb 2020 03:24:53 +0000 (03:24 +0000)]
Auto merge of #68781 - ssomers:btree_miri_relief, r=RalfJung

BTree: lighten the load on Miri

Reduce the amount of work Miri ploughs through in btree code, in particular on `test_clone_from` (which takes up 5 minutes on my machine).

r? @crgl

4 years agoDo not ICE when encountering `yield` inside `async` block
Esteban Küber [Sat, 15 Feb 2020 01:49:16 +0000 (17:49 -0800)]
Do not ICE when encountering `yield` inside `async` block

4 years agoSelect an appropriate unused lifetime name in suggestion
Esteban Küber [Fri, 14 Feb 2020 06:45:48 +0000 (22:45 -0800)]
Select an appropriate unused lifetime name in suggestion

4 years agoRename `FunctionRetTy` to `FnRetTy`
Yuki Okushi [Sat, 15 Feb 2020 03:10:59 +0000 (12:10 +0900)]
Rename `FunctionRetTy` to `FnRetTy`

4 years agoHandle recursion_limit parsing errors
Fisher Darling [Fri, 13 Dec 2019 04:18:21 +0000 (21:18 -0700)]
Handle recursion_limit parsing errors

4 years agoIgnore GDB versions with broken str printing.
spunit262 [Fri, 14 Feb 2020 06:51:47 +0000 (23:51 -0700)]
Ignore GDB versions with broken str printing.

https://sourceware.org/bugzilla/show_bug.cgi?id=22236

4 years agoAuto merge of #67953 - cjgillot:split_infer, r=Zoxc
bors [Sun, 16 Feb 2020 22:24:54 +0000 (22:24 +0000)]
Auto merge of #67953 - cjgillot:split_infer, r=Zoxc

Split librustc::{traits,infer} to a separate crate rustc_infer

This is still very much work in progress.
Three functions are between dimensions (at the end of `rustc::traits`), waiting for some dependency breaking scheme.
Please tell me if the approach seems sound, and how you would like to split this PR up.

The formatting is deliberately off, to ease rebasing.

cc #65031

4 years agoLighten tests, in particular for Miri, yet test and explain more
Stein Somers [Sun, 16 Feb 2020 19:01:41 +0000 (20:01 +0100)]
Lighten tests, in particular for Miri, yet test and explain more

4 years agoFix comments outdated during #66648
Stein Somers [Sun, 2 Feb 2020 19:30:52 +0000 (20:30 +0100)]
Fix comments outdated during #66648

4 years agoStabilize {f32, f64}::{LOG2_10, LOG10_2}
LeSeulArtichaut [Sun, 16 Feb 2020 17:53:02 +0000 (18:53 +0100)]
Stabilize {f32, f64}::{LOG2_10, LOG10_2}

4 years agoAuto merge of #67885 - tobithiel:fix_group_lint_allow_override, r=Mark-Simulacrum
bors [Sun, 16 Feb 2020 15:28:41 +0000 (15:28 +0000)]
Auto merge of #67885 - tobithiel:fix_group_lint_allow_override, r=Mark-Simulacrum

rustc_session: allow overriding lint level of individual lints from a group

Fixes #58211 and fixes rust-lang/rust-clippy#4778 and fixes rust-lang/rust-clippy#4091

Instead of hard-coding the lint level preferences (from lowest to highest precedence: `lint::Allow -> lint::Warn -> lint::Deny -> lint::Forbid`), the position of the argument in the command line gets taken into account.

Examples:
1. Passing `-D unused -A unused-variables` denies everything in the lint group `unused` **except** `unused-variables` which is explicitly allowed.
1. Passing `-A unused-variables -D unused` denies everything in the lint group `unused` **including** `unused-variables` since the allow is specified before the deny (and therefore overridden by the deny).

This matches the behavior that is already being used when specifying `allow`/`deny` in the source code.

4 years agoAllow whitespaces in revision flags
Yuki Okushi [Sun, 16 Feb 2020 08:12:03 +0000 (17:12 +0900)]
Allow whitespaces in revision flags

4 years agoAuto merge of #68997 - Zoxc:pure-node-id, r=petrochenkov
bors [Sun, 16 Feb 2020 12:16:49 +0000 (12:16 +0000)]
Auto merge of #68997 - Zoxc:pure-node-id, r=petrochenkov

Panic if NodeIds are used for incremental compilation

r? @michaelwoerister

4 years agoImprove #Safety of core::ptr::drop_in_place
Amos Onn [Fri, 14 Feb 2020 23:34:15 +0000 (00:34 +0100)]
Improve #Safety of core::ptr::drop_in_place

Added missing conditions:
- Valid for writes
- Valid for destructing

4 years agosuspend -> yield
Jonas Schievink [Sun, 16 Feb 2020 12:08:36 +0000 (13:08 +0100)]
suspend -> yield

4 years agoPrune rustc dependencies.
Camille GILLOT [Fri, 7 Feb 2020 08:06:08 +0000 (09:06 +0100)]
Prune rustc dependencies.

4 years agoGate macro use.
Camille GILLOT [Wed, 8 Jan 2020 09:18:48 +0000 (10:18 +0100)]
Gate macro use.

4 years agoPrune features.
Camille GILLOT [Wed, 8 Jan 2020 08:31:01 +0000 (09:31 +0100)]
Prune features.

4 years agoRemove librustc_infer crate re-exports.
Camille GILLOT [Tue, 7 Jan 2020 21:07:22 +0000 (22:07 +0100)]
Remove librustc_infer crate re-exports.

4 years agoOther crates.
Camille GILLOT [Mon, 6 Jan 2020 22:31:06 +0000 (23:31 +0100)]
Other crates.

4 years agoMake librustc_traits compile.
Camille GILLOT [Mon, 6 Jan 2020 22:28:45 +0000 (23:28 +0100)]
Make librustc_traits compile.

4 years agoMake librustc_mir compile.
Camille GILLOT [Mon, 6 Jan 2020 22:21:41 +0000 (23:21 +0100)]
Make librustc_mir compile.

4 years agomacOS: avoid calling pthread_self() twice
Hiroki Noda [Sun, 2 Feb 2020 12:25:38 +0000 (21:25 +0900)]
macOS: avoid calling pthread_self() twice

4 years agoMake librustc_typeck compile.
Camille GILLOT [Mon, 6 Jan 2020 22:12:31 +0000 (23:12 +0100)]
Make librustc_typeck compile.

4 years agoMake librustc_infer compile.
Camille GILLOT [Mon, 6 Jan 2020 19:13:24 +0000 (20:13 +0100)]
Make librustc_infer compile.

4 years agoMake librustc compile.
Camille GILLOT [Mon, 6 Jan 2020 19:13:24 +0000 (20:13 +0100)]
Make librustc compile.

4 years agoMove librustc/{traits,infer} to librustc_infer.
Camille GILLOT [Mon, 6 Jan 2020 19:13:24 +0000 (20:13 +0100)]
Move librustc/{traits,infer} to librustc_infer.

4 years agoAuto merge of #69156 - ecstatic-morse:unified-dataflow-impls2, r=eddyb
bors [Sun, 16 Feb 2020 05:08:08 +0000 (05:08 +0000)]
Auto merge of #69156 - ecstatic-morse:unified-dataflow-impls2, r=eddyb

Use `ResultsCursor` for `elaborate_drops`

Some cleanup after #68241. The old code was using a custom cursor-like struct called `InitializationData`.

4 years agoAuto merge of #68814 - Aaron1011:fix/proc-macro-order-two, r=petrochenkov
bors [Sun, 16 Feb 2020 01:46:05 +0000 (01:46 +0000)]
Auto merge of #68814 - Aaron1011:fix/proc-macro-order-two, r=petrochenkov

Record proc macro harness order for use during metadata deserialization

Fixes #68690

When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.

4 years agoFix printing of `Yield` terminator
Jonas Schievink [Sat, 15 Feb 2020 23:57:48 +0000 (00:57 +0100)]
Fix printing of `Yield` terminator

4 years agoFix running rustdoc-js test suite individually
Oliver Middleton [Sat, 15 Feb 2020 23:14:46 +0000 (23:14 +0000)]
Fix running rustdoc-js test suite individually

Without `Compiletest.path` set running `x.py test src/test/rustdoc-js` would run the `rustdoc-js` test suite with everything filtered out.

As this was the only place setting `Compiletest.path` to `None` this removes the `Option` wrapper as well.

4 years agoDetermine type of intrinsics instead of assuming the destination type is the same.
Ben Lewis [Sat, 15 Feb 2020 22:39:04 +0000 (11:39 +1300)]
Determine type of intrinsics instead of assuming the destination type is the same.

4 years agoAuto merge of #68668 - GuillaumeGomez:struct-variant-field-search, r=ollie27
bors [Sat, 15 Feb 2020 22:32:51 +0000 (22:32 +0000)]
Auto merge of #68668 - GuillaumeGomez:struct-variant-field-search, r=ollie27

Struct variant field search

Fixes #16017.

Reopening of #64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison

4 years agoast: tweak AssocItemKind::Macro comment
Mazdak Farrokhzad [Sat, 15 Feb 2020 21:36:03 +0000 (22:36 +0100)]
ast: tweak AssocItemKind::Macro comment