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

22 months agodo not suggest adding a bound to a opaque type
Takayuki Maeda [Wed, 24 Aug 2022 02:34:14 +0000 (11:34 +0900)]
do not suggest adding a bound to a opaque type

22 months agoGet rid of some usages of `query_keys`
Joshua Nelson [Fri, 12 Aug 2022 01:20:46 +0000 (20:20 -0500)]
Get rid of some usages of `query_keys`

Rustdoc documents these with the name of the type alias instead of normalizing them to the underlying type.
Use associated types instead so that the generated docs for nightly-rustc are easier to read.

22 months agoRemove `$tcx` metavariable from `rustc_query_append`
Joshua Nelson [Fri, 12 Aug 2022 00:54:42 +0000 (19:54 -0500)]
Remove `$tcx` metavariable from `rustc_query_append`

It's not actually necessary and it makes the code harder to read.

22 months agoStabilize `#![feature(label_break_value)]`
Joshua Nelson [Thu, 14 Jul 2022 13:30:38 +0000 (08:30 -0500)]
Stabilize `#![feature(label_break_value)]`

 # Stabilization proposal

The feature was implemented in https://github.com/rust-lang/rust/pull/50045 by est31 and has been in nightly since 2018-05-16 (over 4 years now).
There are [no open issues][issue-label] other than the tracking issue. There is a strong consensus that `break` is the right keyword and we should not use `return`.

There have been several concerns raised about this feature on the tracking issue (other than the one about tests, which has been fixed, and an interaction with try blocks, which has been fixed).
1. nrc's original comment about cost-benefit analysis: https://github.com/rust-lang/rust/issues/48594#issuecomment-422235234
2. joshtriplett's comments about seeing use cases: https://github.com/rust-lang/rust/issues/48594#issuecomment-422281176
3. withoutboats's comments that Rust does not need more control flow constructs: https://github.com/rust-lang/rust/issues/48594#issuecomment-450050630

Many different examples of code that's simpler using this feature have been provided:
- A lexer by rpjohnst which must repeat code without label-break-value: https://github.com/rust-lang/rust/issues/48594#issuecomment-422502014
- A snippet by SergioBenitez which avoids using a new function and adding several new return points to a function: https://github.com/rust-lang/rust/issues/48594#issuecomment-427628251. This particular case would also work if `try` blocks were stabilized (at the cost of making the code harder to optimize).
- Several examples by JohnBSmith: https://github.com/rust-lang/rust/issues/48594#issuecomment-434651395
- Several examples by Centril: https://github.com/rust-lang/rust/issues/48594#issuecomment-440154733
- An example by petrochenkov where this is used in the compiler itself to avoid duplicating error checking code: https://github.com/rust-lang/rust/issues/48594#issuecomment-443557569
- Amanieu recently provided another example related to complex conditions, where try blocks would not have helped: https://github.com/rust-lang/rust/issues/48594#issuecomment-1184213006

Additionally, petrochenkov notes that this is strictly more powerful than labelled loops due to macros which accidentally exit a loop instead of being consumed by the macro matchers: https://github.com/rust-lang/rust/issues/48594#issuecomment-450246249

nrc later resolved their concern, mostly because of the aforementioned macro problems.
joshtriplett suggested that macros could be able to generate IR directly
(https://github.com/rust-lang/rust/issues/48594#issuecomment-451685983) but there are no open RFCs,
and the design space seems rather speculative.

joshtriplett later resolved his concerns, due to a symmetry between this feature and existing labelled break: https://github.com/rust-lang/rust/issues/48594#issuecomment-632960804

withoutboats has regrettably left the language team.

joshtriplett later posted that the lang team would consider starting an FCP given a stabilization report: https://github.com/rust-lang/rust/issues/48594#issuecomment-1111269353

[issue-label]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-label_break_value+

 ## Report

+ Feature gate:
    - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/src/test/ui/feature-gates/feature-gate-label_break_value.rs
+ Diagnostics:
    - https://github.com/rust-lang/rust/blob/6b2d3d5f3cd1e553d87b5496632132565b6779d3/compiler/rustc_parse/src/parser/diagnostics.rs#L2629
    - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L749
    - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L1001
    - https://github.com/rust-lang/rust/blob/111df9e6eda1d752233482c1309d00d20a4bbf98/compiler/rustc_passes/src/loops.rs#L254
    - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L2079
    - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L1569
+ Tests:
    - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_continue.rs
    - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_unlabeled_break.rs
    - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_illegal_uses.rs
    - https://github.com/rust-lang/rust/blob/master/src/test/ui/lint/unused_labels.rs
    - https://github.com/rust-lang/rust/blob/master/src/test/ui/run-pass/for-loop-while/label_break_value.rs

 ## Interactions with other features

Labels follow the hygiene of local variables.

label-break-value is permitted within `try` blocks:
```rust
let _: Result<(), ()> = try {
    'foo: {
        Err(())?;
        break 'foo;
    }
};
```

label-break-value is disallowed within closures, generators, and async blocks:
```rust
'a: {
    || break 'a
    //~^ ERROR use of unreachable label `'a`
    //~| ERROR `break` inside of a closure
}
```

label-break-value is disallowed on [_BlockExpression_]; it can only occur as a [_LoopExpression_]:
```rust
fn labeled_match() {
    match false 'b: { //~ ERROR block label not supported here
        _ => {}
    }
}

macro_rules! m {
    ($b:block) => {
        'lab: $b; //~ ERROR cannot use a `block` macro fragment here
        unsafe $b; //~ ERROR cannot use a `block` macro fragment here
        |x: u8| -> () $b; //~ ERROR cannot use a `block` macro fragment here
    }
}

fn foo() {
    m!({});
}
```

[_BlockExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/block-expr.html
[_LoopExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/loop-expr.html

22 months agoadd `depth_limit` in `QueryVTable`
SparrowLii [Wed, 24 Aug 2022 01:42:12 +0000 (09:42 +0800)]
add `depth_limit` in `QueryVTable`

22 months agoAuto merge of #96869 - sunfishcode:main, r=joshtriplett
bors [Wed, 24 Aug 2022 01:17:52 +0000 (01:17 +0000)]
Auto merge of #96869 - sunfishcode:main, r=joshtriplett

Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8.

Add a `is_known_utf8` flag to `Wtf8Buf`, which tracks whether the
string is known to contain UTF-8. This is efficiently computed in many
common situations, such as when a `Wtf8Buf` is constructed from a `String`
or `&str`, or with `Wtf8Buf::from_wide` which is already doing UTF-16
decoding and already checking for surrogates.

This makes `OsString::into_string` O(1) rather than O(N) on Windows in
common cases.

And, it eliminates the need to scan through the string for surrogates in
`Args::next` and `Vars::next`, because the strings are already being
translated with `Wtf8Buf::from_wide`.

Many things on Windows construct `OsString`s with `Wtf8Buf::from_wide`,
such as `DirEntry::file_name` and `fs::read_link`, so with this patch,
users of those functions can subsequently call `.into_string()` without
paying for an extra scan through the string for surrogates.

r? `@ghost`

22 months agorustdoc: remove unused CSS rule
Michael Howell [Wed, 24 Aug 2022 01:15:53 +0000 (18:15 -0700)]
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 agoReduce code size of `assert_matches_failed`
Benoît du Garreau [Tue, 23 Aug 2022 22:53:09 +0000 (00:53 +0200)]
Reduce code size of `assert_matches_failed`

22 months agoAuto merge of #100675 - Xiretza:fluent-mandate-crate-prefix, r=davidtwco
bors [Tue, 23 Aug 2022 22:30:07 +0000 (22:30 +0000)]
Auto merge of #100675 - Xiretza:fluent-mandate-crate-prefix, r=davidtwco

fluent: mandate slug names to be prefixed by crate name

This is currently only convention, but not actively checked for.

Additionally, improve error messages to highlight the path of the offending fluent file rather than the identifier preceding it.

This will conflict with #100671, so I'll leave it as draft until that's merged.

22 months agoUse `--userns=keep-id` when "docker" is really podman
Josh Stone [Tue, 23 Aug 2022 22:10:36 +0000 (15:10 -0700)]
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 agosugg: take into count the debug formatting
Vincenzo Palazzo [Sat, 20 Aug 2022 23:29:38 +0000 (23:29 +0000)]
sugg: take into count the debug formatting

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
22 months agoerrors: `IntoDiagnosticArg` for `io::Error`/paths
David Wood [Fri, 19 Aug 2022 13:45:54 +0000 (14:45 +0100)]
errors: `IntoDiagnosticArg` for `io::Error`/paths

Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path`
and `std::path::PathBuf`.

Signed-off-by: David Wood <david.wood@huawei.com>
22 months agosave_analysis: Migrate diagnostics
Wonchul Lee [Fri, 19 Aug 2022 21:40:31 +0000 (06:40 +0900)]
save_analysis: Migrate diagnostics

22 months agoAuto merge of #99917 - yaahc:error-in-core-move, r=thomcc
bors [Tue, 23 Aug 2022 19:48:55 +0000 (19:48 +0000)]
Auto merge of #99917 - yaahc:error-in-core-move, r=thomcc

Move Error trait into core

This PR moves the error trait from the standard library into a new unstable `error` module within the core library. The goal of this PR is to help unify error reporting across the std and no_std ecosystems, as well as open the door to integrating the error trait into the panic reporting system when reporting panics whose source is an errors (such as via `expect`).

This PR is a rewrite of https://github.com/rust-lang/rust/pull/90328 using new compiler features that have been added to support error in core.

22 months agoFix links to error codes
Guillaume Gomez [Tue, 23 Aug 2022 19:47:31 +0000 (21:47 +0200)]
Fix links to error codes

22 months agoHandle error code hash by redirecting to the correct error code page
Guillaume Gomez [Tue, 23 Aug 2022 19:44:25 +0000 (21:44 +0200)]
Handle error code hash by redirecting to the correct error code page

22 months agoUpdate README.md
Tushar Dahiya [Tue, 23 Aug 2022 17:57:23 +0000 (23:27 +0530)]
Update README.md

22 months agoMake sure to count reused cgus towards the count of jobs done
bjorn3 [Tue, 23 Aug 2022 16:51:06 +0000 (16:51 +0000)]
Make sure to count reused cgus towards the count of jobs done

22 months agoAdd some self profiler calls
bjorn3 [Tue, 23 Aug 2022 16:11:12 +0000 (16:11 +0000)]
Add some self profiler calls

22 months agoCompile functions from clif ir to object code in parallel
bjorn3 [Tue, 23 Aug 2022 16:09:08 +0000 (16:09 +0000)]
Compile functions from clif ir to object code in parallel

22 months agoUse correct CguReuse variant
bjorn3 [Tue, 23 Aug 2022 16:06:01 +0000 (16:06 +0000)]
Use correct CguReuse variant

22 months agoRewrite error index generator to greatly reduce the size of the pages
Guillaume Gomez [Tue, 23 Aug 2022 16:27:18 +0000 (18:27 +0200)]
Rewrite error index generator to greatly reduce the size of the pages

22 months agoAdd a warning about `Option/Result::and()` being eagerly evaluated
Chayim Refael Friedman [Tue, 23 Aug 2022 16:15:09 +0000 (16:15 +0000)]
Add a warning about `Option/Result::and()` being eagerly evaluated

Copied from `or()`.

22 months agoDo asm compilation and object file emission in parallel
bjorn3 [Tue, 23 Aug 2022 16:05:29 +0000 (16:05 +0000)]
Do asm compilation and object file emission in parallel

22 months agoAdd a jobserver based concurrency limiter
bjorn3 [Tue, 23 Aug 2022 15:44:39 +0000 (15:44 +0000)]
Add a jobserver based concurrency limiter

22 months agoStore symbol name as owned string
bjorn3 [Fri, 19 Aug 2022 10:27:00 +0000 (10:27 +0000)]
Store symbol name as owned string