]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #90278 - notriddle:notriddle/highlight-ptr, r=jyn541,GuillaumeGomez
Matthias Krüger [Wed, 27 Oct 2021 04:11:38 +0000 (06:11 +0200)]
Rollup merge of #90278 - notriddle:notriddle/highlight-ptr, r=jyn541,GuillaumeGomez

rustdoc: use better highlighting for *const, *mut, and &mut

This generates more consistent HTML for these RefKeyWord combinations.

Before:

![image](https://user-images.githubusercontent.com/1593513/138742752-7e00a3f7-4621-4c62-82d1-3e4c2ef503d1.png)

After:

![image](https://user-images.githubusercontent.com/1593513/138743955-90abcdcd-fc88-4e2f-95bb-c1b1635c0001.png)

2 years agoRollup merge of #90232 - konan8205:master, r=GuillaumeGomez
Matthias Krüger [Wed, 27 Oct 2021 04:11:36 +0000 (06:11 +0200)]
Rollup merge of #90232 - konan8205:master, r=GuillaumeGomez

rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability

Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows.

## Before
![원1](https://user-images.githubusercontent.com/11029378/138592394-16b15787-532d-4421-a5eb-ed85675290fa.png)

## After
![원2](https://user-images.githubusercontent.com/11029378/138592409-f3a440ee-f0fc-40e4-9561-42c479439c9f.png)

The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands:

```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff --flavor=woff
```
```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
```

r? ``@GuillaumeGomez``

2 years agoRollup merge of #90154 - camelid:remove-getdefid, r=jyn514
Matthias Krüger [Wed, 27 Oct 2021 04:11:35 +0000 (06:11 +0200)]
Rollup merge of #90154 - camelid:remove-getdefid, r=jyn514

rustdoc: Remove `GetDefId`

See the individual commit messages for details.

r? `@jyn514`

2 years agoAuto merge of #90314 - matthiaskrgr:rollup-ag1js8n, r=matthiaskrgr
bors [Tue, 26 Oct 2021 17:50:46 +0000 (17:50 +0000)]
Auto merge of #90314 - matthiaskrgr:rollup-ag1js8n, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #90296 (Remove fNN::lerp)
 - #90302 (Remove unneeded into_iter)
 - #90303 (Add regression test for issue 90164)
 - #90305 (Add regression test for #87258)

Failed merges:

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

2 years agoRollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-Simulacrum
Matthias Krüger [Tue, 26 Oct 2021 17:32:46 +0000 (19:32 +0200)]
Rollup merge of #90305 - vandenheuvel:test_issue_87258, r=Mark-Simulacrum

Add regression test for #87258

Closes #87258.

2 years agoRollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor
Matthias Krüger [Tue, 26 Oct 2021 17:32:45 +0000 (19:32 +0200)]
Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor

Add regression test for issue 90164

Closes #90164 (previously fixed by #90181)

2 years agoRollup merge of #90302 - GuillaumeGomez:rm-unneeded-into_iter, r=jyn514
Matthias Krüger [Tue, 26 Oct 2021 17:32:44 +0000 (19:32 +0200)]
Rollup merge of #90302 - GuillaumeGomez:rm-unneeded-into_iter, r=jyn514

Remove unneeded into_iter

As ``@camelid`` mentionned [here](https://github.com/rust-lang/rust/pull/89430#discussion_r735889324), the `into_iter` was unneeded.

r? ``@camelid``

2 years agoRollup merge of #90296 - CAD97:rip-lerp, r=Mark-Simulacrum
Matthias Krüger [Tue, 26 Oct 2021 17:32:44 +0000 (19:32 +0200)]
Rollup merge of #90296 - CAD97:rip-lerp, r=Mark-Simulacrum

Remove fNN::lerp

Lerp is [surprisingly complex with multiple tradeoffs depending on what guarantees you want to provide](https://github.com/rust-lang/rust/issues/86269#issuecomment-869108301) (and what you're willing to drop for raw speed), so we don't have consensus on what implementation to use, let alone what signature - `t.lerp(a, b)` nicely puts `a, b` together, but makes dispatch to lerp custom types with the same signature basically impossible, and major ecosystem crates (e.g. nalgebra, glium) use `a.lerp(b, t)`, which is easily confusable. It was suggested to maybe provide a `Lerp<T>` trait and `t.lerp([a, b])`, which _could_ be implemented by downstream math libraries for their types, but also significantly raises the bar from a simple fNN method to a full trait, and does nothing to solve the implementation question. (It also raises the question of whether we'd support higher-order bezier interpolation.)

The only consensus we have is the lack of consensus, and the [general temperature](https://github.com/rust-lang/rust/issues/86269#issuecomment-951347135) is that we should just remove this method (giving the method space back to 3rd party libs) and revisit this if (and likely only if) IEEE adds lerp to their specification.

If people want a lerp, they're _probably_ already using (or writing) a math support library, which provides a lerp function for its custom math types and can provide the same lerp implementation for the primitive types via an extension trait.

See also [previous Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/lerp.20API.20design)

cc ``@clarfonthey`` (original PR author), ``@m-ou-se`` (original r+), ``@scottmcm`` (last voice in tracking issue, prompted me to post this)

Closes #86269 (removed)

2 years agoAuto merge of #90290 - nyanpasu64:fix-string-as-mut-vec, r=m-ou-se
bors [Tue, 26 Oct 2021 14:44:47 +0000 (14:44 +0000)]
Auto merge of #90290 - nyanpasu64:fix-string-as-mut-vec, r=m-ou-se

Fix copy-paste error in String::as_mut_vec() docs

Did not expect the comments to be perfectly justified... can't wait to be told to change it to `Vec<u8>`, which destroys the justification 😼

2 years agoAdd regression test for #87258
Bram van den Heuvel [Tue, 26 Oct 2021 10:48:22 +0000 (12:48 +0200)]
Add regression test for #87258

2 years agoAuto merge of #90284 - tonyyzy:patch-1, r=JohnTitor
bors [Tue, 26 Oct 2021 11:45:13 +0000 (11:45 +0000)]
Auto merge of #90284 - tonyyzy:patch-1, r=JohnTitor

Remove redundant Aligner

The `Aligner` struct seems to be unnecessary.
Previously noted by `@arthurprs` https://github.com/rust-lang/rust/pull/44963#discussion_r145340754
Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f

2 years agoRemove redundant Aligner
Tony Yang [Tue, 26 Oct 2021 10:34:03 +0000 (11:34 +0100)]
Remove redundant Aligner

The `Aligner` struct seems to be unnecessary.
Previously noted by @arthurprs https://github.com/rust-lang/rust/pull/44963#discussion_r145340754
Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/
Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f

2 years agoAdd regression test for issue 90164
Maybe Waffle [Tue, 26 Oct 2021 10:23:27 +0000 (13:23 +0300)]
Add regression test for issue 90164

2 years agoRemove unneeded into_iter
Guillaume Gomez [Tue, 26 Oct 2021 09:50:52 +0000 (11:50 +0200)]
Remove unneeded into_iter

2 years agoAuto merge of #90075 - pierwill:fix-79717, r=petrochenkov
bors [Tue, 26 Oct 2021 07:57:51 +0000 (07:57 +0000)]
Auto merge of #90075 - pierwill:fix-79717, r=petrochenkov

Edit error messages for `rustc_resolve::AmbiguityKind` variants

Edit the language of the ambiguity descriptions for E0659. These strings now appear as notes.

Closes #79717.

2 years agoFix copy-paste error in String::as_mut_vec() docs
nyanpasu64 [Tue, 26 Oct 2021 01:42:22 +0000 (18:42 -0700)]
Fix copy-paste error in String::as_mut_vec() docs

2 years agoAuto merge of #90299 - matthiaskrgr:rollup-n77ntld, r=matthiaskrgr
bors [Tue, 26 Oct 2021 04:44:51 +0000 (04:44 +0000)]
Auto merge of #90299 - matthiaskrgr:rollup-n77ntld, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #90181 (fix(rustc_typeck): report function argument errors on matching type)
 - #90241 (Make thiscall abi on unsupported platforms a hard error)
 - #90294 (Update books)
 - #90295 (Update cargo)

Failed merges:

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

2 years agoRollup merge of #90295 - ehuss:update-cargo, r=ehuss
Matthias Krüger [Tue, 26 Oct 2021 04:14:09 +0000 (06:14 +0200)]
Rollup merge of #90295 - ehuss:update-cargo, r=ehuss

Update cargo

4 commits in 7fbbf4e8f23e3c24b8afff541dcb17e53eb5ff88..6c1bc24b8b49d4bc965f67d7037906dc199c72b7
2021-10-19 02:16:48 +0000 to 2021-10-24 17:51:41 +0000
- Fix a clippy warning (rust-lang/cargo#10002)
- Upgrade Cargo to the 2021 edition (rust-lang/cargo#10000)
- Don't canonicalize executable path (rust-lang/cargo#9991)
- Bump to 0.59.0, update changelog (rust-lang/cargo#9998)

2 years agoRollup merge of #90294 - ehuss:update-books, r=ehuss
Matthias Krüger [Tue, 26 Oct 2021 04:14:08 +0000 (06:14 +0200)]
Rollup merge of #90294 - ehuss:update-books, r=ehuss

Update books

## nomicon

3 commits in 2d66852a27c5d0ec50ae021820d1de22caa2b1bd..358e6a61d5f4f0496d0a81e70cdcd25d05307342
2021-10-07 19:00:37 +0900 to 2021-10-20 11:23:12 -0700
- Write a basic "call Rust from C" example (rust-lang/nomicon#296)
- Clarify the Safe vs. Unsafe Rust relationship (rust-lang/nomicon#294)
- Fix typo with respect to dangling pointer (rust-lang/nomicon#319)

## book

8 commits in eb1282ec444db94055fa9531b6f3f803e86bb382..fd9299792852c9a368cb236748781852f75cdac6
2021-09-16 21:17:09 -0400 to 2021-10-22 21:59:46 -0400
- Reword description to emphasize what return does in a match arm
- Correct backwards wording describing From impls. Fixes rust-lang/book#2829
- Remove multiple negatives, add examples. Fixes rust-lang/book#2833
- Fix capitalization in sidebar. Fixes rust-lang/book#2860
- fix quotes
- comments from nostarch and responses for chapter 2
-  (rust-lang/book#2906)
- Merge pull request rust-lang/book#2892 from Enrico2/patch-1

## rust-by-example

1 commits in 9a60624fcad0140826c44389571dc622917cd632..27f1ff5e440ef78828b68ab882b98e1b10d9af32
2021-10-04 08:13:53 -0300 to 2021-10-13 08:04:40 -0300
- Added example of `impl Trait` as an argument (rust-lang/rust-by-example#1468)

## embedded-book

1 commits in 270fccd339e5972d9c900e788f197e81a0bcd956..51739471276b1776dea27cf562b974ef07e24685
2021-10-06 16:28:48 +0000 to 2021-10-17 16:48:42 +0000
- Fix typo in 'The Borrow Checker'  (rust-embedded/book#305)

2 years agoRollup merge of #90241 - DrMeepster:thiscall_lint_upgrade, r=petrochenkov
Matthias Krüger [Tue, 26 Oct 2021 04:14:07 +0000 (06:14 +0200)]
Rollup merge of #90241 - DrMeepster:thiscall_lint_upgrade, r=petrochenkov

Make thiscall abi on unsupported platforms a hard error

As suggested in https://github.com/rust-lang/rust/issues/42202#issuecomment-950205016, this PR makes use of the `thiscall` abi on unsupported a hard error instead of a lint.

2 years agoRollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebank
Matthias Krüger [Tue, 26 Oct 2021 04:14:06 +0000 (06:14 +0200)]
Rollup merge of #90181 - notriddle:notriddle/error-pointer, r=estebank

fix(rustc_typeck): report function argument errors on matching type

Fixes #90101

2 years agoRemove fNN::lerp - consensus unlikely
CAD97 [Tue, 26 Oct 2021 03:22:17 +0000 (22:22 -0500)]
Remove fNN::lerp - consensus unlikely

2 years agoUpdate cargo
Eric Huss [Tue, 26 Oct 2021 03:30:21 +0000 (20:30 -0700)]
Update cargo

2 years agoUpdate books
Eric Huss [Tue, 26 Oct 2021 02:51:09 +0000 (19:51 -0700)]
Update books

2 years agorustdoc: use ttf based font for cjk glyphs
Shinwoo Park [Tue, 26 Oct 2021 01:58:13 +0000 (10:58 +0900)]
rustdoc: use ttf based font for cjk glyphs

2 years agoEdit error messages for rustc_resolve::AmbiguityKind variants
pierwill [Wed, 20 Oct 2021 13:56:10 +0000 (08:56 -0500)]
Edit error messages for rustc_resolve::AmbiguityKind variants

Emit description of the ambiguity as a note.

Co-authored-by: Noah Lev <camelidcamel@gmail.com>
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2 years agoAuto merge of #85830 - bjorn3:separate_provide_extern, r=cjgillot
bors [Tue, 26 Oct 2021 00:38:58 +0000 (00:38 +0000)]
Auto merge of #85830 - bjorn3:separate_provide_extern, r=cjgillot

 Avoid a branch on key being local for queries that use the same local and extern providers

Currently based on https://github.com/rust-lang/rust/pull/85810 as it slightly conflicts with it. Only the last two commits are new.

2 years agomake thiscall on unsupported platforms an error
DrMeepster [Sun, 24 Oct 2021 18:57:45 +0000 (11:57 -0700)]
make thiscall on unsupported platforms an error

2 years agoAuto merge of #90282 - matthiaskrgr:rollup-c6trbff, r=matthiaskrgr
bors [Mon, 25 Oct 2021 21:33:13 +0000 (21:33 +0000)]
Auto merge of #90282 - matthiaskrgr:rollup-c6trbff, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #89581 (Add -Z no-unique-section-names to reduce ELF header bloat.)
 - #90196 (Fix and extent ControlFlow `traverse_inorder` example)
 - #90255 (:arrow_up: rust-analyzer)
 - #90266 (Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated)

Failed merges:

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

2 years agoRollup merge of #90266 - b-naber:uneval_substs, r=lcnr
Matthias Krüger [Mon, 25 Oct 2021 20:59:49 +0000 (22:59 +0200)]
Rollup merge of #90266 - b-naber:uneval_substs, r=lcnr

Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated

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

The changes introduced in https://github.com/rust-lang/rust/pull/87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv.

r? `@lcnr`

2 years agoRollup merge of #90255 - lnicola:rust-analyzer-2021-10-25, r=lnicola
Matthias Krüger [Mon, 25 Oct 2021 20:59:48 +0000 (22:59 +0200)]
Rollup merge of #90255 - lnicola:rust-analyzer-2021-10-25, r=lnicola

:arrow_up: rust-analyzer

r? ~~``@ghose~~`` sorry, ``@ghost``

2 years agoRollup merge of #90196 - yanok:master, r=scottmcm
Matthias Krüger [Mon, 25 Oct 2021 20:59:47 +0000 (22:59 +0200)]
Rollup merge of #90196 - yanok:master, r=scottmcm

Fix and extent ControlFlow `traverse_inorder` example

Fix and extent ControlFlow `traverse_inorder` example

1. The existing example compiles on its own, but any usage fails to be monomorphised and so doesn't compile. Fix that by using Fn trait instead of FnMut.
2. Added an example usage of `traverse_inorder` showing how we can terminate the traversal early.

Fixes #90063

2 years agoRollup merge of #89581 - jblazquez:master, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 20:59:46 +0000 (22:59 +0200)]
Rollup merge of #89581 - jblazquez:master, r=Mark-Simulacrum

Add -Z no-unique-section-names to reduce ELF header bloat.

This change adds a new compiler flag that can help reduce the size of ELF binaries that contain many functions.

By default, when enabling function sections (which is the default for most targets), the LLVM backend will generate different section names for each function. For example, a function `func` would generate a section called `.text.func`. Normally this is fine because the linker will merge all those sections into a single one in the binary. However, starting with [LLVM 12](https://github.com/llvm/llvm-project/commit/ee5d1a04), the backend will also generate unique section names for exception handling, resulting in thousands of `.gcc_except_table.*` sections ending up in the final binary because some linkers like LLD don't currently merge or strip these EH sections (see discussion [here](https://reviews.llvm.org/D83655)). This can bloat the ELF headers and string table significantly in binaries that contain many functions.

The new option is analogous to Clang's `-fno-unique-section-names`, and instructs LLVM to generate the same `.text` and `.gcc_except_table` section for each function, resulting in a smaller final binary.

The motivation to add this new option was because we have a binary that ended up with so many ELF sections (over 65,000) that it broke some existing ELF tools, which couldn't handle so many sections.

Here's our old binary:

```
$ readelf --sections old.elf | head -1
There are 71746 section headers, starting at offset 0x2a246508:

$ readelf --sections old.elf | grep shstrtab
  [71742] .shstrtab      STRTAB          0000000000000000 2977204c ad44bb 00      0   0  1
```

That's an 11MB+ string table. Here's the new binary using this option:

```
$ readelf --sections new.elf | head -1
There are 43 section headers, starting at offset 0x29143ca8:

$ readelf --sections new.elf | grep shstrtab
  [40] .shstrtab         STRTAB          0000000000000000 29143acc 0001db 00      0   0  1
```

The whole binary size went down by over 20MB, which is quite significant.

2 years agofix(rustc_typeck): report function argument errors on matching type
Michael Howell [Fri, 22 Oct 2021 20:49:12 +0000 (13:49 -0700)]
fix(rustc_typeck): report function argument errors on matching type

Fixes #90101

2 years agoAuto merge of #89430 - GuillaumeGomez:rustdoc-clippy-lints, r=jyn514,camelid,notriddle
bors [Mon, 25 Oct 2021 18:24:33 +0000 (18:24 +0000)]
Auto merge of #89430 - GuillaumeGomez:rustdoc-clippy-lints, r=jyn514,camelid,notriddle

Fix clippy lints in librustdoc

I ran clippy on librustdoc and simply fixed the lints. :)

r? `@notriddle`

2 years agorustdoc: use better highlighting for *const, *mut, and &mut
Michael Howell [Mon, 25 Oct 2021 17:43:55 +0000 (10:43 -0700)]
rustdoc: use better highlighting for *const, *mut, and &mut

This generates more consistent HTML for these RefKeyWord combinations.

Before:

![image](https://user-images.githubusercontent.com/1593513/138742752-7e00a3f7-4621-4c62-82d1-3e4c2ef503d1.png)

After:

![image](https://user-images.githubusercontent.com/1593513/138743955-90abcdcd-fc88-4e2f-95bb-c1b1635c0001.png)

2 years agoAuto merge of #90265 - GuillaumeGomez:rollup-gx3ficp, r=GuillaumeGomez
bors [Mon, 25 Oct 2021 14:40:45 +0000 (14:40 +0000)]
Auto merge of #90265 - GuillaumeGomez:rollup-gx3ficp, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #90017 (Add a couple tests for normalize under binder issues)
 - #90079 (enable `i8mm` target feature on aarch64 and arm)
 - #90233 (Tooltip overflow)
 - #90257 (Changed slice.swap documentation for better readability)
 - #90261 (Move back to linux builder on try builds)

Failed merges:

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

2 years agoRollup merge of #90261 - Mark-Simulacrum:fix-try, r=pietroalbini
Guillaume Gomez [Mon, 25 Oct 2021 14:34:55 +0000 (16:34 +0200)]
Rollup merge of #90261 - Mark-Simulacrum:fix-try, r=pietroalbini

Move back to linux builder on try builds

Apparently deleted the wrong line when trying to revert changes to try in #90100 which I now see still contains the do not merge commit -- maybe I forgot to force push the local changes I had pending or something.

r? `@pietroalbini`

2 years agoRollup merge of #90257 - zommiommy:patch-1, r=m-ou-se
Guillaume Gomez [Mon, 25 Oct 2021 14:34:54 +0000 (16:34 +0200)]
Rollup merge of #90257 - zommiommy:patch-1, r=m-ou-se

Changed slice.swap documentation for better readability

The example exchanges the letters "b" and "d", these can be easily confused and are hard to read for people with dyslexia.
Therefore, I changed the example to a more easily readable one.

This is just a small fix and it's not urgent by any means, but I spent 5 minutes trying to understand why I couldn't see any change so I fixed it.

Anyway, thank you for all your works!

2 years agoRollup merge of #90233 - GuillaumeGomez:tooltip-overflow, r=camelid
Guillaume Gomez [Mon, 25 Oct 2021 14:34:53 +0000 (16:34 +0200)]
Rollup merge of #90233 - GuillaumeGomez:tooltip-overflow, r=camelid

Tooltip overflow

Fixes #89185.

r? ``@camelid``

2 years agoRollup merge of #90079 - SparrowLii:i8mm, r=Amanieu
Guillaume Gomez [Mon, 25 Oct 2021 14:34:52 +0000 (16:34 +0200)]
Rollup merge of #90079 - SparrowLii:i8mm, r=Amanieu

enable `i8mm` target feature on aarch64 and arm

As in https://github.com/rust-lang/stdarch/issues/1233, `i8mm` needs to be turned on to support the implementation of `vmmla` and `vusmmla`neon instructions in stdarch.
r? ``@Amanieu``

2 years agoRollup merge of #90017 - jackh726:issue-tests, r=nikomatsakis
Guillaume Gomez [Mon, 25 Oct 2021 14:34:52 +0000 (16:34 +0200)]
Rollup merge of #90017 - jackh726:issue-tests, r=nikomatsakis

Add a couple tests for normalize under binder issues

Closes #56556
Closes #76956

r? ``@nikomatsakis``

2 years agoadd tests
b-naber [Mon, 25 Oct 2021 14:04:23 +0000 (16:04 +0200)]
add tests

2 years agoexpose default substs in param_env
b-naber [Mon, 25 Oct 2021 13:34:59 +0000 (15:34 +0200)]
expose default substs in param_env

2 years agoMove back to linux builder on try builds
Mark Rousskov [Mon, 25 Oct 2021 13:38:04 +0000 (09:38 -0400)]
Move back to linux builder on try builds

2 years agoFix test
bjorn3 [Mon, 25 Oct 2021 13:15:05 +0000 (15:15 +0200)]
Fix test

2 years agoFixed missing double quote in the patch (slice.swap)
Tommaso Fontana [Mon, 25 Oct 2021 12:13:54 +0000 (14:13 +0200)]
Fixed missing double quote in the patch (slice.swap)

2 years agoChanged slice.swap documentation for better readability
Tommaso Fontana [Mon, 25 Oct 2021 11:51:34 +0000 (13:51 +0200)]
Changed slice.swap documentation for better readability

using "b" and "d" can be easily confused

2 years agoAvoid a branch on key being local for queries that use the same local and extern...
bjorn3 [Sun, 30 May 2021 15:24:54 +0000 (17:24 +0200)]
Avoid a branch on key being local for queries that use the same local and extern providers

2 years agoAuto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrum
bors [Mon, 25 Oct 2021 11:31:47 +0000 (11:31 +0000)]
Auto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrum

Bump bootstrap compiler to 1.57

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

r? `@Mark-Simulacrum`

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 25 Oct 2021 10:30:24 +0000 (13:30 +0300)]
:arrow_up: rust-analyzer

2 years agoFix scrollbars appearing on information tooltip on mac when they shouldn't
Guillaume Gomez [Sun, 24 Oct 2021 13:28:58 +0000 (15:28 +0200)]
Fix scrollbars appearing on information tooltip on mac when they shouldn't

2 years agoFix clippy lints in librustdoc
Guillaume Gomez [Fri, 1 Oct 2021 15:12:39 +0000 (17:12 +0200)]
Fix clippy lints in librustdoc

2 years agoAuto merge of #90249 - matthiaskrgr:rollup-xwtfhq3, r=matthiaskrgr
bors [Mon, 25 Oct 2021 08:22:07 +0000 (08:22 +0000)]
Auto merge of #90249 - matthiaskrgr:rollup-xwtfhq3, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #89889 (Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate)
 - #90127 (Do not mention a reexported item if it's private)
 - #90143 (tidy: Remove submodules from edition exception list)
 - #90238 (Add alias for guillaume.gomez@huawei.com)

Failed merges:

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

2 years agoenable `i8mm` on arm
SparrowLii [Mon, 25 Oct 2021 07:10:14 +0000 (15:10 +0800)]
enable `i8mm` on arm

2 years agoenable `i8mm` target feature on aarch64
SparrowLii [Wed, 20 Oct 2021 02:19:23 +0000 (10:19 +0800)]
enable `i8mm` target feature on aarch64

2 years agoRollup merge of #90238 - GuillaumeGomez:mailmap-alias, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 05:54:16 +0000 (07:54 +0200)]
Rollup merge of #90238 - GuillaumeGomez:mailmap-alias, r=Mark-Simulacrum

Add alias for guillaume.gomez@huawei.com

Hopefully it'll stop making me appear twice in the thanks page. :)

2 years agoRollup merge of #90143 - camelid:tidy-2021-followup, r=Mark-Simulacrum
Matthias Krüger [Mon, 25 Oct 2021 05:54:15 +0000 (07:54 +0200)]
Rollup merge of #90143 - camelid:tidy-2021-followup, r=Mark-Simulacrum

tidy: Remove submodules from edition exception list

Both style-check and date-check are now on the 2021 edition, and this
PR also updates their repositories' submodules.

cc rust-lang/rustc-dev-guide#1238
cc rust-lang/reference#1099
cc https://github.com/rust-lang/rust/pull/89103#discussion_r711783714

2 years agoRollup merge of #90127 - JohnTitor:fix-90113, r=estebank
Matthias Krüger [Mon, 25 Oct 2021 05:54:13 +0000 (07:54 +0200)]
Rollup merge of #90127 - JohnTitor:fix-90113, r=estebank

Do not mention a reexported item if it's private

Fixes #90113
The _actual_ regression was introduced in #73652, then #88838 made it worse. This fixes the issue by not counting such an import as a candidate.

2 years agoRollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandry
Matthias Krüger [Mon, 25 Oct 2021 05:54:12 +0000 (07:54 +0200)]
Rollup merge of #89889 - estebank:unmet-send-bound-on-foreign-future, r=tmandry

Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate

Partly address #78543 by making the error quieter.

We don't have access to the `typeck` tables from foreign crates, so we
used to completely skip the new code when checking foreign crates. Now,
we carry on and don't provide as nice output (we don't clarify *what* is
making the `Future: !Send`), but at least we no longer emit a sea of
derived obligations in the output.

[1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html

r? `@tmandry`

2 years agoAuto merge of #89808 - tmiasko:llvm-multithreaded, r=nagisa
bors [Mon, 25 Oct 2021 05:28:07 +0000 (05:28 +0000)]
Auto merge of #89808 - tmiasko:llvm-multithreaded, r=nagisa

Cleanup LLVM multi-threading checks

The support for runtime multi-threading was removed from LLVM. Calls to
`LLVMStartMultithreaded` became no-ops equivalent to checking if LLVM
was compiled with support for threads http://reviews.llvm.org/D4216.

2 years agoAuto merge of #90210 - cjgillot:qarray2, r=Mark-Simulacrum
bors [Mon, 25 Oct 2021 01:10:50 +0000 (01:10 +0000)]
Auto merge of #90210 - cjgillot:qarray2, r=Mark-Simulacrum

Build the query vtable directly.

Continuation of https://github.com/rust-lang/rust/pull/89978.

This shrinks the query interface and attempts to reduce the amount of function pointer calls.

2 years agoAuto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726
bors [Sun, 24 Oct 2021 22:26:41 +0000 (22:26 +0000)]
Auto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726

Point at overlapping impls when type annotations are needed

Address https://github.com/rust-lang/rust/issues/89254.

2 years agotidy: Remove submodules from edition exception list
Noah Lev [Sun, 24 Oct 2021 20:27:13 +0000 (13:27 -0700)]
tidy: Remove submodules from edition exception list

Both style-check and date-check are now on the 2021 edition, and this
commit also updates their repositories' submodules.

2 years agoUse the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate
Esteban Kuber [Thu, 14 Oct 2021 17:57:39 +0000 (17:57 +0000)]
Use the "nice E0277 errors"[1] for `!Send` `impl Future` from foreign crate

Partly address #78543 by making the error quieter.

We don't have access to the `typeck` tables from foreign crates, so we
used to completely skip the new code when checking foreign crates. Now,
we carry on and don't provide as nice output (we don't clarify *what* is
making the `Future: !Send`), but at least we no longer emit a sea of
derived obligations in the output.

[1]: https://blog.rust-lang.org/inside-rust/2019/10/11/AsyncAwait-Not-Send-Error-Improvements.html

2 years agoAlways sort suggestions before emitting them
Esteban Kuber [Fri, 1 Oct 2021 18:09:31 +0000 (18:09 +0000)]
Always sort suggestions before emitting them

2 years agoPoint at overlapping impls when type annotations are needed
Esteban Kuber [Fri, 1 Oct 2021 13:05:17 +0000 (13:05 +0000)]
Point at overlapping impls when type annotations are needed

2 years agoFix and extend ControlFlow `traverse_inorder` example
Ilya Yanok [Sat, 23 Oct 2021 09:40:46 +0000 (11:40 +0200)]
Fix and extend ControlFlow `traverse_inorder` example

1. The existing example compiles on its own, but any usage fails
   to be monomorphised and so doesn't compile. Fix that by using
   a mutable reference as an input argument.
2. Added an example usage of `traverse_inorder` showing how we
   can terminate the traversal early.

Fixes #90063

2 years agoAdd alias for guillaume.gomez@huawei.com
Guillaume Gomez [Sun, 24 Oct 2021 17:55:04 +0000 (19:55 +0200)]
Add alias for guillaume.gomez@huawei.com

2 years agoAuto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr
bors [Sun, 24 Oct 2021 14:12:10 +0000 (14:12 +0000)]
Auto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #89558 (Add rustc lint, warning when iterating over hashmaps)
 - #90100 (Skip documentation for tier 2 targets on dist-x86_64-apple-darwin)
 - #90155 (Fix alignment of method headings for scannability)
 - #90162 (Mark `{array, slice}::{from_ref, from_mut}` as const fn)
 - #90221 (Fix ICE when forgetting to `Box` a parameter to a `Self::func` call)
 - #90234 (Temporarily turn overflow checks off for rustc-rayon-core)

Failed merges:

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

2 years agoRollup merge of #90234 - rusticstuff:rustc-rayon-core-no-overflow-checks, r=Mark...
Matthias Krüger [Sun, 24 Oct 2021 13:48:46 +0000 (15:48 +0200)]
Rollup merge of #90234 - rusticstuff:rustc-rayon-core-no-overflow-checks, r=Mark-Simulacrum

Temporarily turn overflow checks off for rustc-rayon-core

The rustc fork of Rayon has deadlock detection code which intermittently causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227). So, as a workaround, we unconditionally turn overflow checks off for this crate only.

This workaround should be removed once #90227 is fixed.

r? `@Mark-Simulacrum`

cc `@matthiaskrgr`

2 years agoRollup merge of #90221 - JakobDegen:issue-90213, r=cjgillot
Matthias Krüger [Sun, 24 Oct 2021 13:48:45 +0000 (15:48 +0200)]
Rollup merge of #90221 - JakobDegen:issue-90213, r=cjgillot

Fix ICE when forgetting to `Box` a parameter to a `Self::func` call

Closes #90213 .

Assuming we can get the `DefId` of the receiver causes an ICE if the receiver is `Self`. We can just avoid doing this though.

2 years agoRollup merge of #90162 - WaffleLapkin:const_array_slice_from_ref_mut, r=oli-obk
Matthias Krüger [Sun, 24 Oct 2021 13:48:44 +0000 (15:48 +0200)]
Rollup merge of #90162 - WaffleLapkin:const_array_slice_from_ref_mut, r=oli-obk

Mark `{array, slice}::{from_ref, from_mut}` as const fn

This PR marks the following APIs as `const`:
```rust
// core::array
pub const fn from_ref<T>(s: &T) -> &[T; 1];
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1];

// core::slice
pub const fn from_ref<T>(s: &T) -> &[T];
pub const fn from_mut<T>(s: &mut T) -> &mut [T];
```

Note that `from_ref` methods require `const_raw_ptr_deref` feature (which seems totally fine, since it's being stabilized, see #89551), `from_mut` methods require `const_mut_refs` (which seems fine too since this PR marks `from_mut` functions as const unstable).

r? ````@oli-obk````

2 years agoRollup merge of #90155 - jsha:outdent-methods, r=GuillaumeGomez,camelid
Matthias Krüger [Sun, 24 Oct 2021 13:48:44 +0000 (15:48 +0200)]
Rollup merge of #90155 - jsha:outdent-methods, r=GuillaumeGomez,camelid

Fix alignment of method headings for scannability

We sometimes use indentation to indicate something is a heading: The section that comes after is indented by 24px relative to the heading. However, the relationship between the "Implementations" section heading, the `impl` headings it contains, and the `pub fn` subheadings within each impl, is awkward. It goes **Implementations**, 15px indent, `impl`, 5px indent, `pub fn`, 4px indent, docblock.

I line up `impl` and `pub fn` with the `Implementations` heading, give `impl` a larger font size to indicate it is higher in the hierarchy, and indent the docblock a full 24px relative to their parent, matching the indents we use elsewhere to distinguish section headings. By letting the `pub fn` stick out to the left of the docblock, I think this makes methods significantly more scannable.

Related to #59829

r? `````@camelid`````

[Old](https://doc.rust-lang.org/nightly/std/string/struct.String.html#implementations):

[![image](https://user-images.githubusercontent.com/220205/138380233-9c63a0f2-0f80-40a3-ab3d-a1ee9fb7c5d8.png)](https://doc.rust-lang.org/nightly/std/string/struct.String.html#implementations)

[New](https://jacob.hoffman-andrews.com/rust/outdent-methods/std/string/struct.String.html#implementations):

[![image](https://user-images.githubusercontent.com/220205/138392479-b45fce3f-bf43-42e0-81ee-c4bb9ac35cda.png)](https://jacob.hoffman-andrews.com/rust/outdent-methods/std/string/struct.String.html#implementations)

2 years agoRollup merge of #90100 - Mark-Simulacrum:speed-macos-ci, r=pietroalbini
Matthias Krüger [Sun, 24 Oct 2021 13:48:43 +0000 (15:48 +0200)]
Rollup merge of #90100 - Mark-Simulacrum:speed-macos-ci, r=pietroalbini

Skip documentation for tier 2 targets on dist-x86_64-apple-darwin

I don't have an easy way to test this locally, but I believe it should work. Based on one log result should shave ~14 minutes off the dist-x86_64-apple builder (doesn't help with aarch64 dist or x86_64 test builder, so not actually decreasing total CI time most likely).

r? ```@pietroalbini```

2 years agoRollup merge of #89558 - lcnr:query-stable-lint, r=estebank
Matthias Krüger [Sun, 24 Oct 2021 13:48:42 +0000 (15:48 +0200)]
Rollup merge of #89558 - lcnr:query-stable-lint, r=estebank

Add rustc lint, warning when iterating over hashmaps

r? rust-lang/wg-incr-comp

2 years agoTemporarily turn overflow checks off for rustc-rayon-core
Hans Kratz [Sun, 24 Oct 2021 13:36:45 +0000 (15:36 +0200)]
Temporarily turn overflow checks off for rustc-rayon-core

2 years agoAuto merge of #85254 - cjgillot:reveal-mir, r=lcnr
bors [Sun, 24 Oct 2021 11:04:54 +0000 (11:04 +0000)]
Auto merge of #85254 - cjgillot:reveal-mir, r=lcnr

Normalize MIR with RevealAll before optimizations.

Fixes #78442

2 years agoAuto merge of #90208 - Mark-Simulacrum:hash-bytes-fast, r=oli-obk
bors [Sun, 24 Oct 2021 06:29:41 +0000 (06:29 +0000)]
Auto merge of #90208 - Mark-Simulacrum:hash-bytes-fast, r=oli-obk

Specialize HashStable for [u8] slices

Particularly for ctfe-stress-4, the hashing of byte slices as part of the
MIR Allocation is quite hot. Previously, we were falling back on byte-by-byte
copying of the slice into the SipHash buffer (64 bytes long) before hashing a 64
byte chunk, and then doing that again and again; now we use the dedicated byte-slice write.

2 years agoFix ICE when forgetting to `Box` a parameter to a `Self::func` call
Jakob Degen [Sun, 24 Oct 2021 04:33:29 +0000 (00:33 -0400)]
Fix ICE when forgetting to `Box` a parameter to a `Self::func` call

2 years agoIgnore errors re: unreachable blocks in dataflow cursor unit tests
Dylan MacKenzie [Fri, 22 Oct 2021 22:47:36 +0000 (15:47 -0700)]
Ignore errors re: unreachable blocks in dataflow cursor unit tests

2 years agoremove "field is never read" warning
Pietro Albini [Tue, 19 Oct 2021 07:29:19 +0000 (09:29 +0200)]
remove "field is never read" warning

2 years agoupdate cfg(bootstrap)
Pietro Albini [Tue, 19 Oct 2021 07:27:59 +0000 (09:27 +0200)]
update cfg(bootstrap)

2 years agobump boostrap compiler
Pietro Albini [Tue, 19 Oct 2021 07:27:49 +0000 (09:27 +0200)]
bump boostrap compiler

2 years agoAuto merge of #89776 - rusticstuff:ci-overflow-checks, r=Mark-Simulacrum
bors [Sun, 24 Oct 2021 01:21:48 +0000 (01:21 +0000)]
Auto merge of #89776 - rusticstuff:ci-overflow-checks, r=Mark-Simulacrum

CI: Enable overflow checks for test (non-dist) builds

They stay disabled for Apple builds though, which take the most time already due to running on slow hw.

2 years agoAuto merge of #90175 - cuviper:min-llvm-12, r=nagisa
bors [Sat, 23 Oct 2021 20:59:29 +0000 (20:59 +0000)]
Auto merge of #90175 - cuviper:min-llvm-12, r=nagisa

Update the minimum external LLVM to 12

With this change, we'll have stable support for LLVM 12 and 13.
For reference, the previous increase to LLVM 10 was #83387,
and this replaces the pending increase to LLVM 11 in #90062.

r? `@nagisa` `@nikic`

2 years agoAdd tests for `const_slice_from_ref` and `const_array_from_ref`
Maybe Waffle [Sat, 23 Oct 2021 19:51:22 +0000 (22:51 +0300)]
Add tests for `const_slice_from_ref` and `const_array_from_ref`

2 years agoOutdent method headings so they stand out
Jacob Hoffman-Andrews [Fri, 22 Oct 2021 01:46:47 +0000 (18:46 -0700)]
Outdent method headings so they stand out

The makes the heading / documentation distinction clearer.

2 years agoFill tracking issue for `const_slice_from_ref` and `const_array_from_ref`
Maybe Waffle [Sat, 23 Oct 2021 17:59:15 +0000 (20:59 +0300)]
Fill tracking issue for `const_slice_from_ref` and `const_array_from_ref`

2 years agobless the line changes in ui/asm/aarch64/srcloc.rs
Josh Stone [Sat, 23 Oct 2021 17:16:09 +0000 (10:16 -0700)]
bless the line changes in ui/asm/aarch64/srcloc.rs

2 years agoDo not require QueryCtxt for cache_on_disk.
Camille GILLOT [Sat, 23 Oct 2021 16:12:43 +0000 (18:12 +0200)]
Do not require QueryCtxt for cache_on_disk.

2 years agoSpecialize HashStable for [u8] slices
Mark Rousskov [Sat, 23 Oct 2021 16:11:05 +0000 (12:11 -0400)]
Specialize HashStable for [u8] slices

Particularly for ctfe-stress-4, the hashing of byte slices as part of the
MIR Allocation is quite hot. Previously, we were falling back on byte-by-byte
copying of the slice into the SipHash buffer (64 bytes long) before hashing a 64
byte chunk, and then doing that again and again.

This should hopefully be an improvement for that code.

2 years agoAuto merge of #90203 - matthiaskrgr:rollup-v215wew, r=matthiaskrgr
bors [Sat, 23 Oct 2021 15:53:50 +0000 (15:53 +0000)]
Auto merge of #90203 - matthiaskrgr:rollup-v215wew, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #85833 (Scrape code examples from examples/ directory for Rustdoc)
 - #88041 (Make all proc-macro back-compat lints deny-by-default)
 - #89829 (Consider types appearing in const expressions to be invariant)
 - #90168 (Reset qualifs when a storage of a local ends)
 - #90198 (Add caveat about changing parallelism and function call overhead)

Failed merges:

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

2 years agoBuild the query vtable directly.
Camille GILLOT [Sun, 17 Oct 2021 15:37:20 +0000 (17:37 +0200)]
Build the query vtable directly.

2 years agoRollup merge of #90198 - the8472:available-parallelism-runtime, r=joshtriplett
Matthias Krüger [Sat, 23 Oct 2021 12:58:43 +0000 (14:58 +0200)]
Rollup merge of #90198 - the8472:available-parallelism-runtime, r=joshtriplett

Add caveat about changing parallelism and function call overhead

As discussed in https://github.com/rust-lang/rust/pull/89670#discussion_r728179584

r? ``@joshtriplett``

2 years agoRollup merge of #90168 - tmiasko:const-qualif-storage, r=matthewjasper
Matthias Krüger [Sat, 23 Oct 2021 12:58:42 +0000 (14:58 +0200)]
Rollup merge of #90168 - tmiasko:const-qualif-storage, r=matthewjasper

Reset qualifs when a storage of a local ends

Reset qualifs when a storage of a local ends to ensure that the local qualifs
are affected by the state from previous loop iterations only if the local is
kept alive.

The change should be forward compatible with a stricter handling of indirect
assignments, since storage dead invalidates all existing pointers to the local.

2 years agoRollup merge of #89829 - voidc:assoc-const-variance, r=lcnr
Matthias Krüger [Sat, 23 Oct 2021 12:58:41 +0000 (14:58 +0200)]
Rollup merge of #89829 - voidc:assoc-const-variance, r=lcnr

Consider types appearing in const expressions to be invariant

This is an approach to fix #80977.
Currently, a type parameter which is only used in a constant expression is considered bivariant and will trigger error E0392 *"parameter T is never used"*.
Here is a short example:

```rust
pub trait Foo {
    const N: usize;
}

struct Bar<T: Foo>([u8; T::N])
where [(); T::N]:;
```
([playgound](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=b51a272853f75925e72efc1597478aa5))

While it is possible to silence this error by adding a `PhantomData<T>` field, I think the better solution would be to make `T` invariant.
This would be analogous to the invariance constraints added for associated types.
However, I'm quite new to the compiler and unsure whether this is the right approach.

r? ``@varkor`` (since you authored #60058)

2 years agoRollup merge of #88041 - Aaron1011:deny-proc-macro-hack, r=wesleywiser
Matthias Krüger [Sat, 23 Oct 2021 12:58:40 +0000 (14:58 +0200)]
Rollup merge of #88041 - Aaron1011:deny-proc-macro-hack, r=wesleywiser

Make all proc-macro back-compat lints deny-by-default

The affected crates have had plenty of time to update.
By keeping these as lints rather than making them hard errors,
we ensure that downstream crates will still be able to compile,
even if they transitive depend on broken versions of the affected
crates.

This should hopefully discourage anyone from writing any
new code which relies on the backwards-compatibility behavior.

2 years agoRollup merge of #85833 - willcrichton:example-analyzer, r=jyn514
Matthias Krüger [Sat, 23 Oct 2021 12:58:39 +0000 (14:58 +0200)]
Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514

Scrape code examples from examples/ directory for Rustdoc

Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123

Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525

Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and

2 years agoAuto merge of #90104 - spastorino:coherence-for-negative-trait, r=nikomatsakis
bors [Sat, 23 Oct 2021 12:51:15 +0000 (12:51 +0000)]
Auto merge of #90104 - spastorino:coherence-for-negative-trait, r=nikomatsakis

Implement coherence checks for negative trait impls

The main purpose of this PR is to be able to [move Error trait to core](https://github.com/rust-lang/project-error-handling/issues/3).

This feature is necessary to handle the following from impl on box.

```rust
impl From<&str> for Box<dyn Error> { ... }
```

Without having negative traits affect coherence moving the error trait into `core` and moving that `From` impl to `alloc` will cause the from impl to no longer compiler because of a potential future incompatibility. The compiler indicates that `&str` _could_ introduce an `Error` impl in the future, and thus prevents the `From` impl in `alloc` that would cause overlap with `From<E: Error> for Box<dyn Error>`. Adding `impl !Error for &str {}` with the negative trait coherence feature will disable this error by encoding a stability guarantee that `&str` will never implement `Error`, making the `From` impl compile.

We would have this in `alloc`:

```rust
impl From<&str> for Box<dyn Error> {} // A
impl<E> From<E> for Box<dyn Error> where E: Error {} // B
```

and this in `core`:

```rust
trait Error {}
impl !Error for &str {}
```

r? `@nikomatsakis`

This PR was built on top of `@yaahc` PR #85764.

Language team proposal: to https://github.com/rust-lang/lang-team/issues/96