]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agochange `ConstEvaluatable` to use `ty::Const`
lcnr [Tue, 18 Oct 2022 14:09:04 +0000 (16:09 +0200)]
change `ConstEvaluatable` to use `ty::Const`

20 months agoAuto merge of #102543 - daym:patch-1, r=joshtriplett
bors [Tue, 18 Oct 2022 02:04:24 +0000 (02:04 +0000)]
Auto merge of #102543 - daym:patch-1, r=joshtriplett

Remove "execute" bit from lock file permissions

Previously, flock would set the "execute" bit on Rust lock files. That makes no sense.

This patch clears the "execute" bit on Rust lock files.

See issue #102531.

20 months agoAuto merge of #103165 - matthiaskrgr:rollup-guw8oh6, r=matthiaskrgr
bors [Mon, 17 Oct 2022 23:16:57 +0000 (23:16 +0000)]
Auto merge of #103165 - matthiaskrgr:rollup-guw8oh6, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #103152 (Use named arguments to make GUI test more clear)
 - #103160 (rustdoc: factor JS mobile scroll lock into its own function)
 - #103161 (rustdoc: remove redundant CSS on `#copy-path`)
 - #103162 (rustdoc: remove redundant CSS `#crate-search { border-radius }`)

Failed merges:

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

20 months agoRollup merge of #103162 - notriddle:notriddle/crate-search, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 21:09:08 +0000 (23:09 +0200)]
Rollup merge of #103162 - notriddle:notriddle/crate-search, r=GuillaumeGomez

rustdoc: remove redundant CSS `#crate-search { border-radius }`

This is the same border-radius that's always set on that ID:

https://github.com/rust-lang/rust/blob/a9d1cafa878ecc04a4aa7aaa7df0414a29a2bd0b/src/librustdoc/html/static/css/rustdoc.css#L825-L836

20 months agoRollup merge of #103161 - notriddle:notriddle/copy-path-settings-help-button, r=Guill...
Matthias Krüger [Mon, 17 Oct 2022 21:09:07 +0000 (23:09 +0200)]
Rollup merge of #103161 - notriddle:notriddle/copy-path-settings-help-button, r=GuillaumeGomez

rustdoc: remove redundant CSS on `#copy-path`

The border and background were removed in 5d004c1e2020eaa9bc336f09b6b0475c0eef4d78, but not all the CSS was.

20 months agoRollup merge of #103160 - notriddle:notriddle/js-mobile-scroll, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 21:09:07 +0000 (23:09 +0200)]
Rollup merge of #103160 - notriddle:notriddle/js-mobile-scroll, r=GuillaumeGomez

rustdoc: factor JS mobile scroll lock into its own function

https://github.com/rust-lang/rust/pull/98775#issuecomment-1172728308

20 months agoRollup merge of #103152 - GuillaumeGomez:named-arguments, r=notriddle
Matthias Krüger [Mon, 17 Oct 2022 21:09:06 +0000 (23:09 +0200)]
Rollup merge of #103152 - GuillaumeGomez:named-arguments, r=notriddle

Use named arguments to make GUI test more clear

As you suggested `@notriddle.` The result looks like this.

r? `@notriddle`

20 months agoAuto merge of #101837 - scottmcm:box-array-from-vec, r=m-ou-se
bors [Mon, 17 Oct 2022 19:46:04 +0000 (19:46 +0000)]
Auto merge of #101837 - scottmcm:box-array-from-vec, r=m-ou-se

Add `Box<[T; N]>: TryFrom<Vec<T>>`

We have `[T; N]: TryFrom<Vec<T>>` (#76310) and `Box<[T; N]>: TryFrom<Box<[T]>>`, but not this combination.

`vec.into_boxed_slice().try_into()` isn't quite a replacement for this, as that'll reallocate unnecessarily in the error case.

**Insta-stable, so needs an FCP**

(I tried to make this work with `, A`, but that's disallowed because of `#[fundamental]` https://github.com/rust-lang/rust/issues/29635#issuecomment-1247598385)

20 months agorustdoc: remove redundant CSS `#crate-search { border-radius }`
Michael Howell [Mon, 17 Oct 2022 19:16:40 +0000 (12:16 -0700)]
rustdoc: remove redundant CSS `#crate-search { border-radius }`

This is the same border-radius that's always set on that ID:

https://github.com/rust-lang/rust/blob/a9d1cafa878ecc04a4aa7aaa7df0414a29a2bd0b/src/librustdoc/html/static/css/rustdoc.css#L825-L836

20 months agoRemove execute bit from lock file permissions
Danny Milosavljevic [Sat, 1 Oct 2022 01:50:05 +0000 (03:50 +0200)]
Remove execute bit from lock file permissions

20 months agorustdoc: remove redundant CSS on `#copy-path`
Michael Howell [Mon, 17 Oct 2022 18:53:42 +0000 (11:53 -0700)]
rustdoc: remove redundant CSS on `#copy-path`

The border and background were removed in
5d004c1e2020eaa9bc336f09b6b0475c0eef4d78, but not all the CSS was.

20 months agorustdoc: factor JS mobile scroll lock into its own function
Michael Howell [Mon, 17 Oct 2022 18:41:39 +0000 (11:41 -0700)]
rustdoc: factor JS mobile scroll lock into its own function

https://github.com/rust-lang/rust/pull/98775#issuecomment-1172728308

20 months agoAuto merge of #103151 - matthiaskrgr:rollup-t3mmnsg, r=matthiaskrgr
bors [Mon, 17 Oct 2022 17:05:17 +0000 (17:05 +0000)]
Auto merge of #103151 - matthiaskrgr:rollup-t3mmnsg, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #102454 (Suggest parentheses for possible range method calling)
 - #102466 (only allow `ConstEquate` with `feature(gce)`)
 - #102945 (Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false)
 - #103091 (rustdoc: remove unused HTML class `sidebar-title`)

Failed merges:

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

20 months agoUse named arguments to make test clearer
Guillaume Gomez [Mon, 17 Oct 2022 16:08:53 +0000 (18:08 +0200)]
Use named arguments to make test clearer

20 months agoUpdate browser-ui-test version to 0.12.6
Guillaume Gomez [Mon, 17 Oct 2022 16:08:40 +0000 (18:08 +0200)]
Update browser-ui-test version to 0.12.6

20 months agoRollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 15:15:51 +0000 (17:15 +0200)]
Rollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomez

rustdoc: remove unused HTML class `sidebar-title`

Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.

20 months agoRollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnr
Matthias Krüger [Mon, 17 Oct 2022 15:15:50 +0000 (17:15 +0200)]
Rollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnr

Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false

**NOTE:** I'm kinda just putting this up for discussion. I'm not certain this is correct...?

This was introduced in [`608625d`](https://github.com/rust-lang/rust/commit/608625dae95cde00e4570eb6c2d63b2244bbf34c#diff-6e54b18681342ec725d75591dbf384ad08cd73df29db00485fe51b4e90f76ff7R361).

Interestingly, we only check `data.has_placeholders()` for `RegionOutlives`, and not for `TypeOutlives`... why? For the record, that different treatment between `RegionOutlives` and `TypeOutlives` is why the fix "The compiling succeeds when all `'a : 'b` are replaced with `&'a () : 'b`" in #100689 _"works"_, but it seems like an implementation detail considering this.

Also, why do we care about placeholder regions being registered if `considering_regions` is false? It doesn't seem to affect any UI tests, for example.

r? `@lcnr`

Fixes #102899
Fixes #100689

20 months agoRollup merge of #102466 - lcnr:const-equate-uwu, r=BoxyUwU
Matthias Krüger [Mon, 17 Oct 2022 15:15:50 +0000 (17:15 +0200)]
Rollup merge of #102466 - lcnr:const-equate-uwu, r=BoxyUwU

only allow `ConstEquate` with `feature(gce)`

20 months agoRollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnr
Matthias Krüger [Mon, 17 Oct 2022 15:15:49 +0000 (17:15 +0200)]
Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnr

Suggest parentheses for possible range method calling

Fixes #102396

20 months agoAuto merge of #102355 - lcnr:bye-bye-type-traversal, r=oli-obk
bors [Mon, 17 Oct 2022 14:19:28 +0000 (14:19 +0000)]
Auto merge of #102355 - lcnr:bye-bye-type-traversal, r=oli-obk

remove type traversal for mir constants

r? `@oli-obk` cc `@b-naber`

20 months agoAuto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr
bors [Mon, 17 Oct 2022 11:33:40 +0000 (11:33 +0000)]
Auto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #102962 (remote-test-server: Show command line arguments)
 - #103129 (rustdoc: remove unused `.sub-logo-container` DOM on non-source pages)
 - #103136 (Fix types in documentation for `Alignment::as_usize` and `Alignmnet::as_nonzero`)
 - #103139 (Duplicate comment in mod.rs)

Failed merges:

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

20 months agoRollup merge of #103139 - smoelius:patch-2, r=Dylan-DPC
Matthias Krüger [Mon, 17 Oct 2022 11:11:08 +0000 (13:11 +0200)]
Rollup merge of #103139 - smoelius:patch-2, r=Dylan-DPC

Duplicate comment in mod.rs

20 months agoRollup merge of #103136 - tmccombs:alignment-doc-fixes, r=Dylan-DPC
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #103136 - tmccombs:alignment-doc-fixes, r=Dylan-DPC

Fix types in documentation for `Alignment::as_usize` and `Alignmnet::as_nonzero`

20 months agoRollup merge of #103129 - notriddle:notriddle/sub-logo-container, r=GuillaumeGomez
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #103129 - notriddle:notriddle/sub-logo-container, r=GuillaumeGomez

rustdoc: remove unused `.sub-logo-container` DOM on non-source pages

20 months agoRollup merge of #102962 - flba-eb:remote_test_server_help, r=pietroalbini
Matthias Krüger [Mon, 17 Oct 2022 11:11:07 +0000 (13:11 +0200)]
Rollup merge of #102962 - flba-eb:remote_test_server_help, r=pietroalbini

remote-test-server: Show command line arguments

The user of remote-test-server should get at least some minimal command line help as this is often started manually.

r? `@pietroalbini`

20 months agoadd inline to `TrivialTypeTraversalImpls`
lcnr [Wed, 5 Oct 2022 16:26:48 +0000 (18:26 +0200)]
add inline to `TrivialTypeTraversalImpls`

20 months agorm `try_normalize_mir_const_after_erasing_regions`
lcnr [Thu, 29 Sep 2022 10:39:35 +0000 (12:39 +0200)]
rm `try_normalize_mir_const_after_erasing_regions`

20 months agomir constants: type traversing bye bye
lcnr [Tue, 27 Sep 2022 09:59:25 +0000 (11:59 +0200)]
mir constants: type traversing bye bye

20 months agoAuto merge of #103116 - TaKO8Ki:fix-103053, r=lcnr
bors [Mon, 17 Oct 2022 08:04:52 +0000 (08:04 +0000)]
Auto merge of #103116 - TaKO8Ki:fix-103053, r=lcnr

Fix `own_substs` ICE

Fixes #103053

20 months agoDuplicate comment in mod.rs
Samuel Moelius [Mon, 17 Oct 2022 07:54:56 +0000 (03:54 -0400)]
Duplicate comment in mod.rs

20 months agoFix types in documentation for Alignment::as_usize and Alignmnet::as_nonzero
Thayne McCombs [Mon, 17 Oct 2022 05:44:06 +0000 (23:44 -0600)]
Fix types in documentation for Alignment::as_usize and Alignmnet::as_nonzero

20 months agoAuto merge of #103096 - petrochenkov:indresdoc, r=cjgillot
bors [Mon, 17 Oct 2022 02:06:25 +0000 (02:06 +0000)]
Auto merge of #103096 - petrochenkov:indresdoc, r=cjgillot

resolve: Shadow erroneous glob imports with erroneous single imports

If such shadowing doesn't happen we end up in a weird state that may cause ICEs.
(In non-erroneous cases single imports always shadow glob imports too.)

Fixes https://github.com/rust-lang/rust/issues/100047
Fixes https://github.com/rust-lang/rust/issues/100241

20 months agorustdoc: clean up `.sub-logo-container` CSS
Michael Howell [Sun, 16 Oct 2022 23:59:21 +0000 (16:59 -0700)]
rustdoc: clean up `.sub-logo-container` CSS

* Since it's used exclusively on source pages, no need to explicitly
  select.

* No need to hide it when the sidebar is open, since it fills the whole
  page.

20 months agorustdoc: remove unused `.sub-logo-container` DOM on non-source pages
Michael Howell [Sun, 16 Oct 2022 23:58:55 +0000 (16:58 -0700)]
rustdoc: remove unused `.sub-logo-container` DOM on non-source pages

20 months agotrivial fix for comments feedback
yukang [Mon, 17 Oct 2022 00:32:08 +0000 (08:32 +0800)]
trivial fix for comments feedback

20 months agoAuto merge of #103125 - matthiaskrgr:rollup-82xttcl, r=matthiaskrgr
bors [Sun, 16 Oct 2022 23:15:20 +0000 (23:15 +0000)]
Auto merge of #103125 - matthiaskrgr:rollup-82xttcl, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #103087 (Documentation BTreeMap::append's behavior for already existing keys)
 - #103089 (Mark derived StructuralEq as automatically derived.)
 - #103102 (Clarify the possible return values of `len_utf16`)
 - #103109 (PhantomData: inline a macro that is used only once)
 - #103120 (rustdoc: Do not expect `doc(primitive)` modules to always exist)

Failed merges:

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

20 months agoRollup merge of #103120 - petrochenkov:docice, r=GuillaumeGomez
Matthias Krüger [Sun, 16 Oct 2022 20:36:07 +0000 (22:36 +0200)]
Rollup merge of #103120 - petrochenkov:docice, r=GuillaumeGomez

rustdoc: Do not expect `doc(primitive)` modules to always exist

The second commit fixes one more ICE by processing impls in crates loaded through the "load all `--extern`s" hack.

Fixes https://github.com/rust-lang/rust/issues/96288
Fixes https://github.com/rust-lang/rust/issues/103028

20 months agoRollup merge of #103109 - RalfJung:phantom-data-impl, r=thomcc
Matthias Krüger [Sun, 16 Oct 2022 20:36:06 +0000 (22:36 +0200)]
Rollup merge of #103109 - RalfJung:phantom-data-impl, r=thomcc

PhantomData: inline a macro that is used only once

I suspect this macro used to have more uses, but right now it just obfuscates the code.

20 months agoRollup merge of #103102 - H4x5:len_utf16_docs, r=scottmcm
Matthias Krüger [Sun, 16 Oct 2022 20:36:06 +0000 (22:36 +0200)]
Rollup merge of #103102 - H4x5:len_utf16_docs, r=scottmcm

Clarify the possible return values of `len_utf16`

`char::len_utf16` always return 1 or 2. Clarify this in the docs, in the same way as `char::len_utf8`.

20 months agoRollup merge of #103089 - cjgillot:automatic-structural-eq, r=oli-obk
Matthias Krüger [Sun, 16 Oct 2022 20:36:05 +0000 (22:36 +0200)]
Rollup merge of #103089 - cjgillot:automatic-structural-eq, r=oli-obk

Mark derived StructuralEq as automatically derived.

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

Drive-by: use correct spans for generic params.
20 months agoRollup merge of #103087 - phimuemue:btreemap_append_doc, r=Mark-Simulacrum
Matthias Krüger [Sun, 16 Oct 2022 20:36:05 +0000 (22:36 +0200)]
Rollup merge of #103087 - phimuemue:btreemap_append_doc, r=Mark-Simulacrum

Documentation BTreeMap::append's behavior for already existing keys

`BTreeMap::append` overwrites existing values with new ones. This commit adds explicit documentation for that.

20 months agoAuto merge of #102026 - Bryanskiy:resolve_update, r=petrochenkov
bors [Sun, 16 Oct 2022 20:34:38 +0000 (20:34 +0000)]
Auto merge of #102026 - Bryanskiy:resolve_update, r=petrochenkov

Populate effective visibilities in 'rustc_resolve'

Next part of RFC https://github.com/rust-lang/rust/issues/48054.
previous: https://github.com/rust-lang/rust/pull/101713

`@rustbot` author
r? `@petrochenkov`

20 months agoPopulate effective visibilities in 'rustc_resolve'
Bryanskiy [Sun, 25 Sep 2022 11:25:02 +0000 (14:25 +0300)]
Populate effective visibilities in 'rustc_resolve'

20 months agorustdoc: Process extern impls in all loaded crates
Vadim Petrochenkov [Sun, 16 Oct 2022 17:51:13 +0000 (21:51 +0400)]
rustdoc: Process extern impls in all loaded crates

including those loaded through hacks.

20 months agoAuto merge of #103119 - matthiaskrgr:rollup-2vb8hif, r=matthiaskrgr
bors [Sun, 16 Oct 2022 17:54:02 +0000 (17:54 +0000)]
Auto merge of #103119 - matthiaskrgr:rollup-2vb8hif, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #102857 (Add a regression test for #39137)
 - #102953 (Improve docs for `struct_lint_level` function.)
 - #103060 (rustdoc: make the help button a link to a page)
 - #103115 (Clean up anchors.goml rustdoc GUI test)

Failed merges:

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

20 months agorustdoc: Do not expect `doc(primitive)` modules to always exist
Vadim Petrochenkov [Sun, 16 Oct 2022 16:39:53 +0000 (20:39 +0400)]
rustdoc: Do not expect `doc(primitive)` modules to always exist

20 months agoRollup merge of #103115 - GuillaumeGomez:clean-up-anchors-gui-test, r=notriddle
Matthias Krüger [Sun, 16 Oct 2022 15:51:32 +0000 (17:51 +0200)]
Rollup merge of #103115 - GuillaumeGomez:clean-up-anchors-gui-test, r=notriddle

Clean up anchors.goml rustdoc GUI test

r? ``@notriddle``

20 months agoRollup merge of #103060 - notriddle:notridddle/help-page, r=GuillaumeGomez
Matthias Krüger [Sun, 16 Oct 2022 15:51:31 +0000 (17:51 +0200)]
Rollup merge of #103060 - notriddle:notridddle/help-page, r=GuillaumeGomez

rustdoc: make the help button a link to a page

This allows you to open the help section in a new browser tab, which is a pretty reasonable thing to want for a documentation page.

Preview: http://notriddle.com/notriddle-rustdoc-demos/help-page/std/index.html

20 months agoRollup merge of #102953 - WaffleLapkin:better_docs_for_decorate_param, r=RalfJung
Matthias Krüger [Sun, 16 Oct 2022 15:51:31 +0000 (17:51 +0200)]
Rollup merge of #102953 - WaffleLapkin:better_docs_for_decorate_param, r=RalfJung

Improve docs for `struct_lint_level` function.

r? ``@RalfJung``

Does this answer your questions?

20 months agoRollup merge of #102857 - saethlin:derived-enum-hash-test, r=Mark-Simulacrum
Matthias Krüger [Sun, 16 Oct 2022 15:51:30 +0000 (17:51 +0200)]
Rollup merge of #102857 - saethlin:derived-enum-hash-test, r=Mark-Simulacrum

Add a regression test for #39137

The problem in the issue has been fixed in the meantime, so since this adds a regression test I think this closes https://github.com/rust-lang/rust/issues/39137

20 months agoClarify the possible return values of len_utf16
Sky [Sun, 16 Oct 2022 01:41:45 +0000 (21:41 -0400)]
Clarify the possible return values of len_utf16

20 months agofix typo
Ralf Jung [Sun, 16 Oct 2022 14:47:55 +0000 (16:47 +0200)]
fix typo

20 months agofix `own_substs` ICE
Takayuki Maeda [Sun, 16 Oct 2022 13:24:27 +0000 (22:24 +0900)]
fix `own_substs` ICE

20 months agoClean up anchors.goml rustdoc GUI test
Guillaume Gomez [Sun, 16 Oct 2022 13:15:03 +0000 (15:15 +0200)]
Clean up anchors.goml rustdoc GUI test

20 months agoUpdate browser-ui-test version to 0.12.5
Guillaume Gomez [Sun, 16 Oct 2022 12:12:24 +0000 (14:12 +0200)]
Update browser-ui-test version to 0.12.5

20 months agoAuto merge of #102334 - compiler-errors:rpitit-substs-issue, r=cjgillot
bors [Sun, 16 Oct 2022 10:10:44 +0000 (10:10 +0000)]
Auto merge of #102334 - compiler-errors:rpitit-substs-issue, r=cjgillot

Fix subst issues with return-position `impl Trait` in trait

1. Fix an issue where we were rebase impl substs onto trait method substs, instead of trait substs
2. Fix an issue where early-bound regions aren't being mapped correctly for RPITIT hidden types

Fixes #102301
Fixes #102310
Fixes #102334
Fixes #102918

20 months agoPhantomData: inline a macro that is used only once
Ralf Jung [Sun, 16 Oct 2022 08:36:13 +0000 (10:36 +0200)]
PhantomData: inline a macro that is used only once

20 months agoAuto merge of #102080 - yanchen4791:issue-99824-fix, r=cjgillot
bors [Sun, 16 Oct 2022 07:40:56 +0000 (07:40 +0000)]
Auto merge of #102080 - yanchen4791:issue-99824-fix, r=cjgillot

Fix missing explanation of where the borrowed reference is used when the same borrow occurs multiple times due to loop iterations

Fix #99824.

Problem of the issue:
If a borrow occurs in a loop, the borrowed reference could be invalidated at the same place at next iteration of the loop. When this happens, the point where the borrow occurs is the same as the intervening point that might invalidate the reference in the loop. This causes a problem for the current code finding the point where the resulting reference is used, so that the explanation of the cause will be missing. As the second point of "explain all errors in terms of three points" (see [leveraging intuition framing errors in terms of points"](https://rust-lang.github.io/rfcs/2094-nll.html#leveraging-intuition-framing-errors-in-terms-of-points), this explanation is very helpful for user to understand the error.

In the current implementation, the searching region for finding the location where the borrowed reference is used is limited to between the place where the borrow occurs and the place where the reference is invalidated. If those two places happen to be the same, which indicates that the borrow and invalidation occur at the same place in a loop, the search will fail.

One solution to the problem is when these two places are the same,  find the terminator of the loop, and then use the location of the loop terminator instead of the location of the borrow for the region to find the place where the borrowed reference is used.

20 months agoAuto merge of #103105 - JohnTitor:rollup-x4ivrix, r=JohnTitor
bors [Sun, 16 Oct 2022 04:54:29 +0000 (04:54 +0000)]
Auto merge of #103105 - JohnTitor:rollup-x4ivrix, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #101717 (Add documentation about the memory layout of `UnsafeCell<T>`)
 - #102023 (Add MaybeUninit array transpose From impls)
 - #103033 (Update pkg-config)
 - #103080 (pretty: fix to print some lifetimes on HIR pretty-print)
 - #103082 (Surround type with backticks)
 - #103088 (Fix settings page)

Failed merges:

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

20 months agorustdoc: make help button a no-op when on help page
Michael Howell [Sun, 16 Oct 2022 04:02:57 +0000 (21:02 -0700)]
rustdoc: make help button a no-op when on help page

20 months agoRollup merge of #103088 - GuillaumeGomez:fix-settings-page, r=notriddle
Yuki Okushi [Sun, 16 Oct 2022 02:41:14 +0000 (11:41 +0900)]
Rollup merge of #103088 - GuillaumeGomez:fix-settings-page, r=notriddle

Fix settings page

Thanks to https://github.com/rust-lang/rust/pull/103060, I discovered that the settings page was badly rendered. This PR fixes it.

Before:
![Screenshot from 2022-10-15 16-02-41](https://user-images.githubusercontent.com/3050060/195990668-42e0b16b-3146-4864-b822-6f6a80fb77a5.png)

After:
![Screenshot from 2022-10-15 16-02-31](https://user-images.githubusercontent.com/3050060/195990664-20f967df-8989-4336-bca9-be52baab8e81.png)

r? ```@notriddle```

20 months agoRollup merge of #103082 - gimbles:patch-1, r=cjgillo
Yuki Okushi [Sun, 16 Oct 2022 02:41:14 +0000 (11:41 +0900)]
Rollup merge of #103082 - gimbles:patch-1, r=cjgillo

Surround type with backticks

Very smol PR. :)

20 months agoRollup merge of #103080 - ohno418:fix-hir-pretty-print-lifetimes, r=cjgillot
Yuki Okushi [Sun, 16 Oct 2022 02:41:13 +0000 (11:41 +0900)]
Rollup merge of #103080 - ohno418:fix-hir-pretty-print-lifetimes, r=cjgillot

pretty: fix to print some lifetimes on HIR pretty-print

HIR pretty-printer doesn't seem to print some lifetimes in types. This PR fixes that.

Closes https://github.com/rust-lang/rust/issues/85089

20 months agoRollup merge of #103033 - alyssais:pkg-config, r=joshtriplett
Yuki Okushi [Sun, 16 Oct 2022 02:41:13 +0000 (11:41 +0900)]
Rollup merge of #103033 - alyssais:pkg-config, r=joshtriplett

Update pkg-config

I'd like to be able to cross-compile rustc in a scenario where it'd be really helpful to have https://github.com/rust-lang/pkg-config-rs/commit/cd3ccca7c3b89644e74b0217ef93c632efd8ed2a.  I've done some test builds of the compiler on x86_64 linux, targeting x86_64 linux and aarch64 linux.

20 months agoRollup merge of #102023 - SUPERCILEX:maybeuninit-transpose, r=scottmcm
Yuki Okushi [Sun, 16 Oct 2022 02:41:12 +0000 (11:41 +0900)]
Rollup merge of #102023 - SUPERCILEX:maybeuninit-transpose, r=scottmcm

Add MaybeUninit array transpose From impls

See discussion in https://github.com/rust-lang/rust/pull/101179 and https://github.com/rust-lang/rust/issues/96097. I believe this solution offers the simplest implementation with minimal future API regret.

`@RalfJung` mind doing a correctness review?

20 months agoRollup merge of #101717 - Pointerbender:unsafecell-memory-layout, r=Amanieu
Yuki Okushi [Sun, 16 Oct 2022 02:41:12 +0000 (11:41 +0900)]
Rollup merge of #101717 - Pointerbender:unsafecell-memory-layout, r=Amanieu

Add documentation about the memory layout of `UnsafeCell<T>`

The documentation for `UnsafeCell<T>` currently does not make any promises about its memory layout. This PR adds this documentation, namely that the memory layout of `UnsafeCell<T>` is the same as the memory layout of its inner `T`.

# Use case
Without this layout promise, the following cast would not be legally possible:

```rust
fn example<T>(ptr: *mut T) -> *const UnsafeCell<T> {
  ptr as *const UnsafeCell<T>
}
```

A use case where this can come up involves FFI. If Rust receives a pointer over a FFI boundary which provides shared read-write access (with some form of custom synchronization), and this pointer is managed by some Rust struct with lifetime `'a`, then it would greatly simplify its (internal) API and safety contract if a `&'a UnsafeCell<T>` can be created from a raw FFI pointer `*mut T`. A lot of safety checks can be done when receiving the pointer for the first time through FFI (non-nullness, alignment, initialize uninit bytes, etc.) and these properties can then be encoded into the `&UnsafeCell<T>` type. Without this documentation guarantee, this is not legal today outside of the standard library.

# Caveats
Casting in the opposite direction is still not valid, even with this documentation change:

```rust
fn example2<T>(ptr: &UnsafeCell<T>) -> &mut T {
  let t = ptr as *const UnsafeCell<T> as *mut T;
  unsafe { &mut *t }
}
```

This is because the only legal way to obtain a mutable pointer to the contents of the shared reference is through [`UnsafeCell::get`](https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html#method.get) and [`UnsafeCell::raw_get`](https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html#method.raw_get). Although there might be a desire to also make this legal at some point in the future, that part is outside the scope of this PR. Also see this relevant [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/transmuting.20.26.20-.3E.20.26mut).

# Alternatives
Instead of adding a new documentation promise, it's also possible to add a new method to `UnsafeCell<T>` with signature `pub fn from_ptr_bikeshed(ptr: *mut T) -> *const UnsafeCell<T>` which indirectly only allows one-way casting to `*const UnsafeCell<T>`.

20 months agoAuto merge of #102931 - camsteffen:inline-overlapping-impls, r=cjgillot
bors [Sun, 16 Oct 2022 02:05:30 +0000 (02:05 +0000)]
Auto merge of #102931 - camsteffen:inline-overlapping-impls, r=cjgillot

Make `overlapping_impls` not generic

Trying to win back perf from #101632.

20 months agoAdd MaybeUninit array transpose impls
Alex Saveau [Sat, 15 Oct 2022 22:57:19 +0000 (15:57 -0700)]
Add MaybeUninit array transpose impls

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
20 months agoAuto merge of #100579 - joboet:sync_mutex_everywhere, r=thomcc
bors [Sat, 15 Oct 2022 22:49:30 +0000 (22:49 +0000)]
Auto merge of #100579 - joboet:sync_mutex_everywhere, r=thomcc

std: use `sync::Mutex` for internal statics

Since `sync::Mutex` is now `const`-constructible, it can be used for internal statics, removing the need for `sys_common::StaticMutex`. This adds some extra allocations on platforms which need to box their mutexes (currently SGX and some UNIX), but these will become unnecessary with the lock improvements tracked in #93740.

I changed the program argument implementation on Hermit, it does not need `Mutex` but can use atomics like some UNIX systems (ping `@mkroening` `@stlankes).`

20 months agoresolve: Shadow erroneous glob imports with erroneous single imports
Vadim Petrochenkov [Sat, 15 Oct 2022 18:37:31 +0000 (22:37 +0400)]
resolve: Shadow erroneous glob imports with erroneous single imports

20 months agorustdoc: add test cases for links inside the help popover
Michael Howell [Sat, 15 Oct 2022 19:06:16 +0000 (12:06 -0700)]
rustdoc: add test cases for links inside the help popover

20 months agorustdoc: update test cases for `.sidebar-title` -> `.sidebar-elems h3`
Michael Howell [Sat, 15 Oct 2022 18:53:47 +0000 (11:53 -0700)]
rustdoc: update test cases for `.sidebar-title` -> `.sidebar-elems h3`

20 months agorustdoc: fix Ctrl-Click on help and settings links
Michael Howell [Sat, 15 Oct 2022 18:45:27 +0000 (11:45 -0700)]
rustdoc: fix Ctrl-Click on help and settings links

20 months agorustdoc: make the help button a link to a page
Michael Howell [Fri, 14 Oct 2022 16:48:19 +0000 (09:48 -0700)]
rustdoc: make the help button a link to a page

This allows you to open the help section in a new browser tab, which is a
pretty reasonable thing to want for a documentation page.

20 months agorustdoc: remove unused HTML class `sidebar-title`
Michael Howell [Sat, 15 Oct 2022 17:20:25 +0000 (10:20 -0700)]
rustdoc: remove unused HTML class `sidebar-title`

Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no
longer styled.

20 months agotypos
Michael Goulet [Sat, 15 Oct 2022 17:49:32 +0000 (17:49 +0000)]
typos

20 months agoEquate full fn signatures to infer all region variables
Michael Goulet [Mon, 10 Oct 2022 23:35:51 +0000 (23:35 +0000)]
Equate full fn signatures to infer all region variables

20 months agoAdd test
Michael Goulet [Tue, 27 Sep 2022 00:54:02 +0000 (00:54 +0000)]
Add test

20 months agoFix subst issues with RPITIT
Michael Goulet [Mon, 26 Sep 2022 23:13:12 +0000 (23:13 +0000)]
Fix subst issues with RPITIT

20 months agoDocumentation BTreeMap::append's behavior for already existing keys
philipp [Sat, 15 Oct 2022 12:59:27 +0000 (14:59 +0200)]
Documentation BTreeMap::append's behavior for already existing keys

20 months agoMark derived StructuralEq as automatically derived.
Camille GILLOT [Sat, 15 Oct 2022 14:33:20 +0000 (14:33 +0000)]
Mark derived StructuralEq as automatically derived.

20 months agopretty: fix to print some lifetimes on HIR pretty-print
Yutaro Ohno [Fri, 14 Oct 2022 08:53:09 +0000 (17:53 +0900)]
pretty: fix to print some lifetimes on HIR pretty-print

20 months agoAdd more GUI tests for settings page
Guillaume Gomez [Sat, 15 Oct 2022 13:59:11 +0000 (15:59 +0200)]
Add more GUI tests for settings page

20 months agoFix display of settings page
Guillaume Gomez [Sat, 15 Oct 2022 13:59:00 +0000 (15:59 +0200)]
Fix display of settings page

20 months agoAuto merge of #102895 - Nilstrieb:query-cleanups, r=cjgillot
bors [Sat, 15 Oct 2022 13:30:15 +0000 (13:30 +0000)]
Auto merge of #102895 - Nilstrieb:query-cleanups, r=cjgillot

Get rid of `rustc_query_description!`

**I am not entirely sure whether this is an improvement and would like to get your feedback on it.**

Helps with #96524.

Queries can provide an arbitrary expression for their description and their caching behavior. Before, these expressions where stored in a `rustc_query_description` macro emitted by the `rustc_queries` macro, and then used in `rustc_query_impl` to fill out the methods for the `QueryDescription` trait.

Instead, we now emit two new modules from `rustc_queries` containing the functions with the expressions. `rustc_query_impl` calls these functions now instead of invoking the macro.

Since we are now defining some of the functions in `rustc_middle::query`, we now need all the imports for the key types mthere as well.

r? `@cjgillot`

20 months agoAuto merge of #103083 - Dylan-DPC:rollup-97cvwdv, r=Dylan-DPC
bors [Sat, 15 Oct 2022 10:45:36 +0000 (10:45 +0000)]
Auto merge of #103083 - Dylan-DPC:rollup-97cvwdv, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #102773 (Use semaphores for thread parking on Apple platforms)
 - #102884 (resolve: Some cleanup, asserts and tests for lifetime ribs)
 - #102954 (Add missing checks for `doc(cfg_hide(...))`)
 - #102998 (Drop temporaries created in a condition, even if it's a let chain)
 - #103003 (Fix `suggest_floating_point_literal` ICE)
 - #103041 (Update cargo)

Failed merges:

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

20 months agoRollup merge of #103041 - weihanglo:update-cargo, r=ehuss
Dylan DPC [Sat, 15 Oct 2022 10:15:33 +0000 (15:45 +0530)]
Rollup merge of #103041 - weihanglo:update-cargo, r=ehuss

Update cargo

12 commits in b8f30cb23c4e5f20854a4f683325782b7cff9837..b332991a57c9d055f1864de1eed93e2178d49440 2022-10-10 19:16:06 +0000 to 2022-10-13 22:05:28 +0000
- Differentiate the warning when an alias (built-in or user-defined) shadows an external subcommand (rust-lang/cargo#11170)
- chore: Update tests for latest clap (rust-lang/cargo#11235)
- feat(publish): Support 'publish.timeout' config behind '-Zpublish-timeout' (rust-lang/cargo#11230)
- Add missing edition (rust-lang/cargo#11231)
- doc(profiles): add module level doc (rust-lang/cargo#11219)
- refactor(publish): Clarify which SourceId is being used (rust-lang/cargo#11216)
- Add new SourceKind::SparseRegistry to differentiate sparse registries (rust-lang/cargo#11209)
- Fix deadlock when build scripts are waiting for input on stdin (rust-lang/cargo#11205)
- refactor: New variant `FeaturesFor::ArtifactDep` (rust-lang/cargo#11184)
- Fix rustdoc warning about unclosed HTML tag (rust-lang/cargo#11221)
- refactor(tests): Prepare for wait-for-publish test changes (rust-lang/cargo#11210)
- Add configuration option for controlling crates.io protocol (rust-lang/cargo#11215)

20 months agoRollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errors
Dylan DPC [Sat, 15 Oct 2022 10:15:33 +0000 (15:45 +0530)]
Rollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errors

Fix `suggest_floating_point_literal` ICE

Fixes #102989

20 months agoRollup merge of #102998 - nathanwhit:let-chains-drop-order, r=eholk
Dylan DPC [Sat, 15 Oct 2022 10:15:32 +0000 (15:45 +0530)]
Rollup merge of #102998 - nathanwhit:let-chains-drop-order, r=eholk

Drop temporaries created in a condition, even if it's a let chain

Fixes #100513.

During the lowering from AST to HIR we wrap expressions acting as conditions in a `DropTemps` expression so that any temporaries created in the condition are dropped after the condition is executed. Effectively this means we transform

```rust
if Some(1).is_some() { .. }
```

into (roughly)

```rust
if { let _t = Some(1).is_some(); _t } { .. }
```

so that if we create any temporaries, they're lifted into the new scope surrounding the condition, so for example something along the lines of

```rust
if { let temp = Some(1); let _t = temp.is_some(); _t }.
```

Before this PR, if the condition contained any let expressions we would not introduce that new scope, instead leaving the condition alone. This meant that in a let-chain like

```rust
if get_drop("first").is_some() && let None = get_drop("last") {
        println!("second");
} else { .. }
```

the temporary created for `get_drop("first")` would be lifted into the _surrounding block_, which caused it to be dropped after the execution of the entire `if` expression.

After this PR, we wrap everything but the `let` expression in terminating scopes. The upside to this solution is that it's minimally invasive, but the downside is that in the worst case, an expression with `let` exprs interspersed like

```rust
if get_drop("first").is_some()
    && let Some(_a) = get_drop("fifth")
    && get_drop("second").is_some()
    && let Some(_b) = get_drop("fourth") { .. }
```

gets _multiple_ new scopes, roughly

```rust
if { let _t = get_drop("first").is_some(); _t }
    && let Some(_a) = get_drop("fifth")
    && { let _t = get_drop("second").is_some(); _t }
    && let Some(_b) = get_drop("fourth") { .. }
```

so instead of all of the temporaries being dropped at the end of the entire condition, they will be dropped right after they're evaluated (before the subsequent `let` expr). So while I'd say the drop behavior around let-chains is _less_ surprising after this PR, it still might not exactly match what people might expect.

For tests, I've just extended the drop order tests added in #100526. I'm not sure if that's the best way to go about it, though, so suggestions are welcome.

20 months agoRollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
Dylan DPC [Sat, 15 Oct 2022 10:15:32 +0000 (15:45 +0530)]
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth

Add missing checks for `doc(cfg_hide(...))`

Part of  #43781.

The `doc(cfg_hide(...))` attribute can only be used at the crate level and takes a list of attributes as argument.

r? ```@Manishearth```

20 months agoRollup merge of #102884 - petrochenkov:liferib, r=cjgillot
Dylan DPC [Sat, 15 Oct 2022 10:15:31 +0000 (15:45 +0530)]
Rollup merge of #102884 - petrochenkov:liferib, r=cjgillot

resolve: Some cleanup, asserts and tests for lifetime ribs

Follow up to https://github.com/rust-lang/rust/pull/98279 and friends.
r? ``@cjgillot``

20 months agoRollup merge of #102773 - joboet:apple_parker, r=thomcc
Dylan DPC [Sat, 15 Oct 2022 10:15:30 +0000 (15:45 +0530)]
Rollup merge of #102773 - joboet:apple_parker, r=thomcc

Use semaphores for thread parking on Apple platforms

Currently we use a mutex-condvar pair for thread parking on Apple systems. Unfortunately, `pthread_cond_timedwait` uses the real-time clock for measuring time, which causes problems when the system time changes. The parking implementation in this PR uses a semaphore instead, which measures monotonic time by default, avoiding these issues. As a further benefit, this has the potential to improve performance a bit, since `unpark` does not need to wait for a lock to be released.

Since the Mach semaphores are poorly documented (I could not find availability or stability guarantees for instance), this uses a [dispatch semaphore](https://developer.apple.com/documentation/dispatch/dispatch_semaphore?language=objc) instead. While it adds a layer of indirection (it uses Mach semaphores internally), the overhead is probably negligible.

Tested on macOS 12.5.

r? ``````@thomcc``````

20 months agoSurround type with backticks
Gimgim [Sat, 15 Oct 2022 09:58:29 +0000 (15:28 +0530)]
Surround type with backticks

20 months agoAuto merge of #101832 - compiler-errors:dyn-star-plus, r=eholk
bors [Sat, 15 Oct 2022 07:36:38 +0000 (07:36 +0000)]
Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholk

Make `dyn*` casts into a coercion, allow `dyn*` upcasting

I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways.

1. Make `dyn*` into a coercion instead of a cast
2. Enable `dyn*` upcasting since we basically get it for free
3. Simplify some of the cast checking code since we're using the coercion path now

r? `@eholk` but feel free to reassign
cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion

20 months agoAuto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillot
bors [Sat, 15 Oct 2022 04:27:15 +0000 (04:27 +0000)]
Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillot

Correctly handle path stability for 'use tree' items

PR #95956 started checking the stability of path segments.
However, this was not applied to 'use tree' items
(e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way
that we desugar these items in HIR lowering.

This PR modifies 'use tree' lowering to preserve resolution
information, which is needed by stability checking.

20 months agoAuto merge of #98033 - joshtriplett:is-terminal-fd-handle, r=thomcc
bors [Sat, 15 Oct 2022 01:42:28 +0000 (01:42 +0000)]
Auto merge of #98033 - joshtriplett:is-terminal-fd-handle, r=thomcc

Add `IsTerminal` trait to determine if a descriptor or handle is a terminal

The UNIX implementation uses `isatty`. The Windows implementation uses
the same logic the `atty` crate uses, including the hack needed to
detect msys terminals.

Implement this trait for `Stdin`/`Stdout`/`Stderr`/`File` on all
platforms. On Unix, implement it for `BorrowedFd`/`OwnedFd`. On Windows,
implement it for `BorrowedHandle`/`OwnedHandle`.

Based on https://github.com/rust-lang/rust/pull/91121

Co-authored-by: Matt Wilkinson <mattwilki17@gmail.com>
20 months agoUse Align8 to avoid misalignment if the allocator or Vec doesn't align allocations
Josh Triplett [Fri, 9 Sep 2022 13:01:26 +0000 (15:01 +0200)]
Use Align8 to avoid misalignment if the allocator or Vec doesn't align allocations

20 months agoRewrite FILE_NAME_INFO handling to avoid enlarging slice reference
Josh Triplett [Wed, 24 Aug 2022 13:32:16 +0000 (15:32 +0200)]
Rewrite FILE_NAME_INFO handling to avoid enlarging slice reference

Rather than referencing a slice's pointer and then creating a new slice
with a longer length, offset from the base structure pointer instead.
This makes some choices of Rust semantics happier.

20 months agoMake is_terminal fail fast if a process has no console at all
Josh Triplett [Mon, 20 Jun 2022 01:11:39 +0000 (18:11 -0700)]
Make is_terminal fail fast if a process has no console at all

If a process has no console, it'll have NULL in place of a console
handle, so return early with `false` in that case without making any OS
calls.

20 months agoAdd `IsTerminal` trait to determine if a descriptor or handle is a terminal
Josh Triplett [Sun, 12 Jun 2022 21:10:18 +0000 (14:10 -0700)]
Add `IsTerminal` trait to determine if a descriptor or handle is a terminal

The UNIX and WASI implementations use `isatty`. The Windows
implementation uses the same logic the `atty` crate uses, including the
hack needed to detect msys terminals.

Implement this trait for `File` and for `Stdin`/`Stdout`/`Stderr` and
their locked counterparts on all platforms. On UNIX and WASI, implement
it for `BorrowedFd`/`OwnedFd`. On Windows, implement it for
`BorrowedHandle`/`OwnedHandle`.

Based on https://github.com/rust-lang/rust/pull/91121

Co-authored-by: Matt Wilkinson <mattwilki17@gmail.com>