]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoRollup merge of #100776 - Rejyr:diagnostic-migration-rustc-lint, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:25 +0000 (15:56 -0700)]
Rollup merge of #100776 - Rejyr:diagnostic-migration-rustc-lint, r=davidtwco

Migrate `rustc_lint` errors to `SessionDiagnostic`

Draft PR for migrating `rustc_lint` to `SessionDiagnostic`, as part of the [recent blog post](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html)

22 months agoRollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:24 +0000 (15:56 -0700)]
Rollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwco

Migrate rustc_mir_dataflow to diagnostic structs

22 months agoRollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:23 +0000 (15:56 -0700)]
Rollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwco

Diagnostics migr const eval

This PR should eventually contain all diagnostic migrations for the `rustc_const_eval` crate.

r? `@davidtwco`
`@rustbot` label +A-translation

22 months agoRollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:22 +0000 (15:56 -0700)]
Rollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwco

Migrate `rustc_ty_utils` to `SessionDiagnostic`

I have migrated the `rustc_ty_utils` crate to use `SessionDiagnostic`, motivated by the [recent blog post about the diagnostic translation effort](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html).

This is my first PR to the Rust repository, so if I have missed anything, or anything needs to be changed, please let me know! 😄

`@rustbot` label +A-translation

22 months agoRollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic,...
Michael Goulet [Fri, 26 Aug 2022 22:56:21 +0000 (15:56 -0700)]
Rollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic, r=davidtwco

Migrate ast lowering to session diagnostic

I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see https://github.com/rust-lang/rust/pull/100694).

22 months agoAuto merge of #101039 - ouz-a:issue-100991, r=compiler-errors
bors [Fri, 26 Aug 2022 18:53:16 +0000 (18:53 +0000)]
Auto merge of #101039 - ouz-a:issue-100991, r=compiler-errors

Don't catch overflow when running with cargo doc

Fixes #100991

r? `@compiler-errors`

22 months agoDon't catch overflow when running with cargo doc
ouz-a [Fri, 26 Aug 2022 12:41:14 +0000 (15:41 +0300)]
Don't catch overflow when running with cargo doc

22 months agoAuto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
bors [Fri, 26 Aug 2022 15:47:26 +0000 (15:47 +0000)]
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser

session: stabilize split debuginfo on linux

Stabilize the `-Csplit-debuginfo` flag...

- ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance.
- ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.

22 months agoMigrate rustc_ty_utils to use SessionDiagnostic
Peter Medus [Thu, 18 Aug 2022 23:04:31 +0000 (00:04 +0100)]
Migrate rustc_ty_utils to use SessionDiagnostic

22 months agoAuto merge of #101037 - GuillaumeGomez:rollup-opn6kj1, r=GuillaumeGomez
bors [Fri, 26 Aug 2022 13:05:57 +0000 (13:05 +0000)]
Auto merge of #101037 - GuillaumeGomez:rollup-opn6kj1, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #95005 (BTree: evaluate static type-related check at compile time)
 - #99742 (Add comments about stdout locking)
 - #100128 (Document that `RawWakerVTable` functions must be thread-safe.)
 - #100956 (Reduce right-side DOM size)
 - #101006 (Fix doc cfg on reexports)
 - #101012 (rustdoc: remove unused CSS for `.variants_table`)
 - #101023 (rustdoc: remove `type="text/css"` from stylesheet links)
 - #101031 (Remove unused build dependency)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRollup merge of #101031 - rust-lang:remove-unused-build-dep, r=bjorn3
Guillaume Gomez [Fri, 26 Aug 2022 12:08:51 +0000 (14:08 +0200)]
Rollup merge of #101031 - rust-lang:remove-unused-build-dep, r=bjorn3

Remove unused build dependency

There is no more `build.rs` so this dependency is unused.

r? `@Dylan-DPC`

22 months agoRollup merge of #101023 - notriddle:notriddle/head-shrink, r=Dylan-DPC
Guillaume Gomez [Fri, 26 Aug 2022 12:08:50 +0000 (14:08 +0200)]
Rollup merge of #101023 - notriddle:notriddle/head-shrink, r=Dylan-DPC

rustdoc: remove `type="text/css"` from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web."

22 months agoRollup merge of #101012 - notriddle:notriddle/variants_table, r=jsha
Guillaume Gomez [Fri, 26 Aug 2022 12:08:49 +0000 (14:08 +0200)]
Rollup merge of #101012 - notriddle:notriddle/variants_table, r=jsha

rustdoc: remove unused CSS for `.variants_table`

Continuation of #100938 and #101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.

22 months agoRollup merge of #101006 - GuillaumeGomez:doc-cfg-reexport, r=notriddle
Guillaume Gomez [Fri, 26 Aug 2022 12:08:48 +0000 (14:08 +0200)]
Rollup merge of #101006 - GuillaumeGomez:doc-cfg-reexport, r=notriddle

Fix doc cfg on reexports

Fixes #83428.

The problem was that the newly inlined item cfg propagation was not working since its real parent is different than its current one.

For the implementation, I decided to put it directly into `CfgPropagation` instead of inside `inline.rs` because I thought it would be simpler to maintain and to not forget if new kind of items are added if it's all done in one place.

r? `@notriddle`

22 months agoRollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddle
Guillaume Gomez [Fri, 26 Aug 2022 12:08:47 +0000 (14:08 +0200)]
Rollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddle

Reduce right-side DOM size

This is another follow-up of https://github.com/rust-lang/rust/pull/100429 but not in code blocks this time.

So the idea is: if there is only one element in the `.rightside` element, there is no need to wrap it, we can just create one node.

On each page, I run this JS: `document.getElementsByTagName('*').length`. Important to note: the bigger the number of elements inside the page, the greater the gain. It also doesn't work very nicely on std docs because there are a lot of version annotations. So with this PR, It allows to get the following results:

| file name | before this PR | with this PR | diff |
|-|-|-|-|
| std/default/trait.Default.html | 2189 | 1331 | 39.2% |
| std/vec/struct.Vec.html | 14073 | 13842 | 1.7% |
| std/fmt/trait.Debug.html | 5313 | 4907 | 7.7% |
| std/ops/trait.Index.html | 642 | 630 | 1.9% |
| gtk4/WidgetExt | 3269 | 3061 | 6.4% |

You can test it [here](https://rustdoc.crud.net/imperio/reduce-rightsize-dom-size/gtk4/prelude/trait.WidgetExt.html).

r? `@notriddle`

22 months agoRollup merge of #100128 - kpreid:waker-doc, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:45 +0000 (14:08 +0200)]
Rollup merge of #100128 - kpreid:waker-doc, r=thomcc

Document that `RawWakerVTable` functions must be thread-safe.

Also add some intra-doc links and more high-level explanation of how `Waker` is used, while I'm here.

Context: https://internals.rust-lang.org/t/thread-safety-of-rawwakervtables/17126

22 months agoRollup merge of #99742 - sigaloid:master, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:44 +0000 (14:08 +0200)]
Rollup merge of #99742 - sigaloid:master, r=thomcc

Add comments about stdout locking

This is the source of some confusion regarding the `println!` macro:
* https://llogiq.github.io/2017/06/01/perf-pitfalls.html#unbuffered-io
* https://news.ycombinator.com/item?id=18794930
* https://reddit.com/r/rust/comments/5puyx2/why_is_println_so_slow/dcua5g5/
* https://reddit.com/r/rust/comments/ab7hsi/comparing_pythagorean_triples_in_c_d_and_rust/ecy7ql8/

In some of these cases it's not the locking behavior where the bottleneck lies, but it's still mentioned as a surprise when, eg, benchmarking a million `println!`'s in a very tight loop.

If there's any stylistic problems please feel free to correct me! This is my first contribution and I want to get it right :crab:

22 months agoRollup merge of #95005 - ssomers:btree_static_assert, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:43 +0000 (14:08 +0200)]
Rollup merge of #95005 - ssomers:btree_static_assert, r=thomcc

BTree: evaluate static type-related check at compile time

`assert`s like the ones replaced here would only go off when you run the right test cases, if the code were ever incorrectly changed such that rhey would trigger. But [inspired on a nice forum question](https://users.rust-lang.org/t/compile-time-const-generic-parameter-check/69202), they can be checked at compile time.

22 months agoAuto merge of #100944 - nnethercote:shrink-thir-Expr, r=cjgillot
bors [Fri, 26 Aug 2022 10:00:27 +0000 (10:00 +0000)]
Auto merge of #100944 - nnethercote:shrink-thir-Expr, r=cjgillot

Shrink `thir::Expr`

r? `@cjgillot`

22 months agoRemove unused build dependency
Guillaume Gomez [Fri, 26 Aug 2022 09:18:48 +0000 (11:18 +0200)]
Remove unused build dependency

22 months agoAuto merge of #100705 - compiler-errors:issue-100620, r=oli-obk
bors [Fri, 26 Aug 2022 06:05:06 +0000 (06:05 +0000)]
Auto merge of #100705 - compiler-errors:issue-100620, r=oli-obk

Avoid reporting overflow in `is_impossible_method`

Fixes #100620

We're evaluating a new predicate in a different param-env than it was checked during typeck, so be more careful about handling overflow errors. Instead of using `FulfillmentCtxt`, using `InferCtxt::evaluate_obligation` by itself will give us back the overflow error, so we can throw it away properly.

This may give us more false-positives, but it doesn't regress the `<HashMap as Iterator>::rev` example that originally motivated adding `is_impossible_method` in the first place.

22 months agorustdoc: remove `type="text/css" from stylesheet links
Michael Howell [Fri, 26 Aug 2022 04:28:20 +0000 (21:28 -0700)]
rustdoc: remove `type="text/css" from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>,
since "CSS is the only stylesheet language used on the web."

22 months agoAuto merge of #101017 - JohnTitor:rollup-73f2fhb, r=JohnTitor
bors [Fri, 26 Aug 2022 03:23:54 +0000 (03:23 +0000)]
Auto merge of #101017 - JohnTitor:rollup-73f2fhb, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99064 (distinguish the method and associated function diagnostic information)
 - #99920 (Custom allocator support in `rustc_serialize`)
 - #100034 ( Elaborate all box dereferences in `ElaborateBoxDerefs`)
 - #100076 (make slice::{split_at,split_at_unchecked} const functions)
 - #100604 (Remove unstable Result::into_ok_or_err)
 - #100933 (Reduce code size of `assert_matches_failed`)
 - #100978 (Handle `Err` in `ast::LitKind::to_token_lit`.)
 - #101010 (rustdoc: remove unused CSS for `.multi-column`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRollup merge of #101010 - notriddle:notriddle/multi-column, r=jsha
Yuki Okushi [Fri, 26 Aug 2022 00:51:47 +0000 (09:51 +0900)]
Rollup merge of #101010 - notriddle:notriddle/multi-column, r=jsha

rustdoc: remove unused CSS for `.multi-column`

As a sanity check, [this tool] can be used to run a CSS query across an HTML tree to detect if a selector ever matches (I use compiler-docs and std docs). This isn't good enough, because I also need to account for JavaScript, but this class is never mentioned in any of the JS files, either.

According to [blame], this class was added when rustdoc was first written, and, as far as I can tell, was never actually used.

[this tool]: https://gitlab.com/notriddle/html-scanner
[blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761

22 months agoRollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov
Yuki Okushi [Fri, 26 Aug 2022 00:51:46 +0000 (09:51 +0900)]
Rollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov

Handle `Err` in `ast::LitKind::to_token_lit`.

Fixes #100948.

r? ``@petrochenkov``

22 months agoRollup merge of #100933 - a1phyr:cheap_assert_match_failed, r=JoshTriplett
Yuki Okushi [Fri, 26 Aug 2022 00:51:45 +0000 (09:51 +0900)]
Rollup merge of #100933 - a1phyr:cheap_assert_match_failed, r=JoshTriplett

Reduce code size of `assert_matches_failed`

Using `write_str` instead of `<str as Display>::fmt` avoids the `pad` function which is very expensive to have in size-constrained code.

22 months agoRollup merge of #100604 - dtolnay:okorerr, r=m-ou-se
Yuki Okushi [Fri, 26 Aug 2022 00:51:44 +0000 (09:51 +0900)]
Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se

Remove unstable Result::into_ok_or_err

Pending FCP: https://github.com/rust-lang/rust/issues/82223#issuecomment-1214920203

```@rustbot``` label +waiting-on-fcp

22 months agoRollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:43 +0000 (09:51 +0900)]
Rollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk

make slice::{split_at,split_at_unchecked} const functions

Now that `slice::from_raw_parts` is const in stable 1.64, it makes sense to have `split_at` const as well, otherwise unsafe code is required to achieve a const equivalent.

22 months agoRollup merge of #100034 - tmiasko:elaborate-box-derefs, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:42 +0000 (09:51 +0900)]
Rollup merge of #100034 - tmiasko:elaborate-box-derefs, r=oli-obk

 Elaborate all box dereferences in `ElaborateBoxDerefs`

so that it is the only pass responsible for elaboration, instead of
splitting this responsibility between the `StateTransform` and
`ElaborateBoxDerefs`.

22 months agoRollup merge of #99920 - emarteca:custom-allocator-support, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:41 +0000 (09:51 +0900)]
Rollup merge of #99920 - emarteca:custom-allocator-support, r=oli-obk

Custom allocator support in `rustc_serialize`

Adding support for `rustc_serialize` encode/decode for `Box` and `Vec` that use a custom allocator.

22 months agoRollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank
Yuki Okushi [Fri, 26 Aug 2022 00:51:40 +0000 (09:51 +0900)]
Rollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank

distinguish the method and associated function diagnostic information

Methods are defined within the context of a struct and their first parameter is always self
Associated functions don’t take self as a parameter
```
modified:   compiler/rustc_typeck/src/check/method/suggest.rs
modified:   src/test/ui/auto-ref-slice-plus-ref.stderr
modified:   src/test/ui/block-result/issue-3563.stderr
modified:   src/test/ui/issues/issue-28344.stderr
modified:   src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr
modified:   src/test/ui/suggestions/suggest-methods.stderr
modified:   src/test/ui/traits/trait-upcasting/subtrait-method.stderr
```

22 months agoAuto merge of #99487 - bmacnaughton:is_whitespace_updates, r=thomcc
bors [Fri, 26 Aug 2022 00:42:40 +0000 (00:42 +0000)]
Auto merge of #99487 - bmacnaughton:is_whitespace_updates, r=thomcc

is_whitespace() performance improvements

This is my first rust PR, so if I miss anything obvious please let me know and I'll do my best to fix it.

This was a bit more of a challenge than I realized because, while I made working code locally and tested it against the native `is_whitespace()`, this PR required changing `src/tools/unicode-table-generator`, the code that generated the code.

I have benchmarked this locally, using criterion, and have seen meaningful performance improvements. I can add those outputs to this if you'd like, but am guessing that the perf run that `@fmease` recommended is what's needed.

I have run ` ./x.py test --stage 0 library/std` after building it locally after executing `./x.py build library`. I didn't try to build the whole compiler, but maybe I should have - any guidance would be appreciated.

If this general approach makes sense, I'll take a look at some other candidate categories, e.g., `Cc`, in the future.

Oh, and I wasn't sure whether the generated code should be included in this PR or not. I did include it.

22 months agorustdoc: remove unused CSS for `.variants_table`
Michael Howell [Thu, 25 Aug 2022 21:27:40 +0000 (14:27 -0700)]
rustdoc: remove unused CSS for `.variants_table`

Continuation of #100938 and #101010. This rule was added to support the old,
table-based style for displaying enum variants, which are now displayed using
headers and paragraphs.

22 months agoAuto merge of #100748 - SparrowLii:query_depth, r=cjgillot
bors [Thu, 25 Aug 2022 21:27:38 +0000 (21:27 +0000)]
Auto merge of #100748 - SparrowLii:query_depth, r=cjgillot

add `depth_limit` in `QueryVTable` to avoid entering a new tcx in `layout_of`

Fixes #49735
Updates #48685

The `layout_of` query needs to check whether it overflows the depth limit, and the current implementation needs to create a new `ImplicitCtxt` inside `layout_of`. However, `start_query` will already create a new `ImplicitCtxt`, so we can check the depth limit in `start_query`.

We can tell whether we need to check the depth limit simply by whether the return value of `to_debug_str` of the query is `layout_of`. But I think adding the `depth_limit` field in `QueryVTable` may be more elegant and more scalable.

22 months agoAdding support for rustc_serialize encode and decode for Box and Vec that use a custo...
Ellen Arteca [Thu, 25 Aug 2022 20:19:18 +0000 (20:19 +0000)]
Adding support for rustc_serialize encode and decode for Box and Vec that use a custom allocator

22 months agorustdoc: remove unused CSS for `.multi-column`
Michael Howell [Thu, 25 Aug 2022 18:43:36 +0000 (11:43 -0700)]
rustdoc: remove unused CSS for `.multi-column`

As a sanity check, [this tool] can be used to run a CSS query across an HTML
tree to detect if a selector ever matches (I use compiler-docs and std
docs). This isn't good enough, because I also need to account for JavaScript,
but this class is never mentioned in any of the JS files, either.

According to [blame], this class was added when rustdoc was first written,
and, as far as I can tell, was never actually used.

[this tool]: https://gitlab.com/notriddle/html-scanner
[blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761

22 months agoAuto merge of #100911 - tmiasko:update-stdarch, r=Amanieu
bors [Thu, 25 Aug 2022 18:17:42 +0000 (18:17 +0000)]
Auto merge of #100911 - tmiasko:update-stdarch, r=Amanieu

Update stdarch submodule

Changes from stdarch:

* Fix links in documentation of cmpxchg16b
* Use load intrinsic and loop for intrinsic-test programs. Add --release flag back to intrinsic-test programs.
* Properly fix vext intrinsic tests
* Replace some calls to `pointer::offset` with `add` and `sub`
* Allow internal use of stdsimd from detect_feature
* fix target name in contributing.md
* Tweak constant for ARM vext instruction tests
* Use `llvm.ppc.altivec.lvx` intrinsic for `vec_ld`
*  Adding doc links for arm neon intrinsics
* Adding doc links for arm crypto and aes intrinsics
* Remove instruction tests for `__mmask*` intrinsics
* Update ubuntu 21.10 docker containers to 22.04
* Adding documentation links for arm crc32 intrinsics
* Remove restrictions on compare-exchange memory ordering.
* Fix a typo in the document.
* Allow mapping a runtime feature to a set of target_features
* Update atomic intrinsics
* Fully qualify recursive macro calls
* Ensure the neon vector aggregates like `float32x4x4_t` are `#[repr(C)]`
* Remove useless conditional compilation
* Fix ARM vbsl* NEON intrinsics

r? `@Amanieu`

22 months agoAdd test for missing cfg propagation for reexport
Guillaume Gomez [Thu, 25 Aug 2022 14:42:51 +0000 (16:42 +0200)]
Add test for missing cfg propagation for reexport

22 months agoFix missing cfg propagation for reexports
Guillaume Gomez [Thu, 25 Aug 2022 14:42:17 +0000 (16:42 +0200)]
Fix missing cfg propagation for reexports

22 months agoreview
Trevor Spiteri [Thu, 25 Aug 2022 10:54:30 +0000 (12:54 +0200)]
review

22 months agoInline trivial `From<Local> for Place<'_>` impl
Tomasz Miąsko [Thu, 25 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Inline trivial `From<Local> for Place<'_>` impl

22 months agoAdd method that applies DefUse effect
Tomasz Miąsko [Thu, 25 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Add method that applies DefUse effect

22 months agoElaborate all box dereferences in `ElaborateBoxDerefs`
Tomasz Miąsko [Mon, 1 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Elaborate all box dereferences in `ElaborateBoxDerefs`

so that it is the only pass responsible for elaboration, instead of
splitting this responsibility between the `StateTransform` and
`ElaborateBoxDerefs`.

22 months agoAuto merge of #100571 - cjgillot:mir-cost-visit, r=compiler-errors
bors [Thu, 25 Aug 2022 08:16:43 +0000 (08:16 +0000)]
Auto merge of #100571 - cjgillot:mir-cost-visit, r=compiler-errors

Check projection types before inlining MIR

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

I'm very unhappy with this solution, having to duplicate MIR validation code, but at least it removes the ICE.

r? `@compiler-errors`

22 months agoAuto merge of #100436 - jyn514:macro-query-system, r=cjgillot
bors [Thu, 25 Aug 2022 05:35:27 +0000 (05:35 +0000)]
Auto merge of #100436 - jyn514:macro-query-system, r=cjgillot

try and simplify some things in the query system

22 months agoFix liveness analysis for yield terminators
Tomasz Miąsko [Mon, 1 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Fix liveness analysis for yield terminators

A resume place is evaluated and assigned to only after a yield
terminator resumes. Ensure that locals used when evaluating the
resume place are live across the yield.

22 months agoAuto merge of #100977 - JohnTitor:rollup-8hc7rxh, r=JohnTitor
bors [Thu, 25 Aug 2022 02:32:11 +0000 (02:32 +0000)]
Auto merge of #100977 - JohnTitor:rollup-8hc7rxh, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99332 (Stabilize `#![feature(label_break_value)]`)
 - #99954 (let-else: break out to one scope higher for let-else)
 - #100188 (Parser will not suggest invalid expression when use public)
 - #100780 (save_analysis: Migrate diagnostic)
 - #100808 (Migrate `rustc_interface` diagnostics )
 - #100921 (Add a warning about `Option/Result::and()` being eagerly evaluated)
 - #100960 (rustdoc: ayu code color selector more specific)
 - #100964 (Sync rustc_codegen_cranelift)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoHandle `Err` in `ast::LitKind::to_token_lit`.
Nicholas Nethercote [Wed, 24 Aug 2022 23:41:48 +0000 (09:41 +1000)]
Handle `Err` in `ast::LitKind::to_token_lit`.

Fixes #100948.

22 months agoAuto merge of #99946 - tmiasko:elide-storage-makers, r=oli-obk
bors [Wed, 24 Aug 2022 23:51:06 +0000 (23:51 +0000)]
Auto merge of #99946 - tmiasko:elide-storage-makers, r=oli-obk

Elide superfluous storage markers

Follow the existing strategy of omitting the storage markers for temporaries
introduced for internal usage when elaborating derefs and deref projections.

Those temporaries are simple scalars which are used immediately after being
defined and never have their address taken. There is no benefit from storage
markers from either liveness analysis or code generation perspective.

22 months agoRollup merge of #100964 - bjorn3:sync_cg_clif-2022-08-24, r=bjorn3
Yuki Okushi [Wed, 24 Aug 2022 23:51:01 +0000 (08:51 +0900)]
Rollup merge of #100964 - bjorn3:sync_cg_clif-2022-08-24, r=bjorn3

Sync rustc_codegen_cranelift

The main highlights this time are support for parallel compilation of codegen units (by me) and improved windows support (by ``@afonso360)`` In addition ``@afonso360`` added abi-checker to cg_clif's CI. This has already catched an abi compatibility issue with AArch64. The fix has landed on Cranelift's main branch, but doesn't yet have a release. ``@uweigand`` also submitted a couple of PR's that will are prerequisites for supporting IBM's s390x architecture.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler

22 months agoRollup merge of #100960 - rust-lang:notriddle/ayu-span-code, r=GuillaumeGomez
Yuki Okushi [Wed, 24 Aug 2022 23:51:00 +0000 (08:51 +0900)]
Rollup merge of #100960 - rust-lang:notriddle/ayu-span-code, r=GuillaumeGomez

rustdoc: ayu code color selector more specific

According to https://github.com/rust-lang/rust/pull/100960#issuecomment-1225970579, this selector is only really intended to apply to item info. However, it's so broad that it's hard to tell when it deliberately applies vs where it accidentally applies.

22 months agoRollup merge of #100921 - ChayimFriedman2:and-eager-eval, r=JohnTitor
Yuki Okushi [Wed, 24 Aug 2022 23:50:59 +0000 (08:50 +0900)]
Rollup merge of #100921 - ChayimFriedman2:and-eager-eval, r=JohnTitor

Add a warning about `Option/Result::and()` being eagerly evaluated

Copied from `or()`.

Inspired by [this StackOverflow question](https://stackoverflow.com/questions/73461846/why-is-in-rust-the-expression-in-option-and-evaluated-if-option-is-none).

[The PR for `or()`](https://github.com/rust-lang/rust/pull/46548) mentions the Clippy lint `or_fun_call` which doesn't exist for `and()` (although there is `unnecessary_lazy_evaluations`). I still think this warning is also good for `and()`. Feel free to close if you disagree.

22 months agoRollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, r=davidtwco
Yuki Okushi [Wed, 24 Aug 2022 23:50:58 +0000 (08:50 +0900)]
Rollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, r=davidtwco

Migrate `rustc_interface` diagnostics

``@rustbot`` label +A-translation

r? rust-lang/diagnostics
cc #100717

22 months agoRollup merge of #100780 - wonchulee:translation_save_analysis, r=davidtwco
Yuki Okushi [Wed, 24 Aug 2022 23:50:57 +0000 (08:50 +0900)]
Rollup merge of #100780 - wonchulee:translation_save_analysis, r=davidtwco

save_analysis: Migrate diagnostic

* Migrate the `rustc_save_analysis` crate's diagnostic to translatable diagnostic structs.

Depends on https://github.com/rust-lang/rust/pull/100694 and https://github.com/rust-lang/rust/pull/100754 for #[fatal(..)] support, then https://github.com/rust-lang/rust/commit/aa68eb4179881ed25106e675a6a224746f8fad5f, https://github.com/rust-lang/rust/commit/f5219a396083b764f3741e9e105685323a745ce8, https://github.com/rust-lang/rust/commit/7da52f694a4ff7c4b9870415584f2c86cec5ce62 can be removed. (I copied commits from https://github.com/rust-lang/rust/pull/100754)

22 months agoRollup merge of #100188 - chenyukang:fix-issue-100165, r=estebank
Yuki Okushi [Wed, 24 Aug 2022 23:50:56 +0000 (08:50 +0900)]
Rollup merge of #100188 - chenyukang:fix-issue-100165, r=estebank

Parser will not suggest invalid expression when use public

Fixes #100165

22 months agoRollup merge of #99954 - dingxiangfei2009:break-out-let-else-higher-up, r=oli-obk
Yuki Okushi [Wed, 24 Aug 2022 23:50:55 +0000 (08:50 +0900)]
Rollup merge of #99954 - dingxiangfei2009:break-out-let-else-higher-up, r=oli-obk

let-else: break out to one scope higher for let-else

```@est31``` This PR follows up with #99518 which is to break out to the last remainder scope. It breaks to the out-most `region_scope` of the block if the first statement is a `let-else`.

22 months agoRollup merge of #99332 - jyn514:stabilize-label-break-value, r=petrochenkov
Yuki Okushi [Wed, 24 Aug 2022 23:50:54 +0000 (08:50 +0900)]
Rollup merge of #99332 - jyn514:stabilize-label-break-value, r=petrochenkov

Stabilize `#![feature(label_break_value)]`

See the stabilization report in https://github.com/rust-lang/rust/issues/48594#issuecomment-1186213313.

22 months agoAuto merge of #100963 - matthiaskrgr:rollup-pjr0lb3, r=matthiaskrgr
bors [Wed, 24 Aug 2022 19:54:22 +0000 (19:54 +0000)]
Auto merge of #100963 - matthiaskrgr:rollup-pjr0lb3, r=matthiaskrgr

Rollup of 15 pull requests

Successful merges:

 - #99993 (linker: Update some outdated comments)
 - #100220 (Properly forward `ByRefSized::fold` to the inner iterator)
 - #100826 (sugg: take into count the debug formatting)
 - #100855 (Extra documentation for new formatting feature)
 - #100888 (Coherence negative impls implied bounds)
 - #100901 (Make some methods private)
 - #100906 (Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing)
 - #100912 (Diagnose missing includes in run-make tests)
 - #100919 (Use par_body_owners for liveness)
 - #100922 (Rewrite error index generator to greatly reduce the size of the pages)
 - #100926 (Update README.md)
 - #100930 (Use `--userns=keep-id` when "docker" is really podman)
 - #100938 (rustdoc: remove unused CSS rule)
 - #100940 (Do not suggest adding a bound to a opaque type)
 - #100945 (Add a missing test case for impl generic mismatch)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoAdd color test for anchors in all themes
Guillaume Gomez [Wed, 24 Aug 2022 18:25:12 +0000 (20:25 +0200)]
Add color test for anchors in all themes

22 months agoExtend GUI test to check colors for all srclink elements
Guillaume Gomez [Wed, 24 Aug 2022 14:13:26 +0000 (16:13 +0200)]
Extend GUI test to check colors for all srclink elements

22 months agoUpdate rustdoc tests for simplified rightside DOM
Guillaume Gomez [Wed, 24 Aug 2022 13:46:16 +0000 (15:46 +0200)]
Update rustdoc tests for simplified rightside DOM

22 months agoRemove the extra DOM level if there is only one child in rightside elements
Guillaume Gomez [Wed, 24 Aug 2022 13:33:56 +0000 (15:33 +0200)]
Remove the extra DOM level if there is only one child in rightside elements

22 months agorustdoc: ayu code color selector more specific
Michael Howell [Wed, 24 Aug 2022 16:01:35 +0000 (09:01 -0700)]
rustdoc: ayu code color selector more specific

According to https://github.com/rust-lang/rust/pull/100960#issuecomment-1225970579,
this selector is only really intended to apply to item info. However,
it's so broad that it's hard to tell when it deliberately applies vs where it
accidentally applies.

22 months agoRustfmt
bjorn3 [Wed, 24 Aug 2022 17:06:47 +0000 (17:06 +0000)]
Rustfmt

22 months agoAdd new allowed deps
bjorn3 [Wed, 24 Aug 2022 17:06:37 +0000 (17:06 +0000)]
Add new allowed deps

22 months agoAuto merge of #100803 - klensy:do-not-encode-preinterned-symbols, r=bjorn3
bors [Wed, 24 Aug 2022 16:56:32 +0000 (16:56 +0000)]
Auto merge of #100803 - klensy:do-not-encode-preinterned-symbols, r=bjorn3

Symbols: do not write string values of preinterned symbols into compiled artifacts

r? `@bjorn3`

Followup for #98851

https://github.com/rust-lang/rust/pull/98851#issuecomment-1215606291

22 months agoMerge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
bjorn3 [Wed, 24 Aug 2022 16:40:58 +0000 (18:40 +0200)]
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24

22 months agoRustup to rustc 1.65.0-nightly (060e47f74 2022-08-23)
bjorn3 [Wed, 24 Aug 2022 16:37:37 +0000 (18:37 +0200)]
Rustup to rustc 1.65.0-nightly (060e47f74 2022-08-23)

22 months agoSync from rust 4a24f08ba43166cfee86d868b3fe8612aec6faca
bjorn3 [Wed, 24 Aug 2022 16:29:45 +0000 (18:29 +0200)]
Sync from rust 4a24f08ba43166cfee86d868b3fe8612aec6faca

22 months agoRollup merge of #100945 - TaKO8Ki:add-missing-test-case-for-impl-generic-mismatch...
Matthias Krüger [Wed, 24 Aug 2022 16:20:21 +0000 (18:20 +0200)]
Rollup merge of #100945 - TaKO8Ki:add-missing-test-case-for-impl-generic-mismatch, r=Dylan-DPC

Add a missing test case for impl generic mismatch

This suggestion use different span depending on whether the method has generics or not, so I added a test case about the method with some generics.

22 months agoRollup merge of #100940 - TaKO8Ki:do-not-suggest-adding-bound-to-opaque-type, r=fee1...
Matthias Krüger [Wed, 24 Aug 2022 16:20:20 +0000 (18:20 +0200)]
Rollup merge of #100940 - TaKO8Ki:do-not-suggest-adding-bound-to-opaque-type, r=fee1-dead

Do not suggest adding a bound to a opaque type

fixes #100442

22 months agoRollup merge of #100938 - notriddle:notriddle/fields-table, r=sanxiyn
Matthias Krüger [Wed, 24 Aug 2022 16:20:19 +0000 (18:20 +0200)]
Rollup merge of #100938 - notriddle:notriddle/fields-table, r=sanxiyn

rustdoc: remove unused CSS rule

According to [blame], this rule was added to support enum struct variants. However, enum struct variants don't use tables in their design any more, so this rule does nothing.

[blame]: https://github.com/rust-lang/rust/blame/87991d5f5d72d6baca490141cb890211ba2f3843/src/librustdoc/html/static/css/rustdoc.css#L748

22 months agoRollup merge of #100930 - cuviper:podman-keep-id, r=jyn514
Matthias Krüger [Wed, 24 Aug 2022 16:20:18 +0000 (18:20 +0200)]
Rollup merge of #100930 - cuviper:podman-keep-id, r=jyn514

Use `--userns=keep-id` when "docker" is really podman

Rootless podman creates a separate user namespace, where an inner
`LOCAL_USER_ID` will map to a different subuid range on the host.
The "keep-id" mode maps the current UID directly into the container.

This makes `src/ci/docker/run.sh` work better for testing container
images on systems running podman, where "docker" is just a shim.

22 months agoRollup merge of #100926 - tusharxoxoxo:master, r=Dylan-DPC
Matthias Krüger [Wed, 24 Aug 2022 16:20:17 +0000 (18:20 +0200)]
Rollup merge of #100926 - tusharxoxoxo:master, r=Dylan-DPC

Update README.md

Fixed Small grammatical Errors

22 months agoRollup merge of #100922 - GuillaumeGomez:rewrite-error-index, r=notriddle
Matthias Krüger [Wed, 24 Aug 2022 16:20:16 +0000 (18:20 +0200)]
Rollup merge of #100922 - GuillaumeGomez:rewrite-error-index, r=notriddle

Rewrite error index generator to greatly reduce the size of the pages

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

Instead of having all error codes in a same page (making the DOM way too big), I split the output into multiple files and generated a list of links (if there is an explanation) to the error codes' explanation into the already existing file.

I also used this opportunity to greatly simplify the code. Instead of needing a `build.rs`, I simply imported the file we want and wrote the macro which generates a function containing everything we need. We just need to call it to get the error codes and their explanation (if any). Also, considering the implementations between markdown and HTML formats differed even further, the `Formatter` trait was becoming too problematic so I removed it too.

You can test it [here](https://rustdoc.crud.net/imperio/rewrite-error-index/error-index.html).

cc ``@jsha``
r? ``@notriddle``

22 months agoRollup merge of #100919 - sanxiyn:parallel-liveness, r=oli-obk
Matthias Krüger [Wed, 24 Aug 2022 16:20:15 +0000 (18:20 +0200)]
Rollup merge of #100919 - sanxiyn:parallel-liveness, r=oli-obk

Use par_body_owners for liveness

I did this refactoring while working on something else. Liveness is about bodies, there is no reason to use par_for_each_module here.

Tests are updated because things are visited in a different order. I checked diagnostics are same, just in a different (and IMO, better) order.

22 months agoRollup merge of #100912 - tmiasko:make-include, r=TaKO8Ki
Matthias Krüger [Wed, 24 Aug 2022 16:20:14 +0000 (18:20 +0200)]
Rollup merge of #100912 - tmiasko:make-include, r=TaKO8Ki

Diagnose missing includes in run-make tests

22 months agoRollup merge of #100906 - ChayimFriedman2:map-index-mut, r=davidtwco
Matthias Krüger [Wed, 24 Aug 2022 16:20:13 +0000 (18:20 +0200)]
Rollup merge of #100906 - ChayimFriedman2:map-index-mut, r=davidtwco

Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing

The error can be quite confusing to newcomers.

Fixes #100873.

I'm not so sure about the message, open to wording suggestions.

22 months agoRollup merge of #100901 - TaKO8Ki:make-some-methods-private, r=sanxiyn
Matthias Krüger [Wed, 24 Aug 2022 16:20:12 +0000 (18:20 +0200)]
Rollup merge of #100901 - TaKO8Ki:make-some-methods-private, r=sanxiyn

Make some methods private

22 months agoRollup merge of #100888 - spastorino:coherence-negative-impls-implied-bounds, r=lcnr
Matthias Krüger [Wed, 24 Aug 2022 16:20:11 +0000 (18:20 +0200)]
Rollup merge of #100888 - spastorino:coherence-negative-impls-implied-bounds, r=lcnr

Coherence negative impls implied bounds

Fixes #93875

This PR is rebased on top of #100789 and it would need to include that one which is already r+ed.

r? ``@nikomatsakis``

cc ``@lcnr`` (which I've talked about https://github.com/rust-lang/rust/commit/3222f420d9d2312efe0735eb48160c7b070adc54, I guess after you finish your reordering of modules and work with OutlivesEnvironmentEnv this commit can just be reverted).

22 months agoRollup merge of #100855 - IsaacCloos:master, r=joshtriplett
Matthias Krüger [Wed, 24 Aug 2022 16:20:10 +0000 (18:20 +0200)]
Rollup merge of #100855 - IsaacCloos:master, r=joshtriplett

Extra documentation for new formatting feature

Documentation of this feature was added in #90473 and released in Rust 1.58. However, high traffic macros did not receive new examples. Namely `println!()` and `format!()`.

The doc comments included in Rust are super important to the community- especially newcomers. I have met several other newbies like myself who are unaware of this recent (well about 7 months old now) update to the language allowing for convenient intra-string identifiers.

Bringing small examples of this feature to the doc comments of `println!()` and `format!()` would be helpful to everyone learning the language.

[Blog Post Announcing Feature](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html)
[Feature PR](https://github.com/rust-lang/rust/pull/90473) - includes several instances of documentation of the feature- minus the macros in question for this PR

*This is my first time contributing to a project this large. Feedback would mean the world to me 😄*

---

*Recreated; I violated the [No-Merge Policy](https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy)*

22 months agoRollup merge of #100826 - vincenzopalazzo:macros/wrong_sugg_with_positional_arg,...
Matthias Krüger [Wed, 24 Aug 2022 16:20:09 +0000 (18:20 +0200)]
Rollup merge of #100826 - vincenzopalazzo:macros/wrong_sugg_with_positional_arg, r=TaKO8Ki

sugg: take into count the debug formatting

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

This PR will fix a suggestion error by taking into consideration also the `:?` symbol and act in a different way

``@rustbot`` r? ``@compiler-errors``

N.B: I did not find a full way to test the change, any idea?

22 months agoRollup merge of #100220 - scottmcm:fix-by-ref-sized, r=joshtriplett
Matthias Krüger [Wed, 24 Aug 2022 16:20:08 +0000 (18:20 +0200)]
Rollup merge of #100220 - scottmcm:fix-by-ref-sized, r=joshtriplett

Properly forward `ByRefSized::fold` to the inner iterator

cc ``@timvermeulen,`` who noticed this mistake in https://github.com/rust-lang/rust/pull/100214#issuecomment-1207317625

22 months agoRollup merge of #99993 - petrochenkov:linkdated, r=bjorn3
Matthias Krüger [Wed, 24 Aug 2022 16:20:07 +0000 (18:20 +0200)]
Rollup merge of #99993 - petrochenkov:linkdated, r=bjorn3

linker: Update some outdated comments

r? ``@bjorn3``

22 months agouse a minimized example
Takayuki Maeda [Wed, 24 Aug 2022 15:42:34 +0000 (00:42 +0900)]
use a minimized example

22 months agoMerge pull request #1271 from bjorn3/parallel_comp_support
bjorn3 [Wed, 24 Aug 2022 15:22:30 +0000 (17:22 +0200)]
Merge pull request #1271 from bjorn3/parallel_comp_support

Support compiling codegen units in parallel

22 months agoAdd fixme
bjorn3 [Wed, 24 Aug 2022 14:28:40 +0000 (14:28 +0000)]
Add fixme

22 months agoUnify rightside rendering
Guillaume Gomez [Wed, 24 Aug 2022 13:10:26 +0000 (15:10 +0200)]
Unify rightside rendering

22 months agoTune drop_excess_capacity
bjorn3 [Wed, 24 Aug 2022 10:22:01 +0000 (12:22 +0200)]
Tune drop_excess_capacity

22 months agoAuto merge of #100942 - ehuss:update-cargo, r=ehuss
bors [Wed, 24 Aug 2022 05:34:43 +0000 (05:34 +0000)]
Auto merge of #100942 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in 9809f8ff33c2b998919fd0432c626f0f7323697a..6da726708a4406f31f996d813790818dce837161
2022-08-16 22:10:06 +0000 to 2022-08-23 21:39:56 +0000
- Update non-ASCII crate name warning message (rust-lang/cargo#11017)
- Add more tests for aggressive or precise update (rust-lang/cargo#11011)
- Ignore broken but excluded file during traversing (rust-lang/cargo#11008)
- Improve error message for wrong target names (rust-lang/cargo#10999)
- Bump snapbox to 0.3 (rust-lang/cargo#11005)
- remove missed reference to workspace inheritance in unstable.md (rust-lang/cargo#11001)
- Warning when precise or aggressive without -p flag (rust-lang/cargo#10988)

22 months agoadd a missing test case for impl generic mismatch
Takayuki Maeda [Wed, 24 Aug 2022 05:09:55 +0000 (14:09 +0900)]
add a missing test case for impl generic mismatch

22 months agoAdd some more THIR size assertions.
Nicholas Nethercote [Wed, 24 Aug 2022 05:06:11 +0000 (15:06 +1000)]
Add some more THIR size assertions.

22 months agoRename `thir::Adt` as `thir::AdtExpr`.
Nicholas Nethercote [Wed, 24 Aug 2022 02:59:06 +0000 (12:59 +1000)]
Rename `thir::Adt` as `thir::AdtExpr`.

This matches the naming scheme used elsewhere, e.g. in the AST, and
avoids name clashes with the `ExprKind::Closure` variant.

22 months agoBox `thir::ExprKind::InlineAsm`.
Nicholas Nethercote [Wed, 24 Aug 2022 02:16:01 +0000 (12:16 +1000)]
Box `thir::ExprKind::InlineAsm`.

This shrinks `thir::Expr`.

22 months agoBox `thir::ExprKind::Closure`.
Nicholas Nethercote [Wed, 24 Aug 2022 01:28:05 +0000 (11:28 +1000)]
Box `thir::ExprKind::Closure`.

This shrinks `thir::Expr`.

22 months agoStore blocks in `Thir`.
Nicholas Nethercote [Wed, 24 Aug 2022 02:02:17 +0000 (12:02 +1000)]
Store blocks in `Thir`.

Like expressions, statements, and match arms. This shrinks `thir::Stmt`
and is a precursor to further shrinking `thir::Expr`.

22 months agoBox `user_ty` fields in `thir::ExprKind`.
Nicholas Nethercote [Wed, 24 Aug 2022 00:37:41 +0000 (10:37 +1000)]
Box `user_ty` fields in `thir::ExprKind`.

This shrinks several large variants of `ExprKind`.

22 months agoUpdate cargo
Eric Huss [Wed, 24 Aug 2022 03:58:12 +0000 (20:58 -0700)]
Update cargo

22 months agoget rid of another unnecessary lifetime macro argument
Joshua Nelson [Fri, 12 Aug 2022 02:35:33 +0000 (21:35 -0500)]
get rid of another unnecessary lifetime macro argument

22 months agoMove most of `make_query` into a generic function, away from the macro
Joshua Nelson [Fri, 12 Aug 2022 01:36:13 +0000 (20:36 -0500)]
Move most of `make_query` into a generic function, away from the macro

This should both make the code easier to read and also greatly reduce the amount of codegen
the compiler has to do, since it only needs to monomorphize `create_query_frame` for each
new key and not for each query.