]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoImprove selection errors for `~const` trait bounds
Deadbeef [Fri, 24 Dec 2021 14:50:44 +0000 (22:50 +0800)]
Improve selection errors for `~const` trait bounds

2 years agoAuto merge of #93089 - pierwill:rm-outlivesconstraint-ord, r=michaelwoerister
bors [Tue, 25 Jan 2022 08:18:25 +0000 (08:18 +0000)]
Auto merge of #93089 - pierwill:rm-outlivesconstraint-ord, r=michaelwoerister

Remove ordering traits from `OutlivesConstraint`

In two cases where this ordering was used, I've replaced the sorting to use a key that does not rely on `DefId` being `Ord`. This is part of #90317. If I understand correctly, whether this is correct depends on whether the `RegionVid`s are tracked during incremental compilation. But I might be mistaken in this approach. cc `@cjgillot`

2 years agoAuto merge of #93288 - matthiaskrgr:rollup-uu4uwd1, r=matthiaskrgr
bors [Tue, 25 Jan 2022 05:15:21 +0000 (05:15 +0000)]
Auto merge of #93288 - matthiaskrgr:rollup-uu4uwd1, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #88794 (Add a `try_clone()` function to `OwnedFd`.)
 - #93064 (Properly track `DepNode`s in trait evaluation provisional cache)
 - #93118 (Move param count error emission to end of `check_argument_types`)
 - #93144 (Work around missing code coverage data causing llvm-cov failures)
 - #93169 (Fix inconsistency of local blanket impls)
 - #93175 (Implement stable overlap check considering negative traits)
 - #93251 (rustdoc settings: use radio buttons for theme)
 - #93269 (Use error-on-mismatch policy for PAuth module flags.)

Failed merges:

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

2 years agoRollup merge of #93269 - jacobbramley:dev/pauth-option-1, r=petrochenkov
Matthias Krüger [Tue, 25 Jan 2022 04:51:14 +0000 (05:51 +0100)]
Rollup merge of #93269 - jacobbramley:dev/pauth-option-1, r=petrochenkov

Use error-on-mismatch policy for PAuth module flags.

This agrees with Clang, and avoids an error when using LTO with mixed
C/Rust. LLVM considers different behaviour flags to be a mismatch,
even when the flag value itself is the same.

This also makes the flag setting explicit for all uses of
LLVMRustAddModuleFlag.

----

I believe that this fixes #92885, but have only reproduced it locally on Linux hosts so cannot confirm that it fixes the issue as reported.

I have not included a test for this because it is covered by an existing test (`src/test/run-make-fulldeps/cross-lang-lto-clang`). It is not without its problems, though:
* The test requires Clang and `--run-clang-based-tests-with=...` to run, and this is not the case on the CI.
   * Any test I add would have a similar requirement.
* With this patch applied, the test gets further, but it still fails (for other reasons). I don't think that affects #92885.

2 years agoRollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomez
Matthias Krüger [Tue, 25 Jan 2022 04:51:13 +0000 (05:51 +0100)]
Rollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomez

rustdoc settings: use radio buttons for theme

This reduces the number of clicks required to change theme.

Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon.

Demo: https://rustdoc.crud.net/jsha/theme-radio/settings.html

r? ``@GuillaumeGomez``

New:

![image](https://user-images.githubusercontent.com/220205/150702647-4826d525-54fa-439a-b24c-6d5bca6f95bf.png)

Old:

![image](https://user-images.githubusercontent.com/220205/150702669-6a4214ed-1dab-4fee-b1aa-59acfce3dbca.png)

2 years agoRollup merge of #93175 - spastorino:negative-traits-coherence-new, r=nikomatsakis
Matthias Krüger [Tue, 25 Jan 2022 04:51:12 +0000 (05:51 +0100)]
Rollup merge of #93175 - spastorino:negative-traits-coherence-new, r=nikomatsakis

Implement stable overlap check considering negative traits

This PR implement the new disjointness rules for overlap check described in https://rust-lang.github.io/negative-impls-initiative/explainer/coherence-check.html#new-disjointness-rules

r? ``@nikomatsakis``

2 years agoRollup merge of #93169 - CraftSpider:rustdoc-clean-inconsistency, r=GuillaumeGomez
Matthias Krüger [Tue, 25 Jan 2022 04:51:12 +0000 (05:51 +0100)]
Rollup merge of #93169 - CraftSpider:rustdoc-clean-inconsistency, r=GuillaumeGomez

Fix inconsistency of local blanket impls

When a blanket impl is local, go through HIR instead of middle. This fixes inconsistencies with data detected during JSON generation.

Expected this change to take longer. I also tried doing the whole item through existing clean architecture, but it didn't work out trivially, and felt like it would have added more complexity than it removed.

Properly fixes #83718

2 years agoRollup merge of #93144 - wesleywiser:uninhabited_type_code_cov2, r=tmandry
Matthias Krüger [Tue, 25 Jan 2022 04:51:11 +0000 (05:51 +0100)]
Rollup merge of #93144 - wesleywiser:uninhabited_type_code_cov2, r=tmandry

Work around missing code coverage data causing llvm-cov failures

If we do not add code coverage instrumentation to the `Body` of a
function, then when we go to generate the function record for it, we
won't write any data and this later causes llvm-cov to fail when
processing data for the entire coverage report.

I've identified two main cases where we do not currently add code
coverage instrumentation to the `Body` of a function:

  1. If the function has a single `BasicBlock` and it ends with a
     `TerminatorKind::Unreachable`.

  2. If the function is created using a proc macro of some kind.

For case 1, this is typically not important as this most often occurs as
a result of function definitions that take or return uninhabited
types. These kinds of functions, by definition, cannot even be called so
they logically should not be counted in code coverage statistics.

For case 2, I haven't looked into this very much but I've noticed while
testing this patch that (other than functions which are covered by case
1) the skipped function coverage debug message is occasionally triggered
in large crate graphs by functions generated from a proc macro. This may
have something to do with weird spans being generated by the proc macro
but this is just a guess.

I think it's reasonable to land this change since currently, we fail to
generate *any* results from llvm-cov when a function has no coverage
instrumentation applied to it. With this change, we get coverage data
for all functions other than the two cases discussed above.

Fixes #93054 which occurs because of uncallable functions which shouldn't
have code coverage anyway.

I will open an issue for missing code coverage of proc macro generated
functions and leave a link here once I have a more minimal repro.

r? ``@tmandry``
cc ``@richkadel``

2 years agoRollup merge of #93118 - jackh726:param-heuristics-3, r=estebank
Matthias Krüger [Tue, 25 Jan 2022 04:51:10 +0000 (05:51 +0100)]
Rollup merge of #93118 - jackh726:param-heuristics-3, r=estebank

Move param count error emission to end of `check_argument_types`

The error emission here isn't exactly what is done in #92364, but replicating that is hard . The general move should make for a smaller diff.

Also included the `(usize, Ty, Ty)` to -> `Option<(Ty, Ty)>` commit.

r? ``@estebank``

2 years agoRollup merge of #93064 - Aaron1011:provisional-dep-node, r=michaelwoerister
Matthias Krüger [Tue, 25 Jan 2022 04:51:10 +0000 (05:51 +0100)]
Rollup merge of #93064 - Aaron1011:provisional-dep-node, r=michaelwoerister

Properly track `DepNode`s in trait evaluation provisional cache

Fixes #92987

During evaluation of an auto trait predicate, we may encounter a cycle.
This causes us to store the evaluation result in a special 'provisional
cache;. If we later end up determining that the type can legitimately
implement the auto trait despite the cycle, we remove the entry from
the provisional cache, and insert it into the evaluation cache.

Additionally, trait evaluation creates a special anonymous `DepNode`.
All queries invoked during the predicate evaluation are added as
outoging dependency edges from the `DepNode`. This `DepNode` is then
store in the evaluation cache - if a different query ends up reading
from the cache entry, it will also perform a read of the stored
`DepNode`. As a result, the cached evaluation will still end up
(transitively) incurring all of the same dependencies that it would
if it actually performed the uncached evaluation (e.g. a call to
`type_of` to determine constituent types).

Previously, we did not correctly handle the interaction between the
provisional cache and the created `DepNode`. Storing an evaluation
result in the provisional cache would cause us to lose the `DepNode`
created during the evaluation. If we later moved the entry from the
provisional cache to the evaluation cache, we would use the `DepNode`
associated with the evaluation that caused us to 'complete' the cycle,
not the evaluatoon where we first discovered the cycle. As a result,
future reads from the evaluation cache would miss some incremental
compilation dependencies that would have otherwise been added if the
evaluation was *not* cached.

Under the right circumstances, this could lead to us trying to force
a query with a no-longer-existing `DefPathHash`, since we were missing
the (red) dependency edge that would have caused us to bail out before
attempting forcing.

This commit makes the provisional cache store the `DepNode` create
during the provisional evaluation. When we move an entry from the
provisional cache to the evaluation cache, we create a *new* `DepNode`
that has dependencies going to *both* of the evaluation `DepNodes` we
have available. This ensures that cached reads will incur all of
the necessary dependency edges.

2 years agoRollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplett
Matthias Krüger [Tue, 25 Jan 2022 04:51:09 +0000 (05:51 +0100)]
Rollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplett

Add a `try_clone()` function to `OwnedFd`.

As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by
refactoring the code out of the existing `File`/`Socket` code.

r? ``@joshtriplett``

2 years agoAuto merge of #90842 - pierwill:localdefid-indexmap, r=wesleywiser
bors [Mon, 24 Jan 2022 22:04:55 +0000 (22:04 +0000)]
Auto merge of #90842 - pierwill:localdefid-indexmap, r=wesleywiser

Use `indexmap` to avoid sorting `LocalDefId`s

See discussion in https://github.com/rust-lang/rust/pull/90408#discussion_r745935459.

Related to work on https://github.com/rust-lang/rust/issues/90317.

2 years agoUse error-on-mismatch policy for PAuth module flags.
Jacob Bramley [Wed, 19 Jan 2022 14:51:59 +0000 (14:51 +0000)]
Use error-on-mismatch policy for PAuth module flags.

This agrees with Clang, and avoids an error when using LTO with mixed
C/Rust. LLVM considers different behaviour flags to be a mismatch,
even when the flag value itself is the same.

This also makes the flag setting explicit for all uses of
LLVMRustAddModuleFlag.

2 years agoAuto merge of #93260 - matthiaskrgr:rollup-c5b9c76, r=matthiaskrgr
bors [Mon, 24 Jan 2022 14:30:04 +0000 (14:30 +0000)]
Auto merge of #93260 - matthiaskrgr:rollup-c5b9c76, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #92513 (std: Implement try_reserve and try_reserve_exact on PathBuf)
 - #93152 (Fix STD compilation for the ESP-IDF target (regression from CVE-2022-21658))
 - #93186 (Fix link to CVE-2022-21658)
 - #93188 (rustdoc: fix bump down typing search on Safari)
 - #93212 (Remove unneeded cursor pointer rule on mobile sidebar)
 - #93231 (adjust sidebar link brightness)
 - #93241 (Fix brief appearance of rust logo in the sidebar)
 - #93253 (Update theme on pageshow event)

Failed merges:

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

2 years agoRollup merge of #93253 - jsha:theme-on-show, r=GuillaumeGomez
Matthias Krüger [Mon, 24 Jan 2022 11:29:57 +0000 (12:29 +0100)]
Rollup merge of #93253 - jsha:theme-on-show, r=GuillaumeGomez

Update theme on pageshow event

When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event.

Demo: https://rustdoc.crud.net/jsha/theme-on-show/std/string/trait.ToString.html

r? `@GuillaumeGomez`

2 years agoRollup merge of #93241 - GuillaumeGomez:rust-logo-appearance, r=jsha
Matthias Krüger [Mon, 24 Jan 2022 11:29:56 +0000 (12:29 +0100)]
Rollup merge of #93241 - GuillaumeGomez:rust-logo-appearance, r=jsha

Fix brief appearance of rust logo in the sidebar

Part of #91374.

I simply removed the CSS animation on the visibility, which now makes it all appear at once. I didn't change the CSS animation on the width though, which gives:

https://user-images.githubusercontent.com/3050060/150689595-067a6e00-9875-40c8-9d8a-1e3031dbcaba.mp4

cc `@camelid`

r? `@jsha`

2 years agoRollup merge of #93231 - conradludgate:doc-link-brightness, r=notriddle
Matthias Krüger [Mon, 24 Jan 2022 11:29:55 +0000 (12:29 +0100)]
Rollup merge of #93231 - conradludgate:doc-link-brightness, r=notriddle

adjust sidebar link brightness

Fairly simple change. I've taken the existing link colour and main body background colours, and made sure that the sidebar+link contrast is the same.

ayu:
- [main content contrast](https://colourcontrast.cc/0f1419/39afd7) - 7.31
- [current sidebar contrast](https://colourcontrast.cc/14191f/39afd7) - 6.97
- [new sidebar contrast](https://colourcontrast.cc/14191f/56b1d9) - 7.30

dark:
- [main content contrast](https://colourcontrast.cc/353535/d2991d) - 4.86
- [current sidebar contrast](https://colourcontrast.cc/14191f/d2991d) - 3.19
- [new sidebar contrast](https://colourcontrast.cc/14191f/fdbf35) - 4.87

light:
- [main content contrast](https://colourcontrast.cc/ffffff/3873ad) - 4.97
- [current sidebar contrast](https://colourcontrast.cc/f5f5f5/3873ad) - 4.56
- [new sidebar contrast](https://colourcontrast.cc/f5f5f5/356da4) - 4.97

2 years agoRollup merge of #93212 - GuillaumeGomez:cursor-pointer-mobile-sidebar, r=jsha
Matthias Krüger [Mon, 24 Jan 2022 11:29:54 +0000 (12:29 +0100)]
Rollup merge of #93212 - GuillaumeGomez:cursor-pointer-mobile-sidebar, r=jsha

Remove unneeded cursor pointer rule on mobile sidebar

Since it's on mobile, there isn't much point in this rule...

r? `@jsha`

2 years agoRollup merge of #93188 - jsha:fix-safari-bumpy-search, r=camelid
Matthias Krüger [Mon, 24 Jan 2022 11:29:53 +0000 (12:29 +0100)]
Rollup merge of #93188 - jsha:fix-safari-bumpy-search, r=camelid

rustdoc: fix bump down typing search on Safari

Fixes #93184.

For some reason, if the search input doesn't have a previous sibling, typing in the search box increases the search-container's size by about 5px on the bottom. Putting in a dummy sibling fixes it.

https://rustdoc.crud.net/jsha/fix-safari-bumpy-search/std/string/struct.String.html

r? `@camelid`

2 years agoRollup merge of #93186 - kraai:fix-CVE-2022-21658-link, r=m-ou-se
Matthias Krüger [Mon, 24 Jan 2022 11:29:52 +0000 (12:29 +0100)]
Rollup merge of #93186 - kraai:fix-CVE-2022-21658-link, r=m-ou-se

Fix link to CVE-2022-21658

The link to CVE-2022-21658 contains a trailing bracket, which causes
it to link to <https://www.cve.org/CVERecord?id=CVE-2022-21658%5D>.

2 years agoRollup merge of #93152 - ivmarkov:master, r=m-ou-se
Matthias Krüger [Mon, 24 Jan 2022 11:29:51 +0000 (12:29 +0100)]
Rollup merge of #93152 - ivmarkov:master, r=m-ou-se

Fix STD compilation for the ESP-IDF target (regression from CVE-2022-21658)

Commit https://github.com/rust-lang/rust/commit/54e22eb7dbb615bd44355028d3fd867aa93c0972 broke the compilation of STD for the ESP-IDF embedded "unix-like" Tier 3 target, because the fix for [CVE-2022-21658](https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html) uses [libc flags](https://github.com/esp-rs/esp-idf-svc/runs/4892221554?check_suite_focus=true) which are not supported on the ESP-IDF platform.

This PR simply redirects the ESP-IDF compilation to the "classic" implementation, similar to REDOX. This should be safe because:
* Neither of the two filesystems supported by ESP-IDF (spiffs and fatfs) support [symlinks](https://github.com/natevw/fatfs/blob/master/README.md) in the first place
* There is no notion of fs permissions at all, as the ESP-IDF is an embedded platform that does not have the notion of users, groups, etc.
* Similarly, ESP-IDF has just one "process" - the firmware itself - which contains the user code and the "OS" fused together and running with all permissions

2 years agoRollup merge of #92513 - Xuanwo:path-buf, r=dtolnay
Matthias Krüger [Mon, 24 Jan 2022 11:29:50 +0000 (12:29 +0100)]
Rollup merge of #92513 - Xuanwo:path-buf, r=dtolnay

std: Implement try_reserve and try_reserve_exact on PathBuf

Part of https://github.com/rust-lang/rust/issues/91789

Signed-off-by: Xuanwo <github@xuanwo.io>
2 years agoAuto merge of #93014 - Kobzol:revert-92103-stable-hash-skip-zero-bytes, r=the8472
bors [Mon, 24 Jan 2022 11:20:01 +0000 (11:20 +0000)]
Auto merge of #93014 - Kobzol:revert-92103-stable-hash-skip-zero-bytes, r=the8472

Revert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher"

Reverts rust-lang/rust#92103. It had a (in retrospect, obvious) correctness problem where changing the order of two adjacent values would produce identical hashes, which is problematic in stable hashing (see [this comment](https://github.com/rust-lang/rust/pull/92103#issuecomment-1014625442)).

I'll try to send the PR again with a fix for this issue.

r? `@the8472`

2 years agoRevert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher"
Jakub Beránek [Mon, 17 Jan 2022 20:26:04 +0000 (21:26 +0100)]
Revert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher"

2 years agoAuto merge of #93028 - compiler-errors:const_drop_bounds, r=fee1-dead
bors [Mon, 24 Jan 2022 08:05:37 +0000 (08:05 +0000)]
Auto merge of #93028 - compiler-errors:const_drop_bounds, r=fee1-dead

Check `const Drop` impls considering `~const` Bounds

 This PR adds logic to trait selection to account for `~const` bounds in custom `impl const Drop` for types, elaborates the `const Drop` check in `rustc_const_eval` to check those bounds, and steals some drop linting fixes from #92922, thanks `@DrMeepster.`

r? `@fee1-dead` `@oli-obk` <sup>(edit: guess I can't request review from two people, lol)</sup>
since each of you wrote and reviewed #88558, respectively.

Since the logic here is more complicated than what existed, it's possible that this is a perf regression. But it works correctly with tests, and that makes me happy.

Fixes #92881

2 years agoUpdate theme on pageshow event
Jacob Hoffman-Andrews [Sun, 23 Jan 2022 21:04:17 +0000 (13:04 -0800)]
Update theme on pageshow event

When a user goes forward or back, the page may be rendered from the
back/forward cache (https://web.dev/bfcache/) rather than from scratch. If
they have changed theme in the meantime, that means seeing an incorrect
theme on the page they went forward or back to. The `pageshow` event
fires on such navigations, so we can update the theme based on that event.

2 years agorustdoc settings: use radio buttons for theme
Jacob Hoffman-Andrews [Sun, 23 Jan 2022 23:11:10 +0000 (15:11 -0800)]
rustdoc settings: use radio buttons for theme

This reduces the number of clicks required to change theme.

Also, simplify the UI a bit (remove setting grouping), and add a "Back"
link close to the settings icon.

2 years agoAuto merge of #93245 - matthiaskrgr:rollup-djsi6jr, r=matthiaskrgr
bors [Sun, 23 Jan 2022 23:09:23 +0000 (23:09 +0000)]
Auto merge of #93245 - matthiaskrgr:rollup-djsi6jr, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #91526 (rustc_lint: Some early linting refactorings)
 - #92555 (Implement RFC 3151: Scoped threads.)
 - #93213 (Fix `let_chains` and `if_let_guard` feature flags)
 - #93219 (Add preliminary support for inline assembly for msp430.)
 - #93226 (Normalize field access types during borrowck)
 - #93227 (Liberate late bound regions when collecting GAT substs in wfcheck)
 - #93229 (Remove DiagnosticBuilder.quiet)
 - #93234 (rustc_mir_itertools: Avoid needless `collect` with itertools)

Failed merges:

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

2 years agorustdoc: fix bump down typing search on Safari
Jacob Hoffman-Andrews [Sun, 23 Jan 2022 20:55:31 +0000 (12:55 -0800)]
rustdoc: fix bump down typing search on Safari

2 years agoFIXME include regions too
Santiago Pastorino [Sun, 23 Jan 2022 00:28:12 +0000 (21:28 -0300)]
FIXME include regions too

2 years agoRename strict_check to negative_impl_exists
Santiago Pastorino [Sun, 23 Jan 2022 00:25:56 +0000 (21:25 -0300)]
Rename strict_check to negative_impl_exists

2 years agoDocument OverlapMode
Santiago Pastorino [Sun, 23 Jan 2022 00:24:11 +0000 (21:24 -0300)]
Document OverlapMode

2 years agoupdate tests
Conrad Ludgate [Sun, 23 Jan 2022 19:26:07 +0000 (19:26 +0000)]
update tests

2 years agoRollup merge of #93234 - mati865:mir-transform-use-itertools, r=jackh726
Matthias Krüger [Sun, 23 Jan 2022 19:13:08 +0000 (20:13 +0100)]
Rollup merge of #93234 - mati865:mir-transform-use-itertools, r=jackh726

rustc_mir_itertools: Avoid needless `collect` with itertools

I don't think this should have measurable perf impact (at least not on perf.rlo benchmarks), it's mostly for readability.

2 years agoRollup merge of #93229 - mark-i-m:noquiet, r=eddyb
Matthias Krüger [Sun, 23 Jan 2022 19:13:07 +0000 (20:13 +0100)]
Rollup merge of #93229 - mark-i-m:noquiet, r=eddyb

Remove DiagnosticBuilder.quiet

r? `@eddyb`

cc https://github.com/rust-lang/rust/issues/69426 `@GuillaumeGomez` `@Manishearth`

2 years agoRollup merge of #93227 - compiler-errors:gat-hrtb-wfcheck, r=jackh726
Matthias Krüger [Sun, 23 Jan 2022 19:13:06 +0000 (20:13 +0100)]
Rollup merge of #93227 - compiler-errors:gat-hrtb-wfcheck, r=jackh726

Liberate late bound regions when collecting GAT substs in wfcheck

The issue here is that the [`GATSubstCollector`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/wfcheck.rs#L604) does not currently do anything wrt `Binder`s, so the GAT substs it copies out have escaping late bound regions when it walks through types like `for<'x> fn() -> Self::Gat<'x>`.

I made that visitor call `liberate_late_bound_regions`, not sure if that's the right thing here or we need to do something else to replace these bound vars with placeholders. I'm not familiar with other code doing anything similar.. But the issue is indeed no longer ICEing.

Fixes #92954

r? `@jackh726`
since you last touched this code, feel free to reassign

2 years agoRollup merge of #93226 - compiler-errors:issue-93141, r=jackh726
Matthias Krüger [Sun, 23 Jan 2022 19:13:05 +0000 (20:13 +0100)]
Rollup merge of #93226 - compiler-errors:issue-93141, r=jackh726

Normalize field access types during borrowck

I think a normalize was just left out here, since we normalize analogously throughout this file.

Fixes #93141

2 years agoRollup merge of #93219 - cr1901:msp430-asm-squashed, r=Amanieu
Matthias Krüger [Sun, 23 Jan 2022 19:13:04 +0000 (20:13 +0100)]
Rollup merge of #93219 - cr1901:msp430-asm-squashed, r=Amanieu

Add preliminary support for inline assembly for msp430.

The `llvm_asm` macro was removed recently, and the MSP430 backend relies on inline assembly to build useful embedded apps. I conveniently "found" time to implement basic support for the new inline `asm` macro syntax with the help of `@Amanieu` :D.

In addition to tests in the compiler, I have tested this locally against deployed MSP430 code and have not found any noticeable differences in firmware operation or `objdump` disassemblies between the old `llvm_asm` and the new `asm` syntax.

2 years agoRollup merge of #93213 - c410-f3r:let-chains-feature, r=matthewjasper
Matthias Krüger [Sun, 23 Jan 2022 19:13:03 +0000 (20:13 +0100)]
Rollup merge of #93213 - c410-f3r:let-chains-feature, r=matthewjasper

Fix `let_chains` and `if_let_guard` feature flags

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

cc #53667

2 years agoRollup merge of #92555 - m-ou-se:scoped-threads, r=Amanieu
Matthias Krüger [Sun, 23 Jan 2022 19:13:02 +0000 (20:13 +0100)]
Rollup merge of #92555 - m-ou-se:scoped-threads, r=Amanieu

Implement RFC 3151: Scoped threads.

This implements https://github.com/rust-lang/rfcs/pull/3151

r? `@Amanieu`

2 years agoRollup merge of #91526 - petrochenkov:earlint, r=cjgillot
Matthias Krüger [Sun, 23 Jan 2022 19:13:00 +0000 (20:13 +0100)]
Rollup merge of #91526 - petrochenkov:earlint, r=cjgillot

rustc_lint: Some early linting refactorings

The first one removes and renames some fields and methods from `EarlyContext`.

The second one uses the set of registered tools (for tool attributes and tool lints) in a more centralized way.

The third one removes creation of a fake `ast::Crate` from `fn pre_expansion_lint`.
Pre-expansion linting is done with per-module granularity on freshly loaded modules, and it previously synthesized an `ast::Crate` to visit non-root modules, now they are visited as modules.
The node ID used for pre-expansion linting is also made more precise (the loaded module ID is used).

2 years agoLiberate late bound regions when collecting GAT substs in wfcheck
Michael Goulet [Sun, 23 Jan 2022 04:36:05 +0000 (20:36 -0800)]
Liberate late bound regions when collecting GAT substs in wfcheck

2 years agoFix brief appearance of rust logo in the sidebar
Guillaume Gomez [Sun, 23 Jan 2022 17:03:07 +0000 (18:03 +0100)]
Fix brief appearance of rust logo in the sidebar

2 years agoAuto merge of #93066 - nnethercote:infallible-decoder, r=bjorn3
bors [Sun, 23 Jan 2022 15:37:43 +0000 (15:37 +0000)]
Auto merge of #93066 - nnethercote:infallible-decoder, r=bjorn3

Make `Decodable` and `Decoder` infallible.

`Decoder` has two impls:
- opaque: this impl is already partly infallible, i.e. in some places it
  currently panics on failure (e.g. if the input is too short, or on a
  bad `Result` discriminant), and in some places it returns an error
  (e.g. on a bad `Option` discriminant). The number of places where
  either happens is surprisingly small, just because the binary
  representation has very little redundancy and a lot of input reading
  can occur even on malformed data.
- json: this impl is fully fallible, but it's only used (a) for the
  `.rlink` file production, and there's a `FIXME` comment suggesting it
  should change to a binary format, and (b) in a few tests in
  non-fundamental ways. Indeed #85993 is open to remove it entirely.

And the top-level places in the compiler that call into decoding just
abort on error anyway. So the fallibility is providing little value, and
getting rid of it leads to some non-trivial performance improvements.

Much of this PR is pretty boring and mechanical. Some notes about
a few interesting parts:
- The commit removes `Decoder::{Error,error}`.
- `InternIteratorElement::intern_with`: the impl for `T` now has the same
  optimization for small counts that the impl for `Result<T, E>` has,
  because it's now much hotter.
- Decodable impls for SmallVec, LinkedList, VecDeque now all use
  `collect`, which is nice; the one for `Vec` uses unsafe code, because
  that gave better perf on some benchmarks.

r? `@bjorn3`

2 years agoAuto merge of #93047 - matthiaskrgr:defer__dist_PlainSourceTarball, r=Mark-Simulacrum
bors [Sun, 23 Jan 2022 12:29:08 +0000 (12:29 +0000)]
Auto merge of #93047 - matthiaskrgr:defer__dist_PlainSourceTarball, r=Mark-Simulacrum

build: dist: defer PlainSourceTarball

Apparently it changes some tool sources and invalidates their fingerprints, forcing us to build them several times (before and after vendoring sources).
I have not dug into why vendoring actually invalidates the figreprints, but moving the vendoring lower in the pipeline seems to avoid the issue.
I could imagine that we somehow write a .cargo/config somewhere which somehow makes subsequent builds use the vendored deps but I was not able to find anything.

I checked the sizes of generated archives pre and post patch and their are the same, so I hope there is no functional change.

Fixes #93033

2 years agoexpand: Pass everything by reference to pre-expansion lint callback
Vadim Petrochenkov [Sat, 11 Dec 2021 07:32:48 +0000 (15:32 +0800)]
expand: Pass everything by reference to pre-expansion lint callback

2 years agorustc_lint: Stop creating a fake `ast::Crate` for running early lints
Vadim Petrochenkov [Tue, 7 Dec 2021 10:28:12 +0000 (18:28 +0800)]
rustc_lint: Stop creating a fake `ast::Crate` for running early lints

Add a trait generalizing over the crate root and freshly loaded modules instead
This also makes node IDs used for pre-expansion linting more precise

2 years agoUpdate clippy
Vadim Petrochenkov [Sat, 4 Dec 2021 15:09:15 +0000 (23:09 +0800)]
Update clippy

2 years agoremove duplicate rule
Conrad Ludgate [Sun, 23 Jan 2022 11:05:04 +0000 (11:05 +0000)]
remove duplicate rule

2 years agorustc_lint: Reuse the set of registered tools from resolver
Vadim Petrochenkov [Tue, 28 Sep 2021 22:17:54 +0000 (01:17 +0300)]
rustc_lint: Reuse the set of registered tools from resolver

2 years agorustc_lint: Remove some redundant fields from `EarlyContext`
Vadim Petrochenkov [Mon, 27 Sep 2021 21:28:49 +0000 (00:28 +0300)]
rustc_lint: Remove some redundant fields from `EarlyContext`

Use consistent function parameter order for early context construction and early linting
Rename some functions to make it clear that they do not necessarily work on the whole crate

2 years agotweak all sidebar colours
Conrad Ludgate [Sun, 23 Jan 2022 10:43:06 +0000 (10:43 +0000)]
tweak all sidebar colours

2 years agoAuto merge of #93220 - matthiaskrgr:rollup-9bkrlk0, r=matthiaskrgr
bors [Sun, 23 Jan 2022 09:16:32 +0000 (09:16 +0000)]
Auto merge of #93220 - matthiaskrgr:rollup-9bkrlk0, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #90666 (Stabilize arc_new_cyclic)
 - #91122 (impl Not for !)
 - #93068 (Fix spacing for `·` between stability and source)
 - #93103 (Tweak `expr.await` desugaring `Span`)
 - #93113 (Unify search input and buttons size)
 - #93168 (update uclibc instructions for new toolchain, add link from platforms doc)
 - #93185 (rustdoc: Make some `pub` items crate-private)
 - #93196 (Remove dead code from build_helper)

Failed merges:

 - #93188 (rustdoc: fix bump down typing search on Safari)

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

2 years agoadjust sidebar link brightness
Conrad Ludgate [Sun, 23 Jan 2022 09:06:44 +0000 (09:06 +0000)]
adjust sidebar link brightness

2 years agoRemove DiagnosticBuilder.quiet
mark [Sun, 23 Jan 2022 06:11:13 +0000 (00:11 -0600)]
Remove DiagnosticBuilder.quiet

2 years agoAdd preliminary support for inline assembly for msp430.
William D. Jones [Thu, 20 Jan 2022 22:44:50 +0000 (17:44 -0500)]
Add preliminary support for inline assembly for msp430.

2 years agoUse an `indexmap` to avoid sorting `LocalDefId`s
pierwill [Thu, 6 Jan 2022 19:27:59 +0000 (13:27 -0600)]
Use an `indexmap` to avoid sorting `LocalDefId`s

Update `indexmap` to 1.8.0.

Bless test

2 years agoNormalize field access types during borrowck
Michael Goulet [Sun, 23 Jan 2022 04:04:44 +0000 (20:04 -0800)]
Normalize field access types during borrowck

2 years agoAuto merge of #93165 - eholk:disable-generator-drop-tracking, r=nikomatsakis
bors [Sun, 23 Jan 2022 02:20:50 +0000 (02:20 +0000)]
Auto merge of #93165 - eholk:disable-generator-drop-tracking, r=nikomatsakis

Disable drop range tracking in generators

Generator drop tracking caused an ICE for generators involving the Never type (Issue #93161). Since this breaks a test case with miri, we temporarily disable drop tracking so miri is unblocked while we properly fix the issue.

2 years agoAdd has tests for blanket_with_local trait methods
Rune Tynan [Sun, 23 Jan 2022 00:55:25 +0000 (19:55 -0500)]
Add has tests for blanket_with_local trait methods

2 years agoRollup merge of #93196 - mati865:remove-build_helper-dead-code, r=Mark-Simulacrum
Matthias Krüger [Sun, 23 Jan 2022 00:09:47 +0000 (01:09 +0100)]
Rollup merge of #93196 - mati865:remove-build_helper-dead-code, r=Mark-Simulacrum

Remove dead code from build_helper

Tested with `./x.py check` ran on x86_64 Linux.

2 years agoRollup merge of #93185 - camelid:crate-private, r=GuillaumeGomez
Matthias Krüger [Sun, 23 Jan 2022 00:09:46 +0000 (01:09 +0100)]
Rollup merge of #93185 - camelid:crate-private, r=GuillaumeGomez

rustdoc: Make some `pub` items crate-private

They don't need to be `pub`. Making them crate-private improves code
clarity and `dead_code` linting.

2 years agoRollup merge of #93168 - skrap:master, r=Amanieu
Matthias Krüger [Sun, 23 Jan 2022 00:09:45 +0000 (01:09 +0100)]
Rollup merge of #93168 - skrap:master, r=Amanieu

update uclibc instructions for new toolchain, add link from platforms doc

2 quick things:
1) `libc` was updated to make use of features in a uclibc version more recent than the recommended toolchain in the target document, so I updated the link.
2) As has been done with other platforms, link directly from the platform support doc to the target-specific document.

2 years agoRollup merge of #93113 - GuillaumeGomez:unify-sizes, r=jsha
Matthias Krüger [Sun, 23 Jan 2022 00:09:44 +0000 (01:09 +0100)]
Rollup merge of #93113 - GuillaumeGomez:unify-sizes, r=jsha

Unify search input and buttons size

Fixes #93060.

Here what it looks like:

![Screenshot from 2022-01-20 21-38-19](https://user-images.githubusercontent.com/3050060/150418571-fefd6538-b3ee-4dd2-b77b-77e96bcfa0ed.png)
![Screenshot from 2022-01-20 21-38-22](https://user-images.githubusercontent.com/3050060/150418570-53ba259b-9bd4-4084-8b43-d74a5752d712.png)

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

r? ``@jsha``

2 years agoRollup merge of #93103 - estebank:await-span, r=nagisa
Matthias Krüger [Sun, 23 Jan 2022 00:09:43 +0000 (01:09 +0100)]
Rollup merge of #93103 - estebank:await-span, r=nagisa

Tweak `expr.await` desugaring `Span`

Fix #93074

2 years agoRollup merge of #93068 - jsha:dot-spacing, r=GuillaumeGomez
Matthias Krüger [Sun, 23 Jan 2022 00:09:42 +0000 (01:09 +0100)]
Rollup merge of #93068 - jsha:dot-spacing, r=GuillaumeGomez

Fix spacing for `·` between stability and source

This puts in an actual space (by adjusting the space-eating operators in our templates), updates the test, and remove the now-unnecessary CSS rule.

r? ``@GuillaumeGomez``

2 years agoRollup merge of #91122 - dtolnay:not, r=m-ou-se
Matthias Krüger [Sun, 23 Jan 2022 00:09:41 +0000 (01:09 +0100)]
Rollup merge of #91122 - dtolnay:not, r=m-ou-se

impl Not for !

The lack of this impl caused trouble for me in some degenerate cases of macro-generated code of the form `if !$cond {...}`, even without `feature(never_type)` on a stable compiler. Namely if `$cond` contains a `return` or `break` or similar diverging expression, which would otherwise be perfectly legal in boolean position, the code previously failed to compile with:

```console
error[E0600]: cannot apply unary operator `!` to type `!`
   --> library/core/tests/ops.rs:239:8
    |
239 |     if !return () {}
    |        ^^^^^^^^^^ cannot apply unary operator `!`
```

2 years agoRollup merge of #90666 - bdbai:arc_new_cyclic, r=m-ou-se
Matthias Krüger [Sun, 23 Jan 2022 00:09:40 +0000 (01:09 +0100)]
Rollup merge of #90666 - bdbai:arc_new_cyclic, r=m-ou-se

Stabilize arc_new_cyclic

This stabilizes feature `arc_new_cyclic` as the implementation has been merged for one year and there is no unresolved questions. The FCP is not started yet.

Closes #75861 .

``@rustbot`` label +T-libs-api

2 years agoAuto merge of #92998 - Amanieu:hashbrown12, r=Mark-Simulacrum
bors [Sat, 22 Jan 2022 23:39:21 +0000 (23:39 +0000)]
Auto merge of #92998 - Amanieu:hashbrown12, r=Mark-Simulacrum

Update hashbrown to 0.12.0

[Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md#v0120---2022-01-17)

2 years agoRestructure the code leveraging in abilities more than modes
Santiago Pastorino [Sat, 22 Jan 2022 21:16:11 +0000 (18:16 -0300)]
Restructure the code leveraging in abilities more than modes

2 years agoFix let_chains and if_let_guard feature flags
Caio [Sat, 22 Jan 2022 20:45:45 +0000 (17:45 -0300)]
Fix let_chains and if_let_guard feature flags

2 years agoAuto merge of #93202 - matthiaskrgr:rollup-rki39xg, r=matthiaskrgr
bors [Sat, 22 Jan 2022 19:26:42 +0000 (19:26 +0000)]
Auto merge of #93202 - matthiaskrgr:rollup-rki39xg, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #85967 (add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target)
 - #92828 (Print a helpful message if unwinding aborts when it reaches a nounwind function)
 - #93012 (Update pulldown-cmark version to fix markdown list issue)
 - #93116 (Simplify use of `map_or`)
 - #93132 (Increase the format version of rustdoc-json-types)
 - #93147 (Interner cleanups)
 - #93153 (Reject unsupported naked functions)
 - #93170 (Add missing GUI test explanations)
 - #93172 (rustdoc: remove dashed underline under main heading)

Failed merges:

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

2 years agoupdate uclibc instructions for new toolchain, add link from platforms doc
Jonah Petri [Fri, 21 Jan 2022 18:08:14 +0000 (13:08 -0500)]
update uclibc instructions for new toolchain, add link from platforms doc

2 years agoRemove unneeded cursor pointer rule on mobile sidebar
Guillaume Gomez [Sat, 22 Jan 2022 18:43:25 +0000 (19:43 +0100)]
Remove unneeded cursor pointer rule on mobile sidebar

2 years agoAdd test for thread::Scope invariance.
Mara Bos [Sat, 22 Jan 2022 16:15:08 +0000 (17:15 +0100)]
Add test for thread::Scope invariance.

2 years agoUpdate stabilization version of arc_new_cyclic
Mara Bos [Sat, 22 Jan 2022 15:48:42 +0000 (15:48 +0000)]
Update stabilization version of arc_new_cyclic

2 years agoAdd tracking issue number for scoped_threads.
Mara Bos [Sat, 22 Jan 2022 15:03:23 +0000 (16:03 +0100)]
Add tracking issue number for scoped_threads.

2 years agoSimplify Send/Sync of std::thread::Packet.
Mara Bos [Sat, 22 Jan 2022 15:02:18 +0000 (16:02 +0100)]
Simplify Send/Sync of std::thread::Packet.

2 years agoRollup merge of #93172 - jsha:re-remove-line, r=camelid
Matthias Krüger [Sat, 22 Jan 2022 14:32:57 +0000 (15:32 +0100)]
Rollup merge of #93172 - jsha:re-remove-line, r=camelid

rustdoc: remove dashed underline under main heading

This was removed in #92797 but accidentally re-introduced by a bad merge in #92861.

r? ```@camelid```

2 years agoRollup merge of #93170 - GuillaumeGomez:gui-tests-explanations, r=jsha
Matthias Krüger [Sat, 22 Jan 2022 14:32:55 +0000 (15:32 +0100)]
Rollup merge of #93170 - GuillaumeGomez:gui-tests-explanations, r=jsha

Add missing GUI test explanations

Some GUI tests didn't have a global explanation about what they were testing. This fixes it.

r? ```@jsha```

2 years agoRollup merge of #93153 - tmiasko:reject-unsupported-naked-functions, r=Amanieu
Matthias Krüger [Sat, 22 Jan 2022 14:32:54 +0000 (15:32 +0100)]
Rollup merge of #93153 - tmiasko:reject-unsupported-naked-functions, r=Amanieu

Reject unsupported naked functions

Transition unsupported naked functions future incompatibility lint into an error:

* Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 #79653. Change into an error fixes a soundness issue described in #32489.

* Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 #87652.

Closes #32490.
Closes #32489.

r? ```@Amanieu``` ```@npmccallum``` ```@joshtriplett```

2 years agoRollup merge of #93147 - nnethercote:interner-cleanups, r=lcnr
Matthias Krüger [Sat, 22 Jan 2022 14:32:53 +0000 (15:32 +0100)]
Rollup merge of #93147 - nnethercote:interner-cleanups, r=lcnr

Interner cleanups

Improve some code that I have found confusing.

r? ```@lcnr```

2 years agoRollup merge of #93132 - Urgau:fix-rustdoc-json-format-version, r=oli-obk
Matthias Krüger [Sat, 22 Jan 2022 14:32:52 +0000 (15:32 +0100)]
Rollup merge of #93132 - Urgau:fix-rustdoc-json-format-version, r=oli-obk

Increase the format version of rustdoc-json-types

PR https://github.com/rust-lang/rust/pull/87648 changed `rustdoc-json-types` without increasing the format version.
https://github.com/rust-lang/rust/commit/e7529d6a3867ed1692818702b40814ee992eba2d#diff-ede26372490522288745c5b3df2b6b2a1cc913dcd09b29af3a49935afe00c7e6

This PR increase the format version by +1 and move the `FORMAT_VERSION` constant to the start of the file to hopefully make it more clear that `rustdoc-json-types` is versioned.

2 years agoRollup merge of #93116 - rust-lang:oli-obk-patch-1, r=jackh726
Matthias Krüger [Sat, 22 Jan 2022 14:32:51 +0000 (15:32 +0100)]
Rollup merge of #93116 - rust-lang:oli-obk-patch-1, r=jackh726

Simplify use of `map_or`

2 years agoRollup merge of #93012 - GuillaumeGomez:pulldown-list, r=camelid
Matthias Krüger [Sat, 22 Jan 2022 14:32:50 +0000 (15:32 +0100)]
Rollup merge of #93012 - GuillaumeGomez:pulldown-list, r=camelid

Update pulldown-cmark version to fix markdown list issue

Fixes #92971.

r? ```@camelid```

2 years agoRollup merge of #92828 - Amanieu:unwind-abort, r=dtolnay
Matthias Krüger [Sat, 22 Jan 2022 14:32:49 +0000 (15:32 +0100)]
Rollup merge of #92828 - Amanieu:unwind-abort, r=dtolnay

Print a helpful message if unwinding aborts when it reaches a nounwind function

This is implemented by routing `TerminatorKind::Abort` back through the panic handler, but with a special flag in the `PanicInfo` which indicates that the panic handler should *not* attempt to unwind the stack and should instead abort immediately.

This is useful for the planned change in https://github.com/rust-lang/lang-team/issues/97 which would make `Drop` impls `nounwind` by default.

### Code

```rust
#![feature(c_unwind)]

fn panic() {
    panic!()
}

extern "C" fn nounwind() {
    panic();
}

fn main() {
    nounwind();
}
```

### Before

```
$ ./test
thread 'main' panicked at 'explicit panic', test.rs:4:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Illegal instruction (core dumped)
```

### After

```
$ ./test
thread 'main' panicked at 'explicit panic', test.rs:4:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'panic in a function that cannot unwind', test.rs:7:1
stack backtrace:
   0:     0x556f8f86ec9b - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdccefe11a6ac4396
   1:     0x556f8f88ac6c - core::fmt::write::he152b28c41466ebb
   2:     0x556f8f85d6e2 - std::io::Write::write_fmt::h0c261480ab86f3d3
   3:     0x556f8f8654fa - std::panicking::default_hook::{{closure}}::h5d7346f3ff7f6c1b
   4:     0x556f8f86512b - std::panicking::default_hook::hd85803a1376cac7f
   5:     0x556f8f865a91 - std::panicking::rust_panic_with_hook::h4dc1c5a3036257ac
   6:     0x556f8f86f079 - std::panicking::begin_panic_handler::{{closure}}::hdda1d83c7a9d34d2
   7:     0x556f8f86edc4 - std::sys_common::backtrace::__rust_end_short_backtrace::h5b70ed0cce71e95f
   8:     0x556f8f865592 - rust_begin_unwind
   9:     0x556f8f85a764 - core::panicking::panic_no_unwind::h2606ab3d78c87899
  10:     0x556f8f85b910 - test::nounwind::hade6c7ee65050347
  11:     0x556f8f85b936 - test::main::hdc6e02cb36343525
  12:     0x556f8f85b7e3 - core::ops::function::FnOnce::call_once::h4d02663acfc7597f
  13:     0x556f8f85b739 - std::sys_common::backtrace::__rust_begin_short_backtrace::h071d40135adb0101
  14:     0x556f8f85c149 - std::rt::lang_start::{{closure}}::h70dbfbf38b685e93
  15:     0x556f8f85c791 - std::rt::lang_start_internal::h798f1c0268d525aa
  16:     0x556f8f85c131 - std::rt::lang_start::h476a7ee0a0bb663f
  17:     0x556f8f85b963 - main
  18:     0x7f64c0822b25 - __libc_start_main
  19:     0x556f8f85ae8e - _start
  20:                0x0 - <unknown>
thread panicked while panicking. aborting.
Aborted (core dumped)
```

2 years agoRollup merge of #85967 - atopia:update-l4re-target, r=petrochenkov
Matthias Krüger [Sat, 22 Jan 2022 14:32:48 +0000 (15:32 +0100)]
Rollup merge of #85967 - atopia:update-l4re-target, r=petrochenkov

add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target

This PR contains the work by ```@humenda``` to update support for the `x86_64-unknown-l4re-uclibc` tier 3 target (published at [humenda/rust](https://github.com/humenda/rust)), rebased and adapted to current rust in follow up commits by myself. The publishing of the rebased changes is authorized and preferred by the original author. As the goal was to distort the original work as little as possible, individual commits introduce changes that are incompatible to the newer code base that the changes were rebased on. These incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.
If you prefer another strategy to mainline these changes while preserving attribution, please let me know.

2 years agoDisable test_try_reserve on Android
Amanieu d'Antras [Sat, 22 Jan 2022 13:51:57 +0000 (13:51 +0000)]
Disable test_try_reserve on Android

2 years agorustc_mir_itertools: Avoid needless `collect` with itertools
Mateusz Mikuła [Sat, 22 Jan 2022 11:12:12 +0000 (12:12 +0100)]
rustc_mir_itertools: Avoid needless `collect` with itertools

2 years agoRemove dead code from build_helper
Mateusz Mikuła [Sat, 22 Jan 2022 11:06:44 +0000 (12:06 +0100)]
Remove dead code from build_helper

2 years agoMove param count error emission to near end of check_argument_types
Jack Huey [Thu, 20 Jan 2022 15:18:23 +0000 (10:18 -0500)]
Move param count error emission to near end of check_argument_types

2 years agoChange signature of point_at_arg_instead_of_call_if_possible
Jack Huey [Sat, 25 Dec 2021 03:57:31 +0000 (22:57 -0500)]
Change signature of point_at_arg_instead_of_call_if_possible

2 years agoFix link to CVE-2022-21658
Matthew James Kraai [Sat, 22 Jan 2022 03:47:35 +0000 (19:47 -0800)]
Fix link to CVE-2022-21658

2 years agorustdoc: Make some `pub` items crate-private
Noah Lev [Sat, 22 Jan 2022 02:41:34 +0000 (18:41 -0800)]
rustdoc: Make some `pub` items crate-private

They don't need to be `pub`. Making them crate-private improves code
clarity and `dead_code` linting.

2 years agoAuto merge of #93173 - matthiaskrgr:rollup-49bj7ta, r=matthiaskrgr
bors [Fri, 21 Jan 2022 23:52:58 +0000 (23:52 +0000)]
Auto merge of #93173 - matthiaskrgr:rollup-49bj7ta, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #91965 (Add more granular `--exclude` in `x.py`)
 - #92467 (Ensure that early-bound function lifetimes are always 'local')
 - #92586 (Set the allocation MIN_ALIGN for espidf to 4.)
 - #92835 (Improve error message for key="value" cfg arguments.)
 - #92843 (Improve string concatenation suggestion)
 - #92963 (Implement tuple array diagnostic)
 - #93046 (Use let_else in even more places)
 - #93109 (Improve `Arc` and `Rc` documentation)
 - #93134 (delete `Stdin::split` forwarder)
 - #93139 (rustdoc: fix overflow-wrap for table layouts)

Failed merges:

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

2 years agoAddress review comments.
Nicholas Nethercote [Wed, 19 Jan 2022 22:59:30 +0000 (09:59 +1100)]
Address review comments.

2 years agoMake `Decodable` and `Decoder` infallible.
Nicholas Nethercote [Tue, 18 Jan 2022 02:22:50 +0000 (13:22 +1100)]
Make `Decodable` and `Decoder` infallible.

`Decoder` has two impls:
- opaque: this impl is already partly infallible, i.e. in some places it
  currently panics on failure (e.g. if the input is too short, or on a
  bad `Result` discriminant), and in some places it returns an error
  (e.g. on a bad `Option` discriminant). The number of places where
  either happens is surprisingly small, just because the binary
  representation has very little redundancy and a lot of input reading
  can occur even on malformed data.
- json: this impl is fully fallible, but it's only used (a) for the
  `.rlink` file production, and there's a `FIXME` comment suggesting it
  should change to a binary format, and (b) in a few tests in
  non-fundamental ways. Indeed #85993 is open to remove it entirely.

And the top-level places in the compiler that call into decoding just
abort on error anyway. So the fallibility is providing little value, and
getting rid of it leads to some non-trivial performance improvements.

Much of this commit is pretty boring and mechanical. Some notes about
a few interesting parts:
- The commit removes `Decoder::{Error,error}`.
- `InternIteratorElement::intern_with`: the impl for `T` now has the same
  optimization for small counts that the impl for `Result<T, E>` has,
  because it's now much hotter.
- Decodable impls for SmallVec, LinkedList, VecDeque now all use
  `collect`, which is nice; the one for `Vec` uses unsafe code, because
  that gave better perf on some benchmarks.

2 years agoRename `Decoder::read_nil` and `read_unit`.
Nicholas Nethercote [Wed, 19 Jan 2022 01:09:19 +0000 (12:09 +1100)]
Rename `Decoder::read_nil` and `read_unit`.

Because `()` is called "unit" and it makes it match
`Encoder::emit_unit`.

2 years agoFix spacing for `·` between stability and source
Jacob Hoffman-Andrews [Wed, 19 Jan 2022 06:54:58 +0000 (22:54 -0800)]
Fix spacing for `·` between stability and source

2 years agoUnify search input and buttons size
Guillaume Gomez [Thu, 20 Jan 2022 13:18:59 +0000 (14:18 +0100)]
Unify search input and buttons size