]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoCheck FromIterator trait impl in prelude collision check.
Mara Bos [Tue, 6 Jul 2021 13:41:22 +0000 (13:41 +0000)]
Check FromIterator trait impl in prelude collision check.

2 years agoAuto merge of #86920 - JohnTitor:rollup-buvzpkr, r=JohnTitor
bors [Wed, 7 Jul 2021 03:31:23 +0000 (03:31 +0000)]
Auto merge of #86920 - JohnTitor:rollup-buvzpkr, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #80918 (Add Integer::log variants)
 - #86717 (Rename some Rust 2021 lints to better names )
 - #86819 (Clean up rustdoc IDs)
 - #86880 (Test ManuallyDrop::clone_from.)
 - #86906 (Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs)
 - #86907 (Migrate `cpu-usage-over-time.py` to Python 3)
 - #86916 (rewrote documentation for thread::yield_now())
 - #86919 (Update books)

Failed merges:

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

2 years agoRollup merge of #86919 - ehuss:update-books, r=ehuss
Yuki Okushi [Wed, 7 Jul 2021 03:17:45 +0000 (12:17 +0900)]
Rollup merge of #86919 - ehuss:update-books, r=ehuss

Update books

## nomicon

8 commits in b9ca313e687c991223e23e5520529815dc281205..7a13537f96af4b9b8e3ea296d6e5c3c7ab72ce9f
2021-06-22 12:02:20 -0400 to 2021-07-05 23:34:47 -0400
- Apply review comments
- Fix some style issues
- Move the list of coercions to the reference
- Add an example that shows the null-pointer opt does not happen
- Remove casting list from the nomicon (rust-lang-nursery/nomicon#287)
- Audit `ignore` annotations (rust-lang-nursery/nomicon#288)
- rename typo "lifetime" to "reference" (rust-lang-nursery/nomicon#286)
- Add an incomplete warning to the top page (rust-lang-nursery/nomicon#274)

## reference

7 commits in d9699fa8f3186440fdaadd703d63d8d42322c176..ab60513a3a5a0591e237fddff5d027a982648392
2021-06-21 12:23:10 -0700 to 2021-07-05 08:27:31 -0700
- fix grammar in Expressions (rust-lang-nursery/reference#1057)
- fix comment in function parameter drop scope example (rust-lang-nursery/reference#1056)
- fix typo in macro-ambiguity.md (rust-lang-nursery/reference#1058)
- Mention (negative) infinity values on float-to-int casting (rust-lang-nursery/reference#1054)
-  (rust-lang-nursery/reference#841)
- Missing TypeParamBounds in TypeAlias (rust-lang-nursery/reference#1036)
- Be more precise about array offset in type layouts (rust-lang-nursery/reference#1034)

## book

34 commits in 55a26488ddefc8433e73a2e8352d70f7a5c7fc2b..a90f07f1e9a7fc75dc9105a6c6f16d5c13edceb0
2021-05-09 12:03:18 -0500 to 2021-07-05 14:43:12 -0400
- Clarify ?Sized syntax. Fixes rust-lang/book#2422.
- Add some notes that macros are different than functions
- Break up a long sentence. Fixes rust-lang/book#2329.
- Further clarify and make consistent the reference to deref coercion
- Update ch04-03-slices.md
- add usage for `String` reference
- Update ch15-02-deref.md (rust-lang/book#2780)
- Remove claim about performance of i32
- Reword to avoid awkward pluralization
- Make the link to the reference relative
- Merge remote-tracking branch 'origin/pr/2753'
- Reword number of library crates a package contains (rust-lang/book#2750)
- Clarify explanation of why you can test private functions; add link
- Merge remote-tracking branch 'origin/pr/2743'
- Fix code hiding that I broke in eb60fedc9
- Link to the exact later section we're talking about
- improve cross-references for newtype pattern
- ch12-05, listing 12-20: Add missing "does not compile" warning (rust-lang/book#2731)
- cargo format
- Merge remote-tracking branch 'origin/pr/2724'
- Remove ordinal numbers and only refer to indexes to avoid confusion
- Let's mention the former and current authors of tlborm.
- Update tlborm link to point to Veykril's up-to-date version (rust-lang/book#2722)
- Merge remote-tracking branch 'origin/pr/2720'
- Describe the ferris pictures in the alt text
- Merge remote-tracking branch 'origin/pr/2707'
- Reword ... explanation to include the word deprecated, list that first
- Precise that the `...` inclusive range pattern has been replaces (rust-lang/book#2714)
-  (rust-lang/book#2696)
- fix typo: missing "type" after generic (rust-lang/book#2777)
-  (rust-lang/book#2709)
- Remove sentence about how Rust used to be
- Fix a potentially confusing statement about static lifetimes of static variables. (rust-lang/book#2692)
- Replace 'which'. (rust-lang/book#2663)

## rust-by-example

2 commits in 805e016c5792ad2adabb66e348233067d5ea9f10..028f93a61500fe8f746ee7cc6b204ea6c9f42935
2021-05-20 17:08:34 -0300 to 2021-07-06 06:28:53 -0300
- Fix a couple of typos in the `integration_testing.md` file (rust-lang/rust-by-example#1448)
- Fix Structures type list (rust-lang/rust-by-example#1446)

## rustc-dev-guide

13 commits in fe34beddb41dea5cb891032512a8d5b842b99696..60e282559104035985331645907c3d9f842312c5
2021-06-21 21:50:12 +0200 to 2021-07-05 11:21:03 -0400
- Fixed typos in inline code
- Document lang items (rust-lang/rustc-dev-guide#1119)
- More specifics on what future-incompatible lints are used for
- Fix line lens
- Update information on lints particularly on future-incompatible
- Update section of lint store
- Update around half of the January 2021 date references (rust-lang/rustc-dev-guide#1155)
- Create issues for many TODOs (rust-lang/rustc-dev-guide#1163)
- Links from rustc-dev-guide to std-dev-guide (rust-lang/rustc-dev-guide#1152)
- Document how to mark features as incomplete (rust-lang/rustc-dev-guide#1151)
- Remove requests or suggestions about rebase and fixup contradictory to rust-highfive bot comment (rust-lang/rustc-dev-guide#1111)
- Generate glossary table correctly (rust-lang/rustc-dev-guide#1146)
- Correct the wrong serial number (rust-lang/rustc-dev-guide#1147)

## edition-guide

3 commits in c74b2a0d6bf55774cf15d69f05dfe05408b8f81a..5d57b3832f8d308a9f478ce0a69799548f27ad4d
2021-06-14 10:48:27 -0700 to 2021-07-05 10:33:32 +0200
- Add more info for warnings promoted to errors (rust-lang-nursery/edition-guide#247)
- Create triagebot.toml
- Clarify snippets in 2021 panic docs. (rust-lang-nursery/edition-guide#245)

## embedded-book

1 commits in cbec77fbd8eea0c13e390dd9eded1ae200e811d1..506840eb73b0749336e1d5274e16d6393892ee82
2021-06-10 06:26:32 +0000 to 2021-06-24 00:01:32 +0000
- Update book to track quickstart changes  (rust-embedded/book#296)

2 years agoRollup merge of #86916 - godmar:@godmar/thread-yield-documentation-fix, r=joshtriplett
Yuki Okushi [Wed, 7 Jul 2021 03:17:44 +0000 (12:17 +0900)]
Rollup merge of #86916 - godmar:@godmar/thread-yield-documentation-fix, r=joshtriplett

rewrote documentation for thread::yield_now()

The old documentation suggested the use of yield_now for repeated
polling instead of discouraging it; it also made the false claim that
channels are implemented using yield_now. (They are not, except for
a corner case).

2 years agoRollup merge of #86907 - pietroalbini:ci-cpu-stats-python3, r=Mark-Simulacrum
Yuki Okushi [Wed, 7 Jul 2021 03:17:43 +0000 (12:17 +0900)]
Rollup merge of #86907 - pietroalbini:ci-cpu-stats-python3, r=Mark-Simulacrum

Migrate `cpu-usage-over-time.py` to Python 3

The only change here is a fix for `sys.platform` on Linux. Python 3.3 changed the API to return `"linux"` instead of `"linux2"`/`"linux3"`, so this PR uses `.startswith("linux")` to make the code work on Python 3 without breaking Python 2.

2 years agoRollup merge of #86906 - juniorbassani:update-sync-docs, r=yaahc
Yuki Okushi [Wed, 7 Jul 2021 03:17:42 +0000 (12:17 +0900)]
Rollup merge of #86906 - juniorbassani:update-sync-docs, r=yaahc

Replace deprecated compare_and_swap and fix typo in core::sync::atomic::{fence, compiler_fence} docs

2 years agoRollup merge of #86880 - m-ou-se:test-manuallydrop-clone-from, r=Mark-Simulacrum
Yuki Okushi [Wed, 7 Jul 2021 03:17:41 +0000 (12:17 +0900)]
Rollup merge of #86880 - m-ou-se:test-manuallydrop-clone-from, r=Mark-Simulacrum

Test ManuallyDrop::clone_from.

See #86288

2 years agoRollup merge of #86819 - GuillaumeGomez:cleanup-rustdoc-ids, r=jyn514
Yuki Okushi [Wed, 7 Jul 2021 03:17:40 +0000 (12:17 +0900)]
Rollup merge of #86819 - GuillaumeGomez:cleanup-rustdoc-ids, r=jyn514

Clean up rustdoc IDs

I cherry-picked the commit from https://github.com/rust-lang/rust/pull/86178. It adds missing rustdoc IDs (for the HTML) and remove unused ones.

cc `@camelid`

r? `@jyn514`

2 years agoRollup merge of #86717 - rylev:rename, r=nikomatsakis
Yuki Okushi [Wed, 7 Jul 2021 03:17:39 +0000 (12:17 +0900)]
Rollup merge of #86717 - rylev:rename, r=nikomatsakis

Rename some Rust 2021 lints to better names

Based on conversation in https://github.com/rust-lang/rust/issues/85894.

Rename a bunch of Rust 2021 related lints:

Lints that are officially renamed because they are already in beta or stable:
* `disjoint_capture_migration` => `rust_2021_incompatible_closure_captures`
* `or_patterns_back_compat` => `rust_2021_incompatible_or_patterns`
* `non_fmt_panic` => `non_fmt_panics`

Lints that are renamed but don't require any back -compat work since they aren't yet in stable:
* `future_prelude_collision` => `rust_2021_prelude_collisions`
* `reserved_prefix` => `rust_2021_token_prefixes`

Lints that have been discussed but that I did not rename:
* ~`non_fmt_panic` and `bare_trait_object`: is making this plural worth the headache we might cause users?~
* `array_into_iter`: I'm unsure of a good name and whether bothering users with a name change is worth it.

r? `@nikomatsakis`

2 years agoRollup merge of #80918 - yoshuawuyts:int-log2, r=m-ou-se
Yuki Okushi [Wed, 7 Jul 2021 03:17:32 +0000 (12:17 +0900)]
Rollup merge of #80918 - yoshuawuyts:int-log2, r=m-ou-se

Add Integer::log variants

_This is another attempt at landing https://github.com/rust-lang/rust/pull/70835, which was approved by the libs team but failed on Android tests through Bors. The text copied here is from the original issue. The only change made so far is the addition of non-`checked_` variants of the log methods._

_Tracking issue: #70887_

---

This implements `{log,log2,log10}` methods for all integer types. The implementation was provided by `@substack` for use in the stdlib.

_Note: I'm not big on math, so this PR is a best effort written with limited knowledge. It's likely I'll be getting things wrong, but happy to learn and correct. Please bare with me._

## Motivation
Calculating the logarithm of a number is a generally useful operation. Currently the stdlib only provides implementations for floats, which means that if we want to calculate the logarithm for an integer we have to cast it to a float and then back to an int.

> would be nice if there was an integer log2 instead of having to either use the f32 version or leading_zeros() which i have to verify the results of every time to be sure

_— [`@substack,` 2020-03-08](https://twitter.com/substack/status/1236445105197727744)_

At higher numbers converting from an integer to a float we also risk overflows. This means that Rust currently only provides log operations for a limited set of integers.

The process of doing log operations by converting between floats and integers is also prone to rounding errors. In the following example we're trying to calculate `base10` for an integer. We might try and calculate the `base2` for the values, and attempt [a base swap](https://www.rapidtables.com/math/algebra/Logarithm.html#log-rules) to arrive at `base10`. However because we're performing intermediate rounding we arrive at the wrong result:

```rust
// log10(900) = ~2.95 = 2
dbg!(900f32.log10() as u64);

// log base change rule: logb(x) = logc(x) / logc(b)
// log2(900) / log2(10) = 9/3 = 3
dbg!((900f32.log2() as u64) / (10f32.log2() as u64));
```
_[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6bd6c68b3539e400f9ca4fdc6fc2eed0)_

This is somewhat nuanced as a lot of the time it'll work well, but in real world code this could lead to some hard to track bugs. By providing correct log implementations directly on integers we can help prevent errors around this.

## Implementation notes

I checked whether LLVM intrinsics existed before implementing this, and none exist yet. ~~Also I couldn't really find a better way to write the `ilog` function. One option would be to make it a private method on the number, but I didn't see any precedent for that. I also didn't know where to best place the tests, so I added them to the bottom of the file. Even though they might seem like quite a lot they take no time to execute.~~

## References

- [Log rules](https://www.rapidtables.com/math/algebra/Logarithm.html#log-rules)
- [Rounding error playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6bd6c68b3539e400f9ca4fdc6fc2eed0)
- [substack's tweet asking about integer log2 in the stdlib](https://twitter.com/substack/status/1236445105197727744)
- [Integer Logarithm, A. Jaffer 2008](https://people.csail.mit.edu/jaffer/III/ilog.pdf)

2 years agoAuto merge of #86901 - sexxi-goose:query_remove, r=nikomatsakis
bors [Wed, 7 Jul 2021 01:03:41 +0000 (01:03 +0000)]
Auto merge of #86901 - sexxi-goose:query_remove, r=nikomatsakis

Make type_implements_trait not a query

r? `@nikomatsakis`

2 years agoUpdate books
Eric Huss [Wed, 7 Jul 2021 00:07:35 +0000 (17:07 -0700)]
Update books

2 years agoAuto merge of #86911 - bjorn3:crate_info_refactor, r=petrochenkov
bors [Tue, 6 Jul 2021 22:20:43 +0000 (22:20 +0000)]
Auto merge of #86911 - bjorn3:crate_info_refactor, r=petrochenkov

Refactor linker code

This merges `LinkerInfo` into `CrateInfo` as there is no reason to keep them separate. `LinkerInfo::to_linker` is merged into `get_linker` as both have different logic for each linker type and `to_linker` is directly called after `get_linker`. Also contains a couple of small cleanups.

See the individual commits for all changes.

2 years agoFix depnode size
Aman Arora [Tue, 6 Jul 2021 19:55:13 +0000 (15:55 -0400)]
Fix depnode size

2 years agorewrote documentation for thread::yield_now()
Godmar Back [Tue, 6 Jul 2021 19:50:42 +0000 (15:50 -0400)]
rewrote documentation for thread::yield_now()

The old documentation suggested the use of yield_now for repeated
polling instead of discouraging it; it also made the false claim that
channels are implementing using yield_now. (They are not, except for
a corner case).

2 years agoAuto merge of #86636 - wesleywiser:misc_enum_improvements, r=michaelwoerister
bors [Tue, 6 Jul 2021 19:31:24 +0000 (19:31 +0000)]
Auto merge of #86636 - wesleywiser:misc_enum_improvements, r=michaelwoerister

[msvc] Consistently show active variant and fix visualization for single variant enums

Prior to this change, there were a few cases where inspecting an enum in either WinDbg or Visual Studio would not show the active variant name. After these changes, we now consistently show the active variant name as `[variant]` in the debugger.

We also didn't handle single variant enums very well. That is now also resolved.

Before:
![image](https://user-images.githubusercontent.com/831192/123480097-dc8b5f00-d5cf-11eb-93a8-9fc05a97029b.png)

After:
![image](https://user-images.githubusercontent.com/831192/123479966-aa79fd00-d5cf-11eb-955e-9798616a8829.png)

r? `@michaelwoerister`

2 years agoMake type_implements_trait not a query
Aman Arora [Tue, 6 Jul 2021 09:38:15 +0000 (05:38 -0400)]
Make type_implements_trait not a query

2 years agorename rust_2021_token_prefixes to rust_2021_prefixes_incompatible_syntax
Ryan Levick [Tue, 6 Jul 2021 14:33:11 +0000 (16:33 +0200)]
rename rust_2021_token_prefixes to rust_2021_prefixes_incompatible_syntax

2 years agoRename future_prelude_collisions to rust_2021_prelude_collisions
Ryan Levick [Thu, 1 Jul 2021 11:35:33 +0000 (13:35 +0200)]
Rename future_prelude_collisions to rust_2021_prelude_collisions

2 years agorust_2021_token_prefixes
Ryan Levick [Wed, 30 Jun 2021 13:56:50 +0000 (15:56 +0200)]
rust_2021_token_prefixes

2 years agoAdd s to non_fmt_panic
Ryan Levick [Tue, 29 Jun 2021 18:33:31 +0000 (20:33 +0200)]
Add s to non_fmt_panic

2 years agoAllow lint names to have ascii numbers
Ryan Levick [Tue, 29 Jun 2021 18:00:50 +0000 (20:00 +0200)]
Allow lint names to have ascii numbers

2 years agoFix mis-styled code
Ryan Levick [Tue, 29 Jun 2021 15:41:49 +0000 (17:41 +0200)]
Fix mis-styled code

2 years agoRename reserved_prefix lint to reserved_prefixes
Ryan Levick [Tue, 29 Jun 2021 15:20:22 +0000 (17:20 +0200)]
Rename reserved_prefix lint to reserved_prefixes

2 years agoAdd s to FUTURE_PRELUDE_COLLISION
Ryan Levick [Tue, 29 Jun 2021 14:53:44 +0000 (16:53 +0200)]
Add s to FUTURE_PRELUDE_COLLISION

2 years agoChange or_patterns_back_compat lint to rust_2021_incompatible_or_patterns
Ryan Levick [Tue, 29 Jun 2021 14:39:19 +0000 (16:39 +0200)]
Change or_patterns_back_compat lint to rust_2021_incompatible_or_patterns

2 years agoRename lint
Ryan Levick [Tue, 29 Jun 2021 14:05:32 +0000 (16:05 +0200)]
Rename lint

2 years agoRename disjoint_capture_migration lint to rust_2021_incompatible_closure_captures
Ryan Levick [Tue, 29 Jun 2021 13:35:15 +0000 (15:35 +0200)]
Rename disjoint_capture_migration lint to rust_2021_incompatible_closure_captures

2 years agoFix test
bjorn3 [Tue, 6 Jul 2021 17:40:21 +0000 (19:40 +0200)]
Fix test

2 years agoAuto merge of #86572 - rylev:force-warnings-always, r=nikomatsakis
bors [Tue, 6 Jul 2021 16:50:33 +0000 (16:50 +0000)]
Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakis

Force warnings even when can_emit_warnings == false

Fixes an issue mentioned in #85512 with --cap-lints overriding --force-warnings.

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

r? `@ehuss`

2 years agoFold LinkerInfo into CrateInfo
bjorn3 [Tue, 6 Jul 2021 16:28:07 +0000 (18:28 +0200)]
Fold LinkerInfo into CrateInfo

2 years agoDon't store the full LinkerInfo inside Linker impls
bjorn3 [Tue, 6 Jul 2021 16:09:49 +0000 (18:09 +0200)]
Don't store the full LinkerInfo inside Linker impls

2 years agoMerge LinkerInfo::to_linker into get_linker
bjorn3 [Tue, 6 Jul 2021 16:01:44 +0000 (18:01 +0200)]
Merge LinkerInfo::to_linker into get_linker

2 years agoMove get_linker to linker.rs
bjorn3 [Tue, 6 Jul 2021 15:52:11 +0000 (17:52 +0200)]
Move get_linker to linker.rs

2 years agoDon't pass local_crate_name to link_binary separately
bjorn3 [Tue, 6 Jul 2021 15:49:23 +0000 (17:49 +0200)]
Don't pass local_crate_name to link_binary separately

It is already part of CodegenResults

2 years agoRemove unused panic_runtime field from CrateInfo
bjorn3 [Tue, 6 Jul 2021 15:38:27 +0000 (17:38 +0200)]
Remove unused panic_runtime field from CrateInfo

2 years agomigrate cpu-usage-over-time.py to python 3
Pietro Albini [Tue, 6 Jul 2021 13:45:15 +0000 (15:45 +0200)]
migrate cpu-usage-over-time.py to python 3

The only change here is a fix for `sys.platform` on Linux. Python 3.3
changed the API to return "linux" instead of "linux2"/"linux3", so this
commit uses `.startswith("python")` to make the code work on Python 3
without breaking Python 2.

2 years agoAuto merge of #86231 - nagisa:nagisa/abi-allowlist, r=petrochenkov
bors [Tue, 6 Jul 2021 14:02:19 +0000 (14:02 +0000)]
Auto merge of #86231 - nagisa:nagisa/abi-allowlist, r=petrochenkov

Replace per-target ABI denylist with an allowlist

It makes very little sense to maintain denylists of ABIs when, as far as
non-generic ABIs are concerned, targets usually only support a small
subset of the available ABIs.

This has historically been a cause of bugs such as us allowing use of
the platform-specific ABIs on x86 targets – these in turn would cause
LLVM errors or assertions to fire.

In this PR we got rid of the per-target ABI denylists, and instead compute
which ABIs are supported with a simple match based on, mostly, the
`Target::arch` field. Among other things, this makes it impossible to
forget to consider this problem (in either direction) and forces one to
consider what the ABI support looks like when adding an ABI (rarely)
rather than target (often), which should hopefully also reduce the
cognitive load on both contributors as well as reviewers.

Fixes #57182

Sponsored by: standard.ai

---

## Summary for teams

One significant user-facing change after this PR is that there's now a future compat warning when building…

* `stdcall`, `fastcall`, `thiscall` using code with targets other than 32-bit x86 (i386...i686) or *-windows-*;
* `vectorcall` using code when building for targets other than x86 (either 32 or 64 bit) or *-windows-*.

Previously these ABIs have been accepted much more broadly, even for architectures and targets where this made no sense (e.g. on wasm32) and would fall back to the C ABI. In practice this doesn't seem to be used too widely and the [breakages in crater](https://github.com/rust-lang/rust/pull/86231#issuecomment-866300943) that we see are mostly about Windows-specific code that was missing relevant `cfg`s and just happened to successfully `check` on Linux for one reason or another.

The intention is that this warning becomes a hard error after some time.

2 years agoFix failing test on i686-pc-windows-msvc
Wesley Wiser [Tue, 6 Jul 2021 13:55:11 +0000 (09:55 -0400)]
Fix failing test on i686-pc-windows-msvc

2 years agoFix typo in core::sync::atomic::compiler_fence example
Júnior Bassani [Tue, 6 Jul 2021 13:53:14 +0000 (10:53 -0300)]
Fix typo in core::sync::atomic::compiler_fence example

2 years agoReplace deprecated compare_and_swap by compare_exchange_weak in core::sync::atomic...
Júnior Bassani [Tue, 6 Jul 2021 13:50:17 +0000 (10:50 -0300)]
Replace deprecated compare_and_swap by compare_exchange_weak in core::sync::atomic::fence example

2 years agoMove LinkerInfo into CrateInfo
bjorn3 [Tue, 6 Jul 2021 13:31:38 +0000 (15:31 +0200)]
Move LinkerInfo into CrateInfo

2 years agoAdd missing docs and remove dead code
Ryan Levick [Tue, 6 Jul 2021 11:47:03 +0000 (13:47 +0200)]
Add missing docs and remove dead code

2 years agoAuto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, r=michaelwoerister
bors [Tue, 6 Jul 2021 11:31:59 +0000 (11:31 +0000)]
Auto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, r=michaelwoerister

Reland "Merge CrateDisambiguator into StableCrateId"

Reverts https://github.com/rust-lang/rust/pull/85891 as this revert of #85804 made perf even worse.

r? `@Mark-Simulacrum`

2 years agoReplace per-target ABI denylist with an allowlist
Simonas Kazlauskas [Fri, 11 Jun 2021 11:22:13 +0000 (14:22 +0300)]
Replace per-target ABI denylist with an allowlist

It makes very little sense to maintain denylists of ABIs when, as far as
non-generic ABIs are concerned, targets usually only support a small
subset of the available ABIs.

This has historically been a cause of bugs such as us allowing use of
the platform-specific ABIs on x86 targets – these in turn would cause
LLVM errors or assertions to fire.

Fixes #57182

Sponsored by: standard.ai

2 years agoTruncate hex stable crate id to 8 characters (32 bits)
bjorn3 [Mon, 5 Jul 2021 09:33:04 +0000 (11:33 +0200)]
Truncate hex stable crate id to 8 characters (32 bits)

2 years agoMake tcx.stable_crate_id() faster
bjorn3 [Wed, 30 Jun 2021 16:39:28 +0000 (18:39 +0200)]
Make tcx.stable_crate_id() faster

2 years agoRevert "Revert "Update mir opt tests""
bjorn3 [Tue, 8 Jun 2021 16:59:36 +0000 (18:59 +0200)]
Revert "Revert "Update mir opt tests""

This reverts commit 8d5fb5bf7d5c63dcfaea381e00ded67c21fab3a3.

2 years agoRevert "Revert "Update tests""
bjorn3 [Tue, 8 Jun 2021 16:36:38 +0000 (18:36 +0200)]
Revert "Revert "Update tests""

This reverts commit 715c68fe90c6f1d0b3004ad18f16e0811f209992.

2 years agoRevert "Revert "Fix test""
bjorn3 [Tue, 8 Jun 2021 16:36:36 +0000 (18:36 +0200)]
Revert "Revert "Fix test""

This reverts commit 6c5b6985fdce0921fe4ac0247fd026355953c1ea.

2 years agoRevert "Revert "Merge CrateDisambiguator into StableCrateId""
bjorn3 [Tue, 8 Jun 2021 16:36:30 +0000 (18:36 +0200)]
Revert "Revert "Merge CrateDisambiguator into StableCrateId""

This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.

2 years agoAuto merge of #86694 - cjgillot:pmmd, r=petrochenkov
bors [Tue, 6 Jul 2021 08:50:24 +0000 (08:50 +0000)]
Auto merge of #86694 - cjgillot:pmmd, r=petrochenkov

Store macro parent module in ExpnData.

As a consequence, its value is hashed as part of the ExpnId's stable hash.

Closes #85999

2 years agoStore macro parent module in ExpnData.
Camille GILLOT [Mon, 28 Jun 2021 17:29:55 +0000 (19:29 +0200)]
Store macro parent module in ExpnData.

2 years agoAuto merge of #86644 - Stupremee:replace-fakedefids-with-itemid, r=jyn514
bors [Tue, 6 Jul 2021 04:13:52 +0000 (04:13 +0000)]
Auto merge of #86644 - Stupremee:replace-fakedefids-with-itemid, r=jyn514

rustdoc: Replace `FakeDefId` with new `ItemId` type

Follow up from #84707

`@Manishearth` [suggested](https://github.com/rust-lang/rust/pull/84707#issuecomment-831994669) that there should be a new `ItemId` type that can distinguish between auto traits, normal ids, and blanket impls instead of using `FakeDefId`s.

This type is introduced by this PR.

There are still some `FIXME`s left, because I was unsure what the best solution for them would be.

Especially the naming in general now is a bit weird right now and needs to be cleaned up. Now there are no "fake" ids so the `is_fake` method on `Item` does not really make sense and maybe the methods on `ItemId` should be renamed too?

Also, we need to represent the new item ids in the JSON backend somehow.

2 years agoAuto merge of #82985 - cjgillot:lint, r=jackh726
bors [Tue, 6 Jul 2021 00:33:21 +0000 (00:33 +0000)]
Auto merge of #82985 - cjgillot:lint, r=jackh726

Cleanup the computation of lint levels

This now uses an `IndexVec` and a special root `LintStackIndex = 0` to encode command-line levels.

2 years agoFix async-fn-debug-msvc and generator-debug-msvc codegen tests
Wesley Wiser [Mon, 5 Jul 2021 22:38:15 +0000 (18:38 -0400)]
Fix async-fn-debug-msvc and generator-debug-msvc codegen tests

2 years agoAuto merge of #86877 - bjorn3:remove_lib_source, r=petrochenkov
bors [Mon, 5 Jul 2021 21:52:34 +0000 (21:52 +0000)]
Auto merge of #86877 - bjorn3:remove_lib_source, r=petrochenkov

Remove LibSource

The information is stored in used_crate_source too anyway.

Split out of #86105

r? `@petrochenkov`

2 years agoAuto merge of #86891 - JohnTitor:rollup-gy2gan9, r=JohnTitor
bors [Mon, 5 Jul 2021 19:11:43 +0000 (19:11 +0000)]
Auto merge of #86891 - JohnTitor:rollup-gy2gan9, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #83581 (Add std::os::unix::fs::DirEntryExt2::file_name_ref(&self) -> &OsStr)
 - #85377 (aborts: Clarify documentation and comments)
 - #86685 (double-check mutability inside Allocation)
 - #86794 (Stabilize `Seek::rewind()`)
 - #86852 (Remove some doc aliases)
 - #86878 (:arrow_up: rust-analyzer)
 - #86886 (Remove `impl Clean for {Ident, Symbol}`)

Failed merges:

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

2 years agorustdoc: Use `impl_id` and `for_` DefId's for Blanket item id
Justus K [Sat, 3 Jul 2021 19:34:17 +0000 (21:34 +0200)]
rustdoc: Use `impl_id` and `for_` DefId's for Blanket item id

2 years agorustdoc: Add `PrimitiveType` to `ItemId::Primitive`
Justus K [Sat, 3 Jul 2021 15:21:39 +0000 (17:21 +0200)]
rustdoc: Add `PrimitiveType` to `ItemId::Primitive`

2 years agorustdoc: Convert new ItemId's to real Json Ids
Justus K [Sat, 3 Jul 2021 13:29:26 +0000 (15:29 +0200)]
rustdoc: Convert new ItemId's to real Json Ids

2 years agoRevert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"
Justus K [Sun, 27 Jun 2021 07:28:17 +0000 (09:28 +0200)]
Revert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"

This reverts commit 41a345d4c46dad1a98c9993bc78513415994e8ba.

2 years agorustdoc: Store DefId's in ItemId on heap for decreasing Item's size
Justus K [Sat, 26 Jun 2021 18:47:33 +0000 (20:47 +0200)]
rustdoc: Store DefId's in ItemId on heap for decreasing Item's size

2 years agorustdoc: Rename `expect_real` to `expect_def_id`, remove `Item::is_fake`
Justus K [Sat, 26 Jun 2021 15:10:52 +0000 (17:10 +0200)]
rustdoc: Rename `expect_real` to `expect_def_id`, remove `Item::is_fake`

2 years agorustdoc: Replace `FakeDefId` with new `ItemId` type
Justus K [Sat, 26 Jun 2021 11:52:31 +0000 (13:52 +0200)]
rustdoc: Replace `FakeDefId` with new `ItemId` type

2 years agoRollup merge of #86886 - jyn514:no-clean-symbol, r=GuillaumeGomez
Yuki Okushi [Mon, 5 Jul 2021 17:33:18 +0000 (02:33 +0900)]
Rollup merge of #86886 - jyn514:no-clean-symbol, r=GuillaumeGomez

Remove `impl Clean for {Ident, Symbol}`

These were only used once, in a place where it was trivial to replace.
Also, it's unclear what 'clean' would mean for these, so it seems better
to be explicit.

Found while reviewing https://github.com/rust-lang/rust/pull/86841, which makes the same change to `build_macro`, so the two will conflict.

r? `@GuillaumeGomez`

2 years agoRollup merge of #86878 - lnicola:rust-analyzer-2021-07-05, r=lnicola
Yuki Okushi [Mon, 5 Jul 2021 17:33:17 +0000 (02:33 +0900)]
Rollup merge of #86878 - lnicola:rust-analyzer-2021-07-05, r=lnicola

:arrow_up: rust-analyzer

2 years agoRollup merge of #86852 - Amanieu:remove_doc_aliases, r=joshtriplett
Yuki Okushi [Mon, 5 Jul 2021 17:33:16 +0000 (02:33 +0900)]
Rollup merge of #86852 - Amanieu:remove_doc_aliases, r=joshtriplett

Remove some doc aliases

As per the new doc alias policy in https://github.com/rust-lang/std-dev-guide/pull/25, this removes some controversial doc aliases:
- `malloc`, `alloc`, `realloc`, etc.
- `length` (alias for `len`)
- `delete` (alias for `remove` in collections and also file/directory deletion)

r? `@joshtriplett`

2 years agoRollup merge of #86794 - inquisitivecrystal:seek-rewind, r=m-ou-se
Yuki Okushi [Mon, 5 Jul 2021 17:33:15 +0000 (02:33 +0900)]
Rollup merge of #86794 - inquisitivecrystal:seek-rewind, r=m-ou-se

Stabilize `Seek::rewind()`

This stabilizes `Seek::rewind`. It seemed to fit into one of the existing tests, so I extended that test rather than adding a new one.

Closes #85149.

2 years agoRollup merge of #86685 - RalfJung:alloc-mut, r=oli-obk
Yuki Okushi [Mon, 5 Jul 2021 17:33:14 +0000 (02:33 +0900)]
Rollup merge of #86685 - RalfJung:alloc-mut, r=oli-obk

double-check mutability inside Allocation

r? `@oli-obk`

2 years agoRollup merge of #85377 - ijackson:abort-docs, r=m-ou-se
Yuki Okushi [Mon, 5 Jul 2021 17:33:13 +0000 (02:33 +0900)]
Rollup merge of #85377 - ijackson:abort-docs, r=m-ou-se

aborts: Clarify documentation and comments

In the docs for intrinsics::abort():

 * Strengthen the recommendation by to use process::abort instead.
 * Document the fact that it sometimes (ab)uses an LLVM debug trap and what the likely consequences are.
 * State that the precise behaviour is unstable.

In the docs for process::abort():

 * Promise that we have the same behaviour as C `abort()`.
 * Document the likely consequences, including, specifically, the consequences on Unix.

In the internal comment for unix::abort_internal:

 * Refer to the public docs for the public API functions.
 * Correct and expand the description of libc::abort.  Specifically:
 * Do not claim that abort() unregisters signal handlers.  It doesn't; it honours the SIGABRT handler.
 * Discuss, extensively, the issue with abort() flushing stdio buffers.
 * Describe the glibc behaviour in some detail.

Co-authored-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Fixes #40230

2 years agoRollup merge of #83581 - arennow:dir_entry_ext_unix_borrow_name, r=m-ou-se
Yuki Okushi [Mon, 5 Jul 2021 17:33:06 +0000 (02:33 +0900)]
Rollup merge of #83581 - arennow:dir_entry_ext_unix_borrow_name, r=m-ou-se

Add std::os::unix::fs::DirEntryExt2::file_name_ref(&self) -> &OsStr

Greetings!

This is my first PR here, so please forgive me if I've missed an important step or otherwise done something wrong. I'm very open to suggestions/fixes/corrections.

This PR adds a function that allows `std::fs::DirEntry` to vend a borrow of its filename on Unix platforms, which is especially useful for sorting. (Windows has (as I understand it) encoding differences that require an allocation.) This new function sits alongside the cross-platform [`file_name(&self) -> OsString`](https://doc.rust-lang.org/std/fs/struct.DirEntry.html#method.file_name) function.

I pitched this idea in an [internals thread](https://internals.rust-lang.org/t/allow-std-direntry-to-vend-borrows-of-its-filename/14328/4), and no one objected vehemently, so here we are.

I understand features in general, I believe, but I'm not at all confident that my whole-cloth invention of a new feature string (as required by the compiler) was correct (or that the name is appropriate). Further, there doesn't appear to be a test for the sibling `ino` function, so I didn't add one for this similarly trivial function either. If it's desirable that I should do so, I'd be happy to [figure out how to] do that.

The following is a trivial sample of a use-case for this function, in which directory entries are sorted without any additional allocations:

```rust
use std::os::unix::fs::DirEntryExt;
use std::{fs, io};

fn main() -> io::Result<()> {
    let mut entries = fs::read_dir(".")?.collect::<Result<Vec<_>, io::Error>>()?;
    entries.sort_unstable_by(|a, b| a.file_name_ref().cmp(b.file_name_ref()));

    for p in entries {
        println!("{:?}", p);
    }

    Ok(())
}
```

2 years agoAuto merge of #86674 - Aaron1011:new-querify-limits, r=michaelwoerister
bors [Mon, 5 Jul 2021 16:30:53 +0000 (16:30 +0000)]
Auto merge of #86674 - Aaron1011:new-querify-limits, r=michaelwoerister

Query-ify global limit attribute handling

Currently, we read various 'global limits' from inner attributes the crate root (`recursion_limit`, `move_size_limit`, `type_length_limit`, `const_eval_limit`). These limits are then stored in `Sessions`, allowing them to be access from a `TyCtxt` without registering a dependency on the crate root attributes.

This PR moves the calculation of these global limits behind queries, so that we properly track dependencies on crate root attributes. During the setup of macro expansion (before we've created a `TyCtxt`), we need to access the recursion limit, which is now done by directly calling into the code shared by the normal query implementations.

2 years agoDeduplicate info.used_crate_source indexing
bjorn3 [Mon, 5 Jul 2021 15:37:45 +0000 (17:37 +0200)]
Deduplicate info.used_crate_source indexing

2 years agoRemove `impl Clean for {Ident, Symbol}`
Joshua Nelson [Mon, 5 Jul 2021 15:18:13 +0000 (11:18 -0400)]
Remove `impl Clean for {Ident, Symbol}`

These were only used once, in a place where it was trivial to replace.
Also, it's unclear what 'clean' would mean for these, so it seems better
to be explicit.

2 years agoEnable dir_entry_ext2 feature in doc test.
Mara Bos [Mon, 5 Jul 2021 14:26:54 +0000 (16:26 +0200)]
Enable dir_entry_ext2 feature in doc test.

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2 years agoAuto merge of #84560 - cjgillot:inline-iter, r=m-ou-se
bors [Mon, 5 Jul 2021 13:12:07 +0000 (13:12 +0000)]
Auto merge of #84560 - cjgillot:inline-iter, r=m-ou-se

Inline Iterator as IntoIterator.

For some reason, it appears on rustc's own perf stats.

2 years agoTest ManuallyDrop::clone_from.
Mara Bos [Mon, 5 Jul 2021 11:55:45 +0000 (11:55 +0000)]
Test ManuallyDrop::clone_from.

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 5 Jul 2021 11:17:18 +0000 (14:17 +0300)]
:arrow_up: rust-analyzer

2 years agos/die/terminate/ in abort documentation.
Mara Bos [Mon, 5 Jul 2021 10:43:45 +0000 (12:43 +0200)]
s/die/terminate/ in abort documentation.

2 years agoUse american spelling for behaviour
Mara Bos [Mon, 5 Jul 2021 10:40:23 +0000 (12:40 +0200)]
Use american spelling for behaviour

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2 years agoTalk about "terminate" rather than "die"
Ian Jackson [Mon, 7 Jun 2021 11:12:53 +0000 (12:12 +0100)]
Talk about "terminate" rather than "die"

Adapted from a suggestion by @m-ou-se.

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoTalk about invalid instructions rather than debug traps
Ian Jackson [Mon, 7 Jun 2021 11:10:46 +0000 (12:10 +0100)]
Talk about invalid instructions rather than debug traps

And withdraw the allegation of "abuse".

Adapted from a suggestion by @m-ou-se.

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoabort docs: Document buffer non-flushing
Ian Jackson [Mon, 17 May 2021 14:29:47 +0000 (15:29 +0100)]
abort docs: Document buffer non-flushing

There is discussion of this in #40230 which requests clarification.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoabort docs: Do not claim that intrinsics::abort is always a debug trap
Ian Jackson [Mon, 17 May 2021 14:23:47 +0000 (15:23 +0100)]
abort docs: Do not claim that intrinsics::abort is always a debug trap

As per discussion here
 https://github.com/rust-lang/rust/pull/85377#pullrequestreview-660460501

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoaborts: Clarify documentation and comments
Ian Jackson [Thu, 13 May 2021 17:59:41 +0000 (18:59 +0100)]
aborts: Clarify documentation and comments

In the docs for intrinsics::abort():

 * Strengthen the recommendation by to use process::abort instead.
 * Document the fact that it (ab)uses an LLVM debug trap and what the
   likely consequences are.
 * State that the precise behaviour is unstable.

In the docs for process::abort():

 * Promise that we have the same behaviour as C `abort()`.
 * Document the likely consequences, including, specifically, the
   consequences on Unix.

In the internal comment for unix::abort_internal:

 * Refer to the public docs for the public API functions.
 * Correct and expand the description of libc::abort.  Specifically:
 * Do not claim that abort() unregisters signal handlers.  It doesn't;
   it honours the SIGABRT handler.
 * Discuss, extensively, the issue with abort() flushing stdio buffers.
 * Describe the glibc behaviour in some detail.

Co-authored-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 years agoAuto merge of #86861 - RalfJung:miri, r=RalfJung
bors [Mon, 5 Jul 2021 10:21:04 +0000 (10:21 +0000)]
Auto merge of #86861 - RalfJung:miri, r=RalfJung

update miri

Let's get https://github.com/rust-lang/miri/pull/1842 shipped. :)
Also fixes https://github.com/rust-lang/rust/issues/86863
Cc `@rust-lang/miri` r? `@ghost`

2 years agoRemove LibSource
bjorn3 [Mon, 7 Jun 2021 10:18:28 +0000 (12:18 +0200)]
Remove LibSource

The information is stored in used_crate_source too anyway

2 years agoAuto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomez
bors [Mon, 5 Jul 2021 07:27:52 +0000 (07:27 +0000)]
Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomez

Use rustdoc.css for error index

Closes #86512.

2 years agoupdate miri
Ralf Jung [Mon, 5 Jul 2021 07:23:22 +0000 (09:23 +0200)]
update miri

2 years agoAuto merge of #86282 - camelid:macro_rules-matchers, r=jyn514
bors [Mon, 5 Jul 2021 05:09:35 +0000 (05:09 +0000)]
Auto merge of #86282 - camelid:macro_rules-matchers, r=jyn514

Pretty-print macro matchers instead of using source code

Fixes #86208.

3 years agoAuto merge of #86867 - JohnTitor:convert-to-actual-assert, r=jackh726
bors [Mon, 5 Jul 2021 02:05:04 +0000 (02:05 +0000)]
Auto merge of #86867 - JohnTitor:convert-to-actual-assert, r=jackh726

Convert `debug_assert!` to `assert!` in `Binder::dummy`

This is needed for #85350 not to be passed.
r? `@jackh726`

3 years agoAuto merge of #86875 - JohnTitor:rollup-fuefamw, r=JohnTitor
bors [Sun, 4 Jul 2021 22:23:06 +0000 (22:23 +0000)]
Auto merge of #86875 - JohnTitor:rollup-fuefamw, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #86477 (E0716: clarify that equivalent code example is erroneous)
 - #86623 (Add check to ensure error code explanations are not removed anymore even if not emitted)
 - #86856 (Make x.py less verbose on failures)
 - #86858 (Stabilize `string_drain_as_str`)
 - #86859 (Add a regression test for issue-69323)
 - #86862 (re-export SwitchIntEdgeEffects)
 - #86864 (Add missing code example for Write::write_vectored)
 - #86874 (Bump deps)

Failed merges:

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

3 years agoRollup merge of #86874 - klensy:bump-deps, r=Mark-Simulacrum
Yuki Okushi [Sun, 4 Jul 2021 22:13:29 +0000 (07:13 +0900)]
Rollup merge of #86874 - klensy:bump-deps, r=Mark-Simulacrum

Bump deps

tidy: updated cargo_metadata to 0.12 (rustfmt only one left, that depends on 0.8 version in tree, waiting when it merges into rustc repo)

miow v0.3.6 -> v0.3.7, drops socket2 v0.3.19

curl v0.4.36 -> v0.4.38
curl-sys v0.4.42+curl-7.76.0 -> v0.4.44+curl-7.77.0
fixes CVE's https://curl.se/docs/vuln-7.76.0.html

3 years agoRollup merge of #86864 - GuillaumeGomez:example-write-vectored, r=JohnTitor
Yuki Okushi [Sun, 4 Jul 2021 22:13:28 +0000 (07:13 +0900)]
Rollup merge of #86864 - GuillaumeGomez:example-write-vectored, r=JohnTitor

Add missing code example for Write::write_vectored

3 years agoRollup merge of #86862 - tmiasko:re-export-SwitchIntEdgeEffects, r=jonas-schievink
Yuki Okushi [Sun, 4 Jul 2021 22:13:27 +0000 (07:13 +0900)]
Rollup merge of #86862 - tmiasko:re-export-SwitchIntEdgeEffects, r=jonas-schievink

re-export SwitchIntEdgeEffects

This makes it possible to use `switch_int_edge_effects` outside
`rustc_mir::dataflow::impls`.

3 years agoRollup merge of #86859 - JohnTitor:test-69323, r=jackh726
Yuki Okushi [Sun, 4 Jul 2021 22:13:26 +0000 (07:13 +0900)]
Rollup merge of #86859 - JohnTitor:test-69323, r=jackh726

Add a regression test for issue-69323

Closes #69323
r? `@jackh726`

3 years agoRollup merge of #86858 - JohnTitor:stabilize-string-drain-as-str, r=Mark-Simulacrum
Yuki Okushi [Sun, 4 Jul 2021 22:13:25 +0000 (07:13 +0900)]
Rollup merge of #86858 - JohnTitor:stabilize-string-drain-as-str, r=Mark-Simulacrum

Stabilize `string_drain_as_str`

Closes #76905, FCP is done: https://github.com/rust-lang/rust/issues/76905#issuecomment-873461688

3 years agoRollup merge of #86856 - jyn514:x.py-less-verbose, r=Mark-Simulacrum
Yuki Okushi [Sun, 4 Jul 2021 22:13:24 +0000 (07:13 +0900)]
Rollup merge of #86856 - jyn514:x.py-less-verbose, r=Mark-Simulacrum

Make x.py less verbose on failures

- Don't print the exact command run by rustbuild unless `--verbose` is set.
  This is almost always unhelpful, since it's just cargo with a lot of
  arguments (and you can't replicate it anyway unless you have the environment variables, which aren't printed by default).
- Don't print "Build completed unsuccessfully" unless --verbose is set.
  You can already tell the build failed by the errors above, and the
  time isn't particularly helpful.
- Don't print the full path to bootstrap. This is useless to everyone,
  even including when working on x.py itself. You can still opt-in to
  this being shown with `--verbose`, since it will throw an exception.

Before:

```
error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/joshua/rustc4/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/joshua/rustc4/library/test/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
failed to run: /home/joshua/rustc4/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:00:13
```

After:

```
error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.
```

cc https://github.com/rust-lang/rust/issues/86854, https://github.com/rust-lang/rust/pull/86022

r? `@Mark-Simulacrum`

3 years agoRollup merge of #86623 - GuillaumeGomez:prevent-explanation-removal, r=Mark-Simulacrum
Yuki Okushi [Sun, 4 Jul 2021 22:13:23 +0000 (07:13 +0900)]
Rollup merge of #86623 - GuillaumeGomez:prevent-explanation-removal, r=Mark-Simulacrum

Add check to ensure error code explanations are not removed anymore even if not emitted

The error explanations are useful in case you use older version of the compiler. Even more if they had an explanation. If they are not emitted, their explanations should be updated but not removed (as we did for a few of them, like E0001).

r? `@Mark-Simulacrum`