]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot
bors [Tue, 25 Jan 2022 18:53:45 +0000 (18:53 +0000)]
Auto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot

Store a `Symbol` instead of an `Ident` in `AssocItem`

This is the same idea as #92533, but for `AssocItem` instead
of `VariantDef`/`FieldDef`.

With this change, we no longer have any uses of
`#[stable_hasher(project(...))]`

2 years agoAuto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot
bors [Tue, 25 Jan 2022 18:53:45 +0000 (18:53 +0000)]
Auto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot

Store a `Symbol` instead of an `Ident` in `AssocItem`

This is the same idea as #92533, but for `AssocItem` instead
of `VariantDef`/`FieldDef`.

With this change, we no longer have any uses of
`#[stable_hasher(project(...))]`

2 years agoRemove delayed bug when encountering label in bad turbofish
Michael Goulet [Tue, 25 Jan 2022 18:47:10 +0000 (10:47 -0800)]
Remove delayed bug when encountering label in bad turbofish

2 years agoStore hir_id_to_def_id in OwnerInfo.
Camille GILLOT [Sun, 21 Nov 2021 18:04:47 +0000 (19:04 +0100)]
Store hir_id_to_def_id in OwnerInfo.

2 years agomake Windows abort_internal Miri-compatible
Ralf Jung [Tue, 25 Jan 2022 17:41:26 +0000 (12:41 -0500)]
make Windows abort_internal Miri-compatible

2 years agoAdd test when there is no source code link after version
Guillaume Gomez [Tue, 25 Jan 2022 16:20:59 +0000 (17:20 +0100)]
Add test when there is no source code link after version

2 years agoFix invalid extra dot after version if no source
Guillaume Gomez [Tue, 25 Jan 2022 16:09:18 +0000 (17:09 +0100)]
Fix invalid extra dot after version if no source

2 years agoAuto merge of #92353 - Kobzol:doc-attr-lists-gat, r=GuillaumeGomez
bors [Tue, 25 Jan 2022 15:43:29 +0000 (15:43 +0000)]
Auto merge of #92353 - Kobzol:doc-attr-lists-gat, r=GuillaumeGomez

Rustdoc: remove ListAttributesIter and use impl Iterator instead

This is a continuation of https://github.com/rust-lang/rust/pull/92227.

I found that `ListAttributesIter` did not optimize well and replacing it with a simple `impl Iterator` resulted in 1-3 % instruction count wins locally.

Because I needed to use `impl Iterator` on a slice of AST attributes, I had to implement it using GAT + impl trait. I also have a version without GAT [here](https://github.com/Kobzol/rust/commit/5470e2a65cbd3086d19f0847f44ca9cbbc049689), if GATs are not welcome in rustdoc :D Locally it resulted in equal performance numbers.

Can I ask for a perf. run? Thanks.

r? rust-lang/rustdoc

2 years agoRename `TypedArenaChunk` as `ArenaChunk`.
Nicholas Nethercote [Tue, 25 Jan 2022 14:35:52 +0000 (01:35 +1100)]
Rename `TypedArenaChunk` as `ArenaChunk`.

Because it's used within both `TypedArena` and `DroplessArena`.

The commit also makes `<u8>` the default parameter.

2 years agoAdd a minimal working `append_const_msg` argument
Deadbeef [Sat, 15 Jan 2022 18:44:57 +0000 (02:44 +0800)]
Add a minimal working `append_const_msg` argument

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 agorustdoc: Pre-calculate traits that are in scope for doc links
Vadim Petrochenkov [Sun, 29 Aug 2021 18:41:46 +0000 (21:41 +0300)]
rustdoc: Pre-calculate traits that are in scope for doc links

This eliminates one more late use of resolver

2 years agoAuto merge of #8343 - robjtede:patch-1, r=giraffate
bors [Tue, 25 Jan 2022 13:08:10 +0000 (13:08 +0000)]
Auto merge of #8343 - robjtede:patch-1, r=giraffate

Autofocus search input

changelog: autofocus filter input on Clippy Lints page

2 years agoAvoid double panics when using `TempDir` in tests
Chris Denton [Tue, 25 Jan 2022 10:36:10 +0000 (10:36 +0000)]
Avoid double panics when using `TempDir` in tests

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 agogive light-theme fns the correct orange-brown colour
Conrad Ludgate [Tue, 25 Jan 2022 08:00:34 +0000 (08:00 +0000)]
give light-theme fns the correct orange-brown colour

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 agoAdd white-space: nowrap to links in the sidebar
Jacob Hoffman-Andrews [Tue, 25 Jan 2022 04:19:09 +0000 (20:19 -0800)]
Add white-space: nowrap to links in the sidebar

We already have overflow: hidden on these links, but if there is a
possibility to wrap, they will wrap. This happens in particular for trait
implementations because the punctuation (`<>, `) introduces opportunities
for breaks. That produces inconsistent UI. Fix it by forcing them not to
wrap.

2 years agoAutofocus search input
Rob Ede [Mon, 24 Jan 2022 11:36:15 +0000 (11:36 +0000)]
Autofocus search input

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 agoupdate vulnerable/yanked deps
klensy [Mon, 24 Jan 2022 17:19:21 +0000 (20:19 +0300)]
update vulnerable/yanked deps

2 years agoRename SocketAddr::unix to from_path
Thomas de Zeeuw [Mon, 24 Jan 2022 17:00:23 +0000 (18:00 +0100)]
Rename SocketAddr::unix to from_path

And change it to disallow NULL bytes.

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 agoAdd test stable hash uniqueness of adjacent field values
Jakub Beránek [Sat, 22 Jan 2022 09:40:52 +0000 (10:40 +0100)]
Add test stable hash uniqueness of adjacent field values

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 agoMerge landing_pad and set_cleanup into cleanup_landing_pad
bjorn3 [Mon, 24 Jan 2022 12:57:32 +0000 (13:57 +0100)]
Merge landing_pad and set_cleanup into cleanup_landing_pad

2 years agoMerge add_handler into catch_switch
bjorn3 [Mon, 24 Jan 2022 12:50:12 +0000 (13:50 +0100)]
Merge add_handler into catch_switch

Some codegen backends may require all handlers to be immediately known

2 years agoRemove unused return values from resume and cleanup_ret
bjorn3 [Mon, 24 Jan 2022 12:48:09 +0000 (13:48 +0100)]
Remove unused return values from resume and cleanup_ret

Given that these instructions are diverging, not every codegen backend
may be able to produce a return value for them.

2 years agoReorder unwinding related builder methods to differentiate between dwarf and msvc...
bjorn3 [Mon, 24 Jan 2022 12:45:34 +0000 (13:45 +0100)]
Reorder unwinding related builder methods to differentiate between dwarf and msvc instructions

2 years ago[debuginfo] Fix and unify handling of fat pointers in debuginfo: address review comments.
Michael Woerister [Fri, 21 Jan 2022 09:35:18 +0000 (10:35 +0100)]
[debuginfo] Fix and unify handling of fat pointers in debuginfo: address review comments.

2 years agoFix vec-slices debuginfo test for GDB.
Michael Woerister [Mon, 17 Jan 2022 16:31:13 +0000 (17:31 +0100)]
Fix vec-slices debuginfo test for GDB.

2 years ago[debuginfo] Fix and unify handling of fat pointers in debuginfo.
Michael Woerister [Thu, 13 Jan 2022 17:13:54 +0000 (18:13 +0100)]
[debuginfo] Fix and unify handling of fat pointers in debuginfo.

2 years agoHandle unstability as well, including "field typo suggestions"
Daniel Henry-Mantilla [Mon, 24 Jan 2022 12:13:29 +0000 (13:13 +0100)]
Handle unstability as well, including "field typo suggestions"

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 agoMake `join!` description more accurate
EFanZh [Mon, 24 Jan 2022 08:17:40 +0000 (16:17 +0800)]
Make `join!` description more accurate

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 agoAuto merge of #8315 - dswij:8306, r=giraffate
bors [Mon, 24 Jan 2022 00:03:40 +0000 (00:03 +0000)]
Auto merge of #8315 - dswij:8306, r=giraffate

`trait_duplication_in_bounds` checks path segments for trait items

closes #8306

changelog: [`trait_duplication_in_bounds`] Fix FP when path segments exists for trait items

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 agoRemove deduplication of early lints
Aaron Hill [Sun, 23 Jan 2022 22:05:48 +0000 (17:05 -0500)]
Remove deduplication of early lints

We already have a general mechanism for deduplicating reported
lints, so there's no need to have an additional one for early lints
specifically. This allows us to remove some `PartialEq` impls.

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 agoAdd os::unix::net::SocketAddr::unix
Thomas de Zeeuw [Sun, 23 Jan 2022 16:11:06 +0000 (17:11 +0100)]
Add os::unix::net::SocketAddr::unix

Creates a new SocketAddr from a path, supports both regular paths and
abstract namespaces.

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 agoMake `NonNull::new` `const`
woppopo [Sun, 23 Jan 2022 14:04:39 +0000 (23:04 +0900)]
Make `NonNull::new` `const`

2 years agoAuto merge of #8311 - dswij:8277, r=llogiq
bors [Sun, 23 Jan 2022 12:59:52 +0000 (12:59 +0000)]
Auto merge of #8311 - dswij:8277, r=llogiq

fix `needless_question_mark` not considering async fn

closes #8277

changelog: [`needless_question_mark`] Fix FN on async functions

2 years agofix `needless_question_mark` not considering async fn
dswij [Tue, 18 Jan 2022 10:41:00 +0000 (18:41 +0800)]
fix `needless_question_mark` not considering async fn

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 agoUpdate clippy
Vadim Petrochenkov [Sat, 4 Dec 2021 15:09:15 +0000 (23:09 +0800)]
Update clippy

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: 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 agoAdd `intrinsics::const_deallocate`
woppopo [Sat, 25 Dec 2021 13:35:11 +0000 (22:35 +0900)]
Add `intrinsics::const_deallocate`

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 #8217 - Jarcho:needless_borrow_8191, r=camsteffen
bors [Sun, 23 Jan 2022 03:01:39 +0000 (03:01 +0000)]
Auto merge of #8217 - Jarcho:needless_borrow_8191, r=camsteffen

Fix `needless_borrow` causing mutable borrows to be moved

fixes #8191

changelog: Fix `needless_borrow` causing mutable borrows to be moved
changelog: Rename `ref_in_deref` to `needless_borrow`
changelog: Suggest removing the borrow on method call receivers in `needless_borrow`

2 years agoSubsume `ref_in_deref` into `needless_borrow`
Jason Newcomb [Wed, 12 Jan 2022 00:44:33 +0000 (19:44 -0500)]
Subsume `ref_in_deref` into `needless_borrow`

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 agoRemove final reference on fields and method calls in `needless_borrow`
Jason Newcomb [Tue, 11 Jan 2022 19:31:35 +0000 (14:31 -0500)]
Remove final reference on fields and method calls in `needless_borrow`

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