]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agolet_chains: Add tests for places where let expressions aren't allowed.
Mazdak Farrokhzad [Sat, 11 May 2019 13:06:36 +0000 (15:06 +0200)]
let_chains: Add tests for places where let expressions aren't allowed.

5 years agolet_chains: Add feature gate.
Mazdak Farrokhzad [Sat, 11 May 2019 13:11:04 +0000 (15:11 +0200)]
let_chains: Add feature gate.

5 years agolet_chains: Adjust lowering logic in lieu of ::Let.
Mazdak Farrokhzad [Wed, 15 May 2019 14:05:05 +0000 (16:05 +0200)]
let_chains: Adjust lowering logic in lieu of ::Let.

5 years agolet_chains: Handle disallowing of let chains in places lowering won't support.
Mazdak Farrokhzad [Wed, 15 May 2019 14:02:51 +0000 (16:02 +0200)]
let_chains: Handle disallowing of let chains in places lowering won't support.

5 years agolet_chains: Handle in unused parenthesis lint.
Mazdak Farrokhzad [Wed, 15 May 2019 14:03:43 +0000 (16:03 +0200)]
let_chains: Handle in unused parenthesis lint.

5 years agolet_chains: Handle in resolve.
Mazdak Farrokhzad [Wed, 15 May 2019 14:05:39 +0000 (16:05 +0200)]
let_chains: Handle in resolve.

5 years agolet_chains: Add support for parsing let expressions.
Mazdak Farrokhzad [Wed, 15 May 2019 14:03:22 +0000 (16:03 +0200)]
let_chains: Add support for parsing let expressions.

5 years agolet_chains: Handle it in AST pretty printing.
Mazdak Farrokhzad [Wed, 15 May 2019 14:05:58 +0000 (16:05 +0200)]
let_chains: Handle it in AST pretty printing.

5 years agolet_chains: Remove ast::ExprKind::{IfLet, WhileLet} from visitors and introduce ...
Mazdak Farrokhzad [Wed, 15 May 2019 14:06:58 +0000 (16:06 +0200)]
let_chains: Remove ast::ExprKind::{IfLet, WhileLet} from visitors and introduce ::Let.

5 years agolet_chains: Remove ast::ExprKind::{IfLet, WhileLet} and introduce ::Let.
Mazdak Farrokhzad [Wed, 15 May 2019 14:04:12 +0000 (16:04 +0200)]
let_chains: Remove ast::ExprKind::{IfLet, WhileLet} and introduce ::Let.

5 years agoAuto merge of #61874 - jonas-schievink:remove-rem-output-default, r=Centril
bors [Sat, 22 Jun 2019 17:59:05 +0000 (17:59 +0000)]
Auto merge of #61874 - jonas-schievink:remove-rem-output-default, r=Centril

Remove the default type of `Rem::Output`

Associated type defaults are not yet stable, and `Rem` is the only trait that specifies a default. Let's see what breaks when it's removed.

cc https://github.com/rust-lang/rust/pull/61812#issuecomment-502394566
cc @Centril

@bors try

5 years agoAuto merge of #61020 - HeroicKatora:master, r=matthewjasper
bors [Sat, 22 Jun 2019 15:12:15 +0000 (15:12 +0000)]
Auto merge of #61020 - HeroicKatora:master, r=matthewjasper

librustc_data_structures: Speedup union of sparse and dense hybrid set

This optimization speeds up the union of a hybrid bitset when that
switches it from a sparse representation to a dense bitset. It now
clones the dense bitset and integrate only the spare elements instead of
densifying the sparse bitset, initializing all elements, and then a
union on two dense bitset, touching all words a second time.

It's not completely certain if the added complexity is worth it but I would
like to hear some feedback in any case. Benchmark results from my machine:

```
Now:  bit_set::union_hybrid_sparse_to_dense ... bench:          72 ns/iter (+/- 5)
Previous: bit_set::union_hybrid_sparse_to_dense ... bench:          90 ns/iter (+/- 6)
```

This being the second iteration of trying to improve the speed, since I missed the return value in the first, and forgot to run the relevant tests. Oops.

5 years agoAuto merge of #62024 - RalfJung:miri, r=oli-obk
bors [Sat, 22 Jun 2019 10:31:43 +0000 (10:31 +0000)]
Auto merge of #62024 - RalfJung:miri, r=oli-obk

update miri

r? @oli-obk

5 years agoupdate miri
Ralf Jung [Sat, 22 Jun 2019 10:30:05 +0000 (12:30 +0200)]
update miri

5 years agoAuto merge of #62010 - ecstatic-morse:kill-borrows-of-proj, r=pnkfelix
bors [Sat, 22 Jun 2019 05:12:11 +0000 (05:12 +0000)]
Auto merge of #62010 - ecstatic-morse:kill-borrows-of-proj, r=pnkfelix

Kill conflicting borrows of places with projections.

Resolves #62007.

Due to a bug, the previous version of this check did not actually kill all conflicting borrows unless the borrowed place had no projections. Specifically, `sets.on_entry` will always be empty when `statement_effect` is called. It does not contain the set of borrows which are live at this point in the program.

@pnkfelix describes why this was not caught before in #62007, and created an example where the current borrow checker failed unnecessarily. This PR adds their example as a test, but they will likely want to add some additional ones.

r? @pnkfelix

5 years agoAuto merge of #62041 - Centril:rollup-95eeyx7, r=Centril
bors [Sat, 22 Jun 2019 02:16:53 +0000 (02:16 +0000)]
Auto merge of #62041 - Centril:rollup-95eeyx7, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #60971 (Add DocFS layer to rustdoc)
 - #61146 (SliceConcatExt::connect defaults to calling join)
 - #61181 (Fix theme-checker failure)
 - #61267 (rustc-book: Update the rustc/clang compatibility table for xLTO.)
 - #61270 (Remove warnings about incr. comp. generating less debugging output.)
 - #61681 (Changed the error message to more clearly explain what is allowed)
 - #61984 (More NodeId pruning)
 - #62016 (Add test for issue-27697)
 - #62019 (Remove needless lifetimes)

Failed merges:

r? @ghost

5 years agoRollup merge of #62019 - jeremystucki:refactoring, r=estebank
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:41 +0000 (01:42 +0200)]
Rollup merge of #62019 - jeremystucki:refactoring, r=estebank

Remove needless lifetimes

5 years agoRollup merge of #62016 - JohnTitor:add-test-for-issue-27697, r=alexcrichton
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:40 +0000 (01:42 +0200)]
Rollup merge of #62016 - JohnTitor:add-test-for-issue-27697, r=alexcrichton

Add test for issue-27697

Closes #27697

5 years agoRollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:38 +0000 (01:42 +0200)]
Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc

More NodeId pruning

Just another round of the `HirId`ification initiative.

r? @Zoxc

5 years agoRollup merge of #61681 - asfreitas:addSendTrait, r=estebank
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:37 +0000 (01:42 +0200)]
Rollup merge of #61681 - asfreitas:addSendTrait, r=estebank

Changed the error message to more clearly explain what is allowed

This is in regard to #61634. I changed the language to make it more clear what is allowed.

5 years agoRollup merge of #61270 - michaelwoerister:remove-incr-comp-warning, r=oli-obk
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:35 +0000 (01:42 +0200)]
Rollup merge of #61270 - michaelwoerister:remove-incr-comp-warning, r=oli-obk

Remove warnings about incr. comp. generating less debugging output.

This PR removes the

> `-C save-temps` might not produce all requested temporary products when incremental compilation is enabled.`

warning and others similar to it.

I think these warnings have annoyed lots of people over the past ~3 years; while not helping a single one of them `:P`

r? @oli-obk

5 years agoRollup merge of #61267 - michaelwoerister:update-xlto-table, r=alexcrichton
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:33 +0000 (01:42 +0200)]
Rollup merge of #61267 - michaelwoerister:update-xlto-table, r=alexcrichton

rustc-book: Update the rustc/clang compatibility table for xLTO.

Firefox is using these combinations successfully.

5 years agoRollup merge of #61181 - GuillaumeGomez:fix-theme-checker, r=kinnison
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:31 +0000 (01:42 +0200)]
Rollup merge of #61181 - GuillaumeGomez:fix-theme-checker, r=kinnison

Fix theme-checker failure

Fixes #61145.

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

r? @QuietMisdreavus

5 years agoRollup merge of #61146 - czipperz:SliceConcatExt-connect-default-to-join, r=sfackler
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:30 +0000 (01:42 +0200)]
Rollup merge of #61146 - czipperz:SliceConcatExt-connect-default-to-join, r=sfackler

SliceConcatExt::connect defaults to calling join

It makes sense to default a deprecated method to the new one.  Precedence example is `Error::cause` defaults to calling `Error::source`.

5 years agoRollup merge of #60971 - rbtcollins:docs-perf, r=rbtcollins,GuillaumeGomez
Mazdak Farrokhzad [Fri, 21 Jun 2019 23:42:28 +0000 (01:42 +0200)]
Rollup merge of #60971 - rbtcollins:docs-perf, r=rbtcollins,GuillaumeGomez

Add DocFS layer to rustdoc

* Move fs::create_dir_all calls into DocFS to provide a clean
  extension point if async extension there is needed.
* Convert callsites of create_dir_all to ensure_dir to reduce syscalls.
* Convert fs::write usage to DocFS.write
  (which also removes a lot of try_err! usage for easier reading)
* Convert File::create calls to use Vec buffers and then DocFS.write
  in order to both consistently reduce syscalls as well as make
  deferring to threads cleaner.
* Convert OpenOptions usage similarly - I could find no discussion on
  the use of create_new for that one output file vs all the other
  files render creates, if link redirection attacks are a concern
  DocFS will provide a good central point to introduce systematic
  create_new usage.
* DocFS::write defers to rayon for IO on Windows producing a modest
  speedup: before this patch on my development workstation:

$ time cargo +mystg1 doc -p winapi:0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 6m 11s

real    6m11.734s
user    0m0.015s
sys     0m0.000s

Afterwards:
$ time cargo +mystg1 doc -p winapi:0.3.7
   Compiling winapi v0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 49.53s

real    0m49.643s
user    0m0.000s
sys     0m0.015s

I haven't measured how much time is in the compilation logic vs in the
IO and outputting etc, but this takes it from frustating to tolerable
for me, at least for now.

5 years agoAuto merge of #62018 - Zoxc:vs2019, r=alexcrichton
bors [Fri, 21 Jun 2019 23:28:13 +0000 (23:28 +0000)]
Auto merge of #62018 - Zoxc:vs2019, r=alexcrichton

Update LLVM to fix VS 2019 compilation

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

r? @alexcrichton

5 years agoAuto merge of #62027 - lzutao:clippy-update, r=oli-obk
bors [Fri, 21 Jun 2019 16:26:14 +0000 (16:26 +0000)]
Auto merge of #62027 - lzutao:clippy-update, r=oli-obk

submodules: Update clippy from 149a988 to 5a11ed7b

r? @oli-obk

5 years agoadding in these files that didn't get added in previous commit
Andrew [Fri, 21 Jun 2019 16:12:28 +0000 (00:12 +0800)]
adding in these files that didn't get added in previous commit

5 years agochanged expected output in tests so it now passes with changed output
Andrew [Fri, 21 Jun 2019 14:12:07 +0000 (22:12 +0800)]
changed expected output in tests so it now passes with changed output

5 years agosubmodules: Update clippy from 149a988 to 5a11ed7b
Lzu Tao [Fri, 21 Jun 2019 11:54:50 +0000 (11:54 +0000)]
submodules: Update clippy from 149a988 to 5a11ed7b

5 years agoAdd test checking our behavior for assigning over a `ConstIndex` projection.
Felix S. Klock II [Fri, 21 Jun 2019 11:08:15 +0000 (13:08 +0200)]
Add test checking our behavior for assigning over a `ConstIndex` projection.

5 years agoAdd test that our handling of projections hasn't gone too far:
Felix S. Klock II [Fri, 21 Jun 2019 10:50:18 +0000 (12:50 +0200)]
Add test that our handling of projections hasn't gone too far:
overwriting one field should not allow reborrow of an unrelated field.

5 years agoAdded test for deref projection.
Felix S. Klock II [Fri, 21 Jun 2019 10:43:04 +0000 (12:43 +0200)]
Added test for deref projection.

5 years agoadd comment outlining test.
Felix S. Klock II [Fri, 21 Jun 2019 10:38:12 +0000 (12:38 +0200)]
add comment outlining test.

5 years agorename file because I found the old filename too long and unwieldy.
Felix S. Klock II [Fri, 21 Jun 2019 10:39:11 +0000 (12:39 +0200)]
rename file because I found the old filename too long and unwieldy.

5 years agoAuto merge of #61959 - oli-obk:const_field_ice, r=eddyb
bors [Fri, 21 Jun 2019 10:16:14 +0000 (10:16 +0000)]
Auto merge of #61959 - oli-obk:const_field_ice, r=eddyb

Fix a hash collision issue on the `const_field` query

fixes #61530

5 years agoBetter handling of the sender channel part in rustdoc file writing
Guillaume Gomez [Thu, 20 Jun 2019 22:26:13 +0000 (00:26 +0200)]
Better handling of the sender channel part in rustdoc file writing

5 years agoHandle fs errors through errors::Handler instead of eprintln and panic
Guillaume Gomez [Sun, 26 May 2019 12:54:50 +0000 (14:54 +0200)]
Handle fs errors through errors::Handler instead of eprintln and panic

5 years agoAdd DocFS layer to rustdoc
Robert Collins [Mon, 20 May 2019 02:04:04 +0000 (14:04 +1200)]
Add DocFS layer to rustdoc

* Move fs::create_dir_all calls into DocFS to provide a clean
  extension point if async extension there is needed.
* Convert callsites of create_dir_all to ensure_dir to reduce syscalls.
* Convert fs::write usage to DocFS.write
  (which also removes a lot of try_err! usage for easier reading)
* Convert File::create calls to use Vec buffers and then DocFS.write
  in order to consistently reduce syscalls as well, make
  deferring to threads cleaner and avoid leaving dangling content if
  writing to existing files....
* Convert OpenOptions usage similarly - I could find no discussion on
  the use of create_new for that one output file vs all the other
  files render creates, if link redirection attacks are a concern
  DocFS will provide a good central point to introduce systematic
  create_new usage. (fs::write/File::create is vulnerable to link
  redirection attacks).
* DocFS::write defers to rayon for IO on Windows producing a modest
  speedup: before this patch on my development workstation:

$ time cargo +mystg1 doc -p winapi:0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 6m 11s

real    6m11.734s

Afterwards:
$ time cargo +mystg1 doc -p winapi:0.3.7
   Compiling winapi v0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 49.53s

real    0m49.643s

I haven't measured how much time is in the compilation logic vs in the
IO and outputting etc, but this takes it from frustating to tolerable
for me, at least for now.

5 years agoRemove needless lifetimes
Jeremy Stucki [Fri, 21 Jun 2019 09:39:28 +0000 (11:39 +0200)]
Remove needless lifetimes

5 years agoRemove warnings about incr. comp. generating less debugging output.
Michael Woerister [Tue, 28 May 2019 15:27:46 +0000 (17:27 +0200)]
Remove warnings about incr. comp. generating less debugging output.

5 years agoFurther reduce the likelyhood of hash collisions
Oliver Scherer [Fri, 21 Jun 2019 07:56:02 +0000 (09:56 +0200)]
Further reduce the likelyhood of hash collisions

5 years agoDocumentation typo
Oliver Scherer [Fri, 21 Jun 2019 07:54:11 +0000 (09:54 +0200)]
Documentation typo

5 years agorevert the NodeId to HirId parameter change to get_path_res
ljedrz [Fri, 21 Jun 2019 06:57:34 +0000 (08:57 +0200)]
revert the NodeId to HirId parameter change to get_path_res

5 years agoAuto merge of #62003 - christianpoveda:master, r=oli-obk
bors [Fri, 21 Jun 2019 06:37:17 +0000 (06:37 +0000)]
Auto merge of #62003 - christianpoveda:master, r=oli-obk

Replace MemoryExtra by Memory in intptrcast methods

r? @RalfJung @oli-obk

5 years agoUpdate LLVM to fix VS 2019 compilation
John Kåre Alsaker [Fri, 21 Jun 2019 06:31:41 +0000 (08:31 +0200)]
Update LLVM to fix VS 2019 compilation

5 years agoAdd test for issue-27697
Yuki Okushi [Fri, 21 Jun 2019 06:18:00 +0000 (15:18 +0900)]
Add test for issue-27697

5 years agoAuto merge of #61948 - ehuss:update-mdbook, r=steveklabnik
bors [Fri, 21 Jun 2019 03:24:56 +0000 (03:24 +0000)]
Auto merge of #61948 - ehuss:update-mdbook, r=steveklabnik

Update mdbook

This updates to mdbook 0.3.0. This release includes the following changes:
https://github.com/rust-lang-nursery/mdBook/blob/master/CHANGELOG.md#mdbook-030
One of the biggest changes is the update to pulldown-cmark.

This also bumps the submodules (except the nomicon which has some broken links).

## reference

6 commits in f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb..08ae27a4921ca53967656a7391c82f6c0ddd1ccc
2019-05-31 14:59:12 +0200 to 2019-06-17 11:24:13 -0700
- Document `underscore_const_names` (rust-lang-nursery/reference#620)
- Describe `#[repr(align(x))]` semantics on `enum`s (rust-lang-nursery/reference#619)
- Fix typo in lazy_static example. (rust-lang-nursery/reference#622)
- Rust 2015 supports Kleene ? macro operator (rust-lang-nursery/reference#617)
- Bitrig support has been removed (rust-lang-nursery/reference#615)
- Fix spell error in attributes/diagnostics.md (rust-lang-nursery/reference#614)

## book

8 commits in 62a8c6f25fbd981c80a046f3b04be9684749af3b..9aacfcc4c5b102c8cda195932addefd32fe955d2
2019-05-28 15:48:23 -0400 to 2019-06-16 21:27:26 -0400
- Add a script to help diff rendered books
- Update mdbook links (rust-lang/book#1989)
- Update for markdown changes. (rust-lang/book#1984)
- Make all mentions of crates.io consistent
- Propagate corrections made in layout
- Add link to Swedish translation
- Propagate small edits made in layout
- Remove snapshot files that have been checked with layout

## rust-by-example

3 commits in d8eec1dd65470b9a68e80ac1cba8fad0daac4916..b27472962986e85c94f4183b1a6d2207660d3ed6
2019-06-08 10:15:22 -0300 to 2019-06-17 15:52:07 -0300
- Update `macro_rules!` formatting. (rust-lang/rust-by-example#1205)
- Add Cargo comment to the `try!` macro example. (rust-lang/rust-by-example#1203)
- Fix typo (rust-lang/rust-by-example#1204)

## rustc-guide

15 commits in 3ac9cfc9c9ab2e366feebf18718112737f572352..f55e97c145cf37fd664db2e0e2f2d05df328bf4f
2019-06-02 19:36:58 -0500 to 2019-06-15 17:29:12 -0500
- fix typos
- Update for TyCtxt<'a, 'gcx, 'tcx> -> TyCtxt<'tcx>.
- fix ci failures, typos, broken links
- Some edits to address review comments
- Notes about closure de-sugaring
- add note about rebuilding llvm
- Changes to config.toml require a clean
- Fix a few typos in type inference chapter
- Add triagebot (rust-lang/rustc-guide#337)
- Update how-to-build-and-run.md
- Update how-to-build-and-run.md
- Update compiler-debugging.md
- use debug instead of debuginfo-level
- Replaced tabs with spaces
- correct indentation

## edition-guide

4 commits in 581c6cccfaf995394ea9dcac362dc8e731c18558..f8072acde5ce29c7570d7986180bbded2d22e287
2019-05-06 12:47:44 -0700 to 2019-06-14 23:27:05 +0200
- Small fixes (rust-lang-nursery/edition-guide#179)
- Cleanup unused NLL link (rust-lang-nursery/edition-guide#167)
- Part 2: Rust 2015 now supports ? macro rep op (rust-lang-nursery/edition-guide#163)
- Part 1: Rust 2015 now supports ? macro rep op (rust-lang-nursery/edition-guide#162)

## embedded-book

1 commits in f0c75b75f9c18537b78f5d17c1015247e9a49c86..ef27b517dcd0b990c888c0d7caeff52a5a115619
2019-06-03 10:49:02 +0000 to 2019-06-18 22:59:47 +0000
- Fix link for more strict commonmark interpretation.  (rust-embedded/book#194)

5 years agoUpdate mdbook
Eric Huss [Wed, 19 Jun 2019 03:36:47 +0000 (20:36 -0700)]
Update mdbook

5 years agoAuto merge of #60293 - nagisa:rustdoc-all-the-auto-traits, r=eddyb
bors [Thu, 20 Jun 2019 23:44:52 +0000 (23:44 +0000)]
Auto merge of #60293 - nagisa:rustdoc-all-the-auto-traits, r=eddyb

rustdoc: generate implementors for all auto traits

Previously we would only generate a list of synthetic implementations
for two well known traits – Send and Sync. With this patch all the auto
traits known to rustc are considered. This includes such traits like
Unpin and user’s own traits.

Sadly the implementation still iterates through the list of crate items
and checks them against the traits, which for non-std crates containing
their own auto-traits will still not include types defined in std/core.

It is an improvement nontheless.

5 years agoKill conflicting borrows of places with projections.
Dylan MacKenzie [Thu, 20 Jun 2019 22:31:58 +0000 (15:31 -0700)]
Kill conflicting borrows of places with projections.

Resolves #62007.

Due to a bug, the previous version of this check did not actually kill
any conflicting borrows unless the borrowed place had no projections.
Specifically, `entry_set` will always be empty when `statement_effect`
is called. It does not contain the set of borrows which are live at this
point in the program.

5 years agoFix merge issues
Christian Poveda [Thu, 20 Jun 2019 22:01:48 +0000 (17:01 -0500)]
Fix merge issues

5 years agoUpdated tag methods for consistency
Christian Poveda [Thu, 20 Jun 2019 21:52:17 +0000 (16:52 -0500)]
Updated tag methods for consistency

5 years agoImprove theme checker by removing unneeded conditions
Guillaume Gomez [Mon, 27 May 2019 13:25:01 +0000 (15:25 +0200)]
Improve theme checker by removing unneeded conditions

5 years agoAdd test for empty css file check
Guillaume Gomez [Sun, 26 May 2019 22:02:44 +0000 (00:02 +0200)]
Add test for empty css file check

5 years agoFix theme-checker failure
Guillaume Gomez [Sat, 25 May 2019 12:32:24 +0000 (14:32 +0200)]
Fix theme-checker failure

5 years agoAuto merge of #62006 - Centril:rollup-4my59er, r=Centril
bors [Thu, 20 Jun 2019 20:55:02 +0000 (20:55 +0000)]
Auto merge of #62006 - Centril:rollup-4my59er, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #61900 (implement Error::source for Box<T: Error>)
 - #61979 (Implement Debug for PlaceBase)
 - #61981 (Closures implement Copy and Clone, generators don't)
 - #61996 (Add unit tests for unescaping raw (byte) strings)
 - #62000 (Add test for issue-54189)

Failed merges:

r? @ghost

5 years agoRollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:29 +0000 (22:14 +0200)]
Rollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj

Add test for issue-54189

Closes #54189

5 years agoRollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:28 +0000 (22:14 +0200)]
Rollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad

Add unit tests for unescaping raw (byte) strings

Adds unit tests for functionality introduced in #60793.

r? @matklad @petrochenkov

5 years agoRollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:26 +0000 (22:14 +0200)]
Rollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj

Closures implement Copy and Clone, generators don't

5 years agoRollup merge of #61979 - spastorino:fmt-place-base, r=oli-obk
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:25 +0000 (22:14 +0200)]
Rollup merge of #61979 - spastorino:fmt-place-base, r=oli-obk

Implement Debug for PlaceBase

r? @oli-obk

More tiny bits that can be extracted from Place 2.0 PR

5 years agoRollup merge of #61900 - s3bk:master, r=sfackler
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:24 +0000 (22:14 +0200)]
Rollup merge of #61900 - s3bk:master, r=sfackler

implement Error::source for Box<T: Error>

fixes https://github.com/rust-lang/rust/issues/61899

5 years agoReplace MemoryExtra by Memory in intptrcast methods
Christian Poveda [Thu, 20 Jun 2019 19:07:34 +0000 (14:07 -0500)]
Replace MemoryExtra by Memory in intptrcast methods

5 years agoAuto merge of #61827 - golddranks:lldb_fix, r=nikomatsakis
bors [Thu, 20 Jun 2019 17:57:04 +0000 (17:57 +0000)]
Auto merge of #61827 - golddranks:lldb_fix, r=nikomatsakis

Fix rust-lldb wrapper scripts.

Currently the `rust-lldb` wrapper provided by Rust project is broken. The error messages it produces on launch are as follows:
```
warning: ignoring unknown option: --one-line-before-file=command script import "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py"
warning: ignoring unknown option: --one-line-before-file=type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
warning: ignoring unknown option: --one-line-before-file=type category enable Rust
(lldb) target create "target/debug/nagare"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1481, in <module>
    class SBAddress(object):
  File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1647, in SBAddress
    __swig_getmethods__["module"] = GetModule
NameError: name '__swig_getmethods__' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
...etc.
```

The errors stem from two regressions: one caused by an LLVM upgrade and one caused by unintended upgrade to SWIG 4.0 (SWIG is a wrapper generator that is used to generate Python bindings for LLVM and LLDB.)

(Edit: found the exact dates) The SWIG breakage happened because of a Homebrew version upgrade on `nightly-2019-05-01-x86_64-apple-darwin` and the LLVM breakage happened on `nightly-2019-01-27-x86_64-apple-darwin` (likely to have been caused by https://github.com/rust-lang/rust/pull/57675 ).

The fix is to update the LLVM parameter syntax and to "downgrade" to SWIG 3.0.x. SWIG 3.0.x is not going to be supported by Homebrew forever, but should be good for now, until LLDB upgrades to  support SWIG 4.0.0. Here's some more info about Homebrew support: https://github.com/Homebrew/homebrew-core/pull/39929 & https://github.com/Homebrew/homebrew-core/pull/40882 I'm going to send a bug & fix to LLDB about SWIG 4.0.0 to get the situation fixed in the future.

It would be good to also backport this to beta, since it's such a small change, and will fix an obvious regression.

5 years agoAdd test for issue-54189
Yuki Okushi [Thu, 20 Jun 2019 15:19:11 +0000 (00:19 +0900)]
Add test for issue-54189

5 years agoAuto merge of #61998 - eddyb:type-name-params, r=oli-obk
bors [Thu, 20 Jun 2019 15:11:08 +0000 (15:11 +0000)]
Auto merge of #61998 - eddyb:type-name-params, r=oli-obk

rustc_mir: support type parameters by printing them as `_`.

Fixes #61894.
r? @oli-obk

5 years agorustc_mir: support type parameters by printing them as `_`.
Eduard-Mihai Burtescu [Thu, 20 Jun 2019 14:48:02 +0000 (17:48 +0300)]
rustc_mir: support type parameters by printing them as `_`.

5 years agorustdoc: generate implementors for all auto traits
Simonas Kazlauskas [Thu, 25 Apr 2019 22:16:57 +0000 (01:16 +0300)]
rustdoc: generate implementors for all auto traits

Previously we would only generate a list of synthetic implementations
for two well known traits – Send and Sync. With this patch all the auto
traits known to rustc are considered. This includes such traits like
Unpin and user’s own traits.

Sadly the implementation still iterates through the list of crate items
and checks them against the traits, which for non-std crates containing
their own auto-traits will still not include types defined in std/core.

It is an improvement nontheless.

5 years agoImplement Debug for PlaceBase
Santiago Pastorino [Thu, 20 Jun 2019 01:02:53 +0000 (03:02 +0200)]
Implement Debug for PlaceBase

5 years agoAuto merge of #61929 - 95th:master, r=GuillaumeGomez
bors [Thu, 20 Jun 2019 12:18:25 +0000 (12:18 +0000)]
Auto merge of #61929 - 95th:master, r=GuillaumeGomez

Fix Into trait docs links

https://doc.rust-lang.org/std/convert/trait.Into.html

5 years agorename hir::map::get_by_hir_id to get
ljedrz [Thu, 20 Jun 2019 08:39:19 +0000 (10:39 +0200)]
rename hir::map::get_by_hir_id to get

5 years agoremove hir::map::get
ljedrz [Thu, 20 Jun 2019 08:34:57 +0000 (10:34 +0200)]
remove hir::map::get

5 years agomake blocks::Code work with HirId
ljedrz [Thu, 20 Jun 2019 08:15:07 +0000 (10:15 +0200)]
make blocks::Code work with HirId

5 years agorename hir::map::expect_expr_by_hir_id to expect_expr
ljedrz [Thu, 20 Jun 2019 08:05:56 +0000 (10:05 +0200)]
rename hir::map::expect_expr_by_hir_id to expect_expr

5 years agoremove uses of the NodeId hir::map::expr
ljedrz [Thu, 20 Jun 2019 07:55:21 +0000 (09:55 +0200)]
remove uses of the NodeId hir::map::expr

5 years agoremove definitions::def_index_to_node_id (unused)
ljedrz [Thu, 20 Jun 2019 07:51:00 +0000 (09:51 +0200)]
remove definitions::def_index_to_node_id (unused)

5 years agomake hir::def_kind work with HirId
ljedrz [Thu, 20 Jun 2019 07:41:26 +0000 (09:41 +0200)]
make hir::def_kind work with HirId

5 years agorename hir::map::name_by_hir_id to ::name
ljedrz [Wed, 19 Jun 2019 13:44:51 +0000 (15:44 +0200)]
rename hir::map::name_by_hir_id to ::name

5 years agoremove hir::map::name
ljedrz [Wed, 19 Jun 2019 13:35:56 +0000 (15:35 +0200)]
remove hir::map::name

5 years agoreplace NodeId with HirId in infer::SubregionOrigin
ljedrz [Wed, 19 Jun 2019 13:33:32 +0000 (15:33 +0200)]
replace NodeId with HirId in infer::SubregionOrigin

5 years agoremove TyCtx::expr_span (unused)
ljedrz [Wed, 19 Jun 2019 13:28:27 +0000 (15:28 +0200)]
remove TyCtx::expr_span (unused)

5 years agoreplace NodeId with HirId in traits::ObligationCauseCode
ljedrz [Wed, 19 Jun 2019 13:25:31 +0000 (15:25 +0200)]
replace NodeId with HirId in traits::ObligationCauseCode

5 years agoFix Into trait links
Gurwinder Singh [Tue, 18 Jun 2019 07:37:11 +0000 (13:07 +0530)]
Fix Into trait links

5 years agoAdd unit tests for unescaping raw (byte) strings
Igor Matuszewski [Thu, 20 Jun 2019 07:37:20 +0000 (09:37 +0200)]
Add unit tests for unescaping raw (byte) strings

5 years agoAuto merge of #61983 - Centril:rollup-wnfo07y, r=Centril
bors [Thu, 20 Jun 2019 07:46:11 +0000 (07:46 +0000)]
Auto merge of #61983 - Centril:rollup-wnfo07y, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60454 (Add custom nth_back to Skip)
 - #60772 (Implement nth_back for slice::{Iter, IterMut})
 - #61782 (suggest tuple struct syntax)
 - #61968 (rustc: disallow cloning HIR nodes.)

Failed merges:

r? @ghost

5 years agoRollup merge of #61968 - eddyb:hir-noclone, r=petrochenkov
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:03 +0000 (08:36 +0200)]
Rollup merge of #61968 - eddyb:hir-noclone, r=petrochenkov

rustc: disallow cloning HIR nodes.

Besides being inefficient, cloning also risks creating broken HIR (without properly recreating all the IDs and whatnot, in which case you might as well reconstruct the entire node without ever `Clone`-ing anything).

We detect *some* detrimental situations (based on the occurrence of `HirId`s, I believe?), but it's better to statically disallow it, IMO.

One of the examples that is fixed by this PR is `tcx.hir().fn_decl{,_by_hir_id}`, which was cloning an entire `hir::FnDecl` *every single time it was called*.

r? @petrochenkov cc @rust-lang/compiler

5 years agoRollup merge of #61782 - Electron-libre:suggest_tuple_struct_syntax, r=estebank
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:01 +0000 (08:36 +0200)]
Rollup merge of #61782 - Electron-libre:suggest_tuple_struct_syntax, r=estebank

suggest tuple struct syntax

refs #57242

5 years agoRollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcm
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:00 +0000 (08:36 +0200)]
Rollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcm

Implement nth_back for slice::{Iter, IterMut}

Part of #54054.

I implemented `nth_back` as straightforwardly as I could, and then slightly changed `nth` to match `nth_back`. I believe I did so correctly, but please double-check 🙂

I also added the helper methods `zst_shrink`, `next_unchecked`, and `next_back_unchecked` to get rid of some duplicated code. These changes hopefully make this code easier to understand for new contributors like me.

I noticed the `is_empty!` and `len!` macros which sole purpose seems to be inlining, according to the comment right above them, but the `is_empty` and `len` methods are already marked with `#[inline(always)]`. Does that mean we could replace these macros with method calls, without affecting anything? I'd love to get rid of them.

5 years agoRollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcm
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:35:58 +0000 (08:35 +0200)]
Rollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcm

Add custom nth_back to Skip

Implementation of nth_back for Skip.
Part of #54054

5 years agoClosures implement Copy and Clone, generators don't
Jake Goulding [Thu, 20 Jun 2019 03:03:33 +0000 (23:03 -0400)]
Closures implement Copy and Clone, generators don't

5 years agoAuto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichton
bors [Thu, 20 Jun 2019 02:36:49 +0000 (02:36 +0000)]
Auto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichton

macos tlv workaround

fixes: #60141

Includes:
* remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655)
* redox had a copy of `fast::Key` (not sure why?). That has been removed.
* Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1.

`tlv_get_addr` is relatively expensive (~1.5ns on my machine).

Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match.

After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined.

I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither.

r? @alexcrichton

5 years agoAuto merge of #61947 - estebank:ice-ice-revolution, r=matthewjasper
bors [Wed, 19 Jun 2019 22:23:45 +0000 (22:23 +0000)]
Auto merge of #61947 - estebank:ice-ice-revolution, r=matthewjasper

 Fix ICE involving mut references

Fix #61623, fix #61944, fix #61751.

5 years agoAuto merge of #61967 - lzutao:clippy-update, r=oli-obk
bors [Wed, 19 Jun 2019 19:28:28 +0000 (19:28 +0000)]
Auto merge of #61967 - lzutao:clippy-update, r=oli-obk

submodules: Update clippy from 868f168c to 149a988

r? @oli-obk

5 years agofix compile-fail test for targets without thread locals
tyler [Wed, 19 Jun 2019 18:50:23 +0000 (11:50 -0700)]
fix compile-fail test for targets without thread locals

5 years agoPacify tidy
Oliver Scherer [Wed, 19 Jun 2019 18:17:09 +0000 (20:17 +0200)]
Pacify tidy

5 years agorustc: disallow cloning HIR nodes.
Eduard-Mihai Burtescu [Wed, 12 Jun 2019 08:43:15 +0000 (11:43 +0300)]
rustc: disallow cloning HIR nodes.

5 years agorustc: replace `GenericArgs::with_generic_args` hack with a plain getter.
Eduard-Mihai Burtescu [Wed, 12 Jun 2019 08:42:58 +0000 (11:42 +0300)]
rustc: replace `GenericArgs::with_generic_args` hack with a plain getter.

5 years agoRename regression test to link it to the corresponding issue
Oliver Scherer [Wed, 19 Jun 2019 17:48:03 +0000 (19:48 +0200)]
Rename regression test to link it to the corresponding issue

5 years agofix indentation
Cedric [Wed, 19 Jun 2019 17:47:52 +0000 (19:47 +0200)]
fix indentation

5 years agoChange `ByRef` to a struct variant to clarify its fields via names
Oliver Scherer [Wed, 19 Jun 2019 17:43:13 +0000 (19:43 +0200)]
Change `ByRef` to a struct variant to clarify its fields via names