]> git.lizzy.rs Git - rust.git/log
rust.git
16 months agoFix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
Nicholas Nethercote [Mon, 30 Jan 2023 05:29:52 +0000 (16:29 +1100)]
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by
`-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST
nodes are constructed within the compiler. But it does mean anyone using
`-Zunpretty=expanded` output as a guide for hand-written impls could get
a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

16 months agoAuto merge of #107472 - matthiaskrgr:rollup-s9gn4n7, r=matthiaskrgr
bors [Mon, 30 Jan 2023 17:01:29 +0000 (17:01 +0000)]
Auto merge of #107472 - matthiaskrgr:rollup-s9gn4n7, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #107125 (Add and use expect methods to hir.)
 - #107172 (Reimplement NormalizeArrayLen based on SsaLocals)
 - #107177 (Keep all theme-updating logic together)
 - #107424 (Make Vec::clone_from and slice::clone_into share the same code)
 - #107455 (use a more descriptive name)
 - #107465 (`has_allow_dead_code_or_lang_attr` micro refactor)
 - #107469 (Change turbofish context link to an archive link)

Failed merges:

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

16 months agoRollup merge of #107469 - LLBlumire:master, r=jyn514
Matthias Krüger [Mon, 30 Jan 2023 16:50:12 +0000 (17:50 +0100)]
Rollup merge of #107469 - LLBlumire:master, r=jyn514

Change turbofish context link to an archive link

The original tweet in the chain linked to (via quote tweet), and thus the through line of links back to Anna's tweet where she named the turbofish (https://web.archive.org/web/20210911061514/https://twitter.com/whoisaldeka/status/914914008225816576) are lost as the user whoisaldeka has deleted their twitter account.

Switching to an archive link preserves this through line, allowing someone to browse back to see the point at which Anna created the turbofish, as was the original intent of including this context.

I was sharing this test with some friends as I often do, and noticed the changes (I had only seen the version from before her death previously). Looking for context myself, I realized the deleted twitter account was breaking an important link in the chain for the context of who Anna was to begin with, and the exact moment the turbofish was so named.

As an alternative to using an archive, we could link to both the tweet where Anna names the turbofish, and the tweet where she refers to herself as its guardian, as two separate links - not requiring the quote tweet to connect them.

16 months agoRollup merge of #107465 - WaffleLapkin:has_allow_dead_code_or_lang_attr, r=Nilstrieb
Matthias Krüger [Mon, 30 Jan 2023 16:50:11 +0000 (17:50 +0100)]
Rollup merge of #107465 - WaffleLapkin:has_allow_dead_code_or_lang_attr, r=Nilstrieb

`has_allow_dead_code_or_lang_attr` micro refactor

r? `@Nilstrieb`

16 months agoRollup merge of #107455 - tshepang:better-name, r=wesleywiser
Matthias Krüger [Mon, 30 Jan 2023 16:50:11 +0000 (17:50 +0100)]
Rollup merge of #107455 - tshepang:better-name, r=wesleywiser

use a more descriptive name

I found it hard to distinguish between the two method names.

Also, the comment just repeats the `expect` string.

16 months agoRollup merge of #107424 - bpeel:clone-into-from-share-code, r=scottmcm
Matthias Krüger [Mon, 30 Jan 2023 16:50:10 +0000 (17:50 +0100)]
Rollup merge of #107424 - bpeel:clone-into-from-share-code, r=scottmcm

Make Vec::clone_from and slice::clone_into share the same code

In the past, `Vec::clone_from` was implemented using `slice::clone_into`. The code from `clone_into` was later duplicated into `clone_from` in 8725e4c337, which is the commit that adds custom allocator support to Vec. Presumably this was done because the `slice::clone_into` method only works for vecs with the default allocator so it would have the wrong type to clone into `Vec<T, A>`.

Later on in 361398009be6 the code for the two methods diverged because the `Vec::clone_from` version gained a specialization to optimize the case when T is Copy. In order to reduce code duplication and make them both be able to take advantage of this specialization, this PR moves the specialization into the slice module and makes vec use it again.

16 months agoRollup merge of #107177 - thanatos:fix-doc-errant-light-theme, r=notriddle
Matthias Krüger [Mon, 30 Jan 2023 16:50:09 +0000 (17:50 +0100)]
Rollup merge of #107177 - thanatos:fix-doc-errant-light-theme, r=notriddle

Keep all theme-updating logic together

Prior to this PR, if the page is restored from the browser bfcache¹, we call `switchToSavedTheme`. But `switchToSavedTheme` never looks at the `use-system-theme` preference. Further, if it can't find a saved theme, it will fall back to the default of "light".

For a user with cookies disabled² whose preferred color scheme is dark, this means the theme will wobble back and forth between dark and light. The sequence that occurs is,

1. The page is loaded. During a page load, we consult `use-system-theme`: as cookies are disabled, this preference is unset. The default is true.

   Because the default is true, we look at the preferred color scheme: for our example user, that's "dark". **The page theme is set to dark.** We'll attempt to store these preferences in localStorage, but fail due to cookies being disabled.

2. The user navigates through the docs. Subsequent page loads happen, and the same process in step 1 recurs. Previous pages are (potentially) put into the bfcache.

3. The user navigates backwards/forwards, causing a page in bfcache to be pulled out of cache. The `pageShow` event handler is triggered. However, this calls `switchToSavedTheme`: this doesn't consider the system theme, as noted above. Instead, it only looks for a saved theme. However, with cookies disabled, there is none. It defaults to light. **The page theme is set to light!** The user wonders why the dark theme is lost.

There are effectively two functions trying to determine and apply the correct theme: `updateSystemTheme` and `switchToSavedTheme`. Thus, we merge them into just one: `updateTheme`. This function contains all the logic for determining the correct theme, and is called in all circumstances where we need to set the theme:

* The initial page load
* If the browser preferred color scheme (i.e., light/dark mode) is changed
* If the page is restored from bfcache
* If the user updates the theme preferences (i.e., in `settings.js`)

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

¹bfcache: https://web.dev/bfcache/ The bfcache is used to sleep a page, if the user navigates away from it, and to restore it from cache if the user returns to it.

²Note that the browser preference that enables/disables cookies really controls many forms of storage. The same preference thus also affects localStorage. (This is so a normal browser user doesn't need to understand the distinction between "cookies" and "localStorage".)

16 months agoRollup merge of #107172 - cjgillot:no-nal, r=nagisa
Matthias Krüger [Mon, 30 Jan 2023 16:50:09 +0000 (17:50 +0100)]
Rollup merge of #107172 - cjgillot:no-nal, r=nagisa

Reimplement NormalizeArrayLen based on SsaLocals

Based on https://github.com/rust-lang/rust/pull/106908
Fixes https://github.com/rust-lang/rust/issues/105929

Only the last commit "Reimplement NormalizeArrayLen" is relevant.

16 months agoRollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning...
Matthias Krüger [Mon, 30 Jan 2023 16:50:08 +0000 (17:50 +0100)]
Rollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb

Add and use expect methods to hir.

[The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462).

r? `@Nilstrieb`

tbh I'm not even sure if it's worth it

16 months agoUpdate bastion-of-the-turbofish.rs
Lucille Blumire [Mon, 30 Jan 2023 14:22:41 +0000 (14:22 +0000)]
Update bastion-of-the-turbofish.rs

The original tweet in the chain linked to, and thus the through line of links back to Anna's tweet where she named the turbofish (https://web.archive.org/web/20210911061514/https://twitter.com/whoisaldeka/status/914914008225816576) are lost as the user whoisaldeka has deleted their twitter account.

Switching to an archive link preserves this through line, allowing someone to browse back to see the point at which Anna created the turbofish, as was the original intent of including this context.

16 months agoAuto merge of #107080 - Urgau:cleanup-bootstrap-extra-check-cfgs, r=Mark-Simulacrum
bors [Mon, 30 Jan 2023 13:56:40 +0000 (13:56 +0000)]
Auto merge of #107080 - Urgau:cleanup-bootstrap-extra-check-cfgs, r=Mark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (https://github.com/rust-lang/rust/pull/45041)
 - `release`: was removed from rustfmt (https://github.com/rust-lang/rustfmt/pull/5375 and https://github.com/rust-lang/rustfmt/pull/5449)
 - `dont_compile_me`: was removed from stdarch (https://github.com/rust-lang/stdarch/pull/1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).

16 months agoAuto merge of #107463 - Dylan-DPC:rollup-6mq1li8, r=Dylan-DPC
bors [Mon, 30 Jan 2023 11:14:21 +0000 (11:14 +0000)]
Auto merge of #107463 - Dylan-DPC:rollup-6mq1li8, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #101569 (Don't re-export private/unstable ArgumentV1 from `alloc`.)
 - #106106 (Pass `branch.{branch}.remote=origin` to `git submodule update`)
 - #107146 (Make `unsizing_params_for_adt` into a query)
 - #107264 (Add option to include private items in library docs)
 - #107452 (Fix typo in `{Rc, Arc}::get_mut_unchecked` docs)
 - #107459 (end entry paragraph with a period (.))

Failed merges:

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

16 months agoConsider `#[allow(dead_code)]` before lang items
Maybe Waffle [Mon, 30 Jan 2023 10:54:33 +0000 (10:54 +0000)]
Consider `#[allow(dead_code)]` before lang items

16 months agoSplit `has_allow_dead_code_or_lang_attr` into sub functions
Maybe Waffle [Mon, 30 Jan 2023 10:53:11 +0000 (10:53 +0000)]
Split `has_allow_dead_code_or_lang_attr` into sub functions

16 months agoRollup merge of #107459 - tshepang:cosistency, r=WaffleLapkin
Dylan DPC [Mon, 30 Jan 2023 09:41:47 +0000 (15:11 +0530)]
Rollup merge of #107459 - tshepang:cosistency, r=WaffleLapkin

end entry paragraph with a period (.)

16 months agoRollup merge of #107452 - y21:get-mut-unchecked-typo, r=Mark-Simulacrum
Dylan DPC [Mon, 30 Jan 2023 09:41:46 +0000 (15:11 +0530)]
Rollup merge of #107452 - y21:get-mut-unchecked-typo, r=Mark-Simulacrum

Fix typo in `{Rc, Arc}::get_mut_unchecked` docs

Just a correction in the documentation of `{Rc, Arc}::get_mut_unchecked`.

16 months agoRollup merge of #107264 - ferrocene:pa-private-items, r=Mark-Simulacrum
Dylan DPC [Mon, 30 Jan 2023 09:41:46 +0000 (15:11 +0530)]
Rollup merge of #107264 - ferrocene:pa-private-items, r=Mark-Simulacrum

Add option to include private items in library docs

I need to perform some one-off analysis on libcore, and I wanted to use the unstable JSON rustdoc output to easily do it. Unfortunately, there is currently no way to include unstable items in the library docs. This PR adds support for that, with the off-by-default `build.library-docs-private-items` setting.

16 months agoRollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillot
Dylan DPC [Mon, 30 Jan 2023 09:41:45 +0000 (15:11 +0530)]
Rollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillot

Make `unsizing_params_for_adt` into a query

Addresses a FIXME in confirmation.

r? ``@ghost``

16 months agoRollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
Dylan DPC [Mon, 30 Jan 2023 09:41:45 +0000 (15:11 +0530)]
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum

Pass `branch.{branch}.remote=origin` to `git submodule update`

This works around a bug in git itself.
Fixes https://github.com/rust-lang/rust/issues/101144.

16 months agoRollup merge of #101569 - m-ou-se:alloc-no-rexport-argumentv1, r=thomcc
Dylan DPC [Mon, 30 Jan 2023 09:41:44 +0000 (15:11 +0530)]
Rollup merge of #101569 - m-ou-se:alloc-no-rexport-argumentv1, r=thomcc

Don't re-export private/unstable ArgumentV1 from `alloc`.

The `alloc::fmt::ArgumentV1` re-export was marked as `#[stable]` even though the original `core::fmt::ArgumentV1` is `#[unstable]` (and `#[doc(hidden)]`).

(It wasn't usable though:

```
error[E0658]: use of unstable library feature 'fmt_internals': internal to format_args!
 --> src/main.rs:4:12
  |
4 |     let _: alloc::fmt::ArgumentV1 = todo!();
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: add `#![feature(fmt_internals)]` to the crate attributes to enable
```
)

Part of #99012

16 months agoKeep all theme-updating logic together
Roy Wellington Ⅳ [Sat, 21 Jan 2023 23:21:43 +0000 (18:21 -0500)]
Keep all theme-updating logic together

Prior to this PR, if the page is restored from the browser bfcache¹, we
call `switchToSavedTheme`. But `switchToSavedTheme` never looks at the
`use-system-theme` preference. Further, if it can't find a saved theme,
it will fall back to the default of "light".

For a user with cookies disabled² whose preferred color scheme is dark,
this means the theme will wobble back and forth between dark and light.
The sequence that occurs is,

1. The page is loaded. During a page load, we consult
   `use-system-theme`: as cookies are disabled, this preference is
   unset. The default is true.

   Because the default is true, we look at the preferred color scheme:
   for our example user, that's "dark". **The page theme is set to
   dark.** We'll attempt to store these preferences in localStorage, but
   fail due to cookies being disabled.

2. The user navigates through the docs. Subsequent page loads happen,
   and the same process in step 1 recurs. Previous pages are
   (potentially) put into the bfcache.

3. The user navigates backwards/forwards, causing a page in bfcache to
   be pulled out of cache. The `pageShow` event handler is triggered.
   However, this calls `switchToSavedTheme`: this doesn't consider the
   system theme, as noted above. Instead, it only looks for a saved
   theme. However, with cookies disabled, there is none. It defaults to
   light. **The page theme is set to light!** The user wonders why the
   dark theme is lost.

There are effectively two functions trying to determine and apply the
correct theme: `updateSystemTheme` and `switchToSavedTheme`. Thus, we
merge them into just one: `updateTheme`. This function contains all the
logic for determining the correct theme, and is called in all
circumstances where we need to set the theme:

* The initial page load
* If the browser preferred color scheme (i.e., light/dark mode) is
  changed
* If the page is restored from bfcache
* If the user updates the theme preferences (i.e., in `settings.js`)

Fixes #94250.

¹bfcache: https://web.dev/bfcache/ The bfcache is used to sleep a page,
if the user navigates away from it, and to restore it from cache if the
user returns to it.

²Note that the browser preference that enables/disables cookies really
controls many forms of storage. The same preference thus also affects
localStorage. (This is so a normal browser user doesn't need to
understand the distinction between "cookies" and "localStorage".)

16 months agoAuto merge of #104429 - nnethercote:more-deriving-on-packed-structs, r=RalfJung
bors [Mon, 30 Jan 2023 07:02:01 +0000 (07:02 +0000)]
Auto merge of #104429 - nnethercote:more-deriving-on-packed-structs, r=RalfJung

More deriving on packed structs

See [here](https://github.com/rust-lang/rust/pull/104429#issuecomment-1320909245) for the t-lang nomination summary, and [here](https://github.com/rust-lang/rust/pull/104429#issuecomment-1360077895) for the approval.

r? `@RalfJung`

16 months agofix `TraitItemKind::expect_type` docs
Maybe Waffle [Mon, 30 Jan 2023 05:55:20 +0000 (05:55 +0000)]
fix `TraitItemKind::expect_type` docs

16 months agoUse `expect_{use,fn}` in a couple of places
Maybe Waffle [Mon, 30 Jan 2023 05:50:37 +0000 (05:50 +0000)]
Use `expect_{use,fn}` in a couple of places

16 months agoImprove ICE messages for `*::expect_*`
Maybe Waffle [Mon, 30 Jan 2023 05:50:06 +0000 (05:50 +0000)]
Improve ICE messages for `*::expect_*`

16 months agoend entry paragraph with a period (.)
Tshepang Mbambo [Mon, 30 Jan 2023 05:37:02 +0000 (07:37 +0200)]
end entry paragraph with a period (.)

16 months agouse a more descriptive name
Tshepang Mbambo [Mon, 30 Jan 2023 05:20:38 +0000 (07:20 +0200)]
use a more descriptive name

16 months agoAllow more deriving on packed structs.
Nicholas Nethercote [Mon, 21 Nov 2022 03:40:32 +0000 (14:40 +1100)]
Allow more deriving on packed structs.

Currently, deriving on packed structs has some non-trivial limitations,
related to the fact that taking references on unaligned fields is UB.

The current approach to field accesses in derived code:
- Normal case: `&self.0`
- In a packed struct that derives `Copy`: `&{self.0}`
- In a packed struct that doesn't derive `Copy`: `&self.0`

Plus, we disallow deriving any builtin traits other than `Default` for any
packed generic type, because it's possible that there might be
misaligned fields. This is a fairly broad restriction.

Plus, we disallow deriving any builtin traits other than `Default` for most
packed types that don't derive `Copy`. (The exceptions are those where the
alignments inherently satisfy the packing, e.g. in a type with
`repr(packed(N))` where all the fields have alignments of `N` or less
anyway. Such types are pretty strange, because the `packed` attribute is
not having any effect.)

This commit introduces a new, simpler approach to field accesses:
- Normal case: `&self.0`
- In a packed struct: `&{self.0}`

In the latter case, this requires that all fields impl `Copy`, which is
a new restriction. This means that the following example compiles under
the old approach and doesn't compile under the new approach.
```
 #[derive(Debug)]
 struct NonCopy(u8);

 #[derive(Debug)
 #[repr(packed)]
 struct MyType(NonCopy);
```
(Note that the old approach's support for cases like this was brittle.
Changing the `u8` to a `u16` would be enough to stop it working. So not
much capability is lost here.)

However, the other constraints from the old rules are removed. We can now
derive builtin traits for packed generic structs like this:
```
 trait Trait { type A; }

 #[derive(Hash)]
 #[repr(packed)]
 pub struct Foo<T: Trait>(T, T::A);
```
To allow this, we add a `T: Copy` bound in the derived impl and a `T::A:
Copy` bound in where clauses. So `T` and `T::A` must impl `Copy`.

We can now also derive builtin traits for packed structs that don't derive
`Copy`, so long as the fields impl `Copy`:
```
 #[derive(Hash)]
 #[repr(packed)]
 pub struct Foo(u32);
```
This includes types that hand-impl `Copy` rather than deriving it, such as the
following, that show up in winapi-0.2:
```
 #[derive(Clone)]
 #[repr(packed)]
 struct MyType(i32);

 impl Copy for MyType {}
```
The new approach is simpler to understand and implement, and it avoids
the need for the `unsafe_derive_on_repr_packed` check.

One exception is required for backwards-compatibility: we allow `[u8]`
fields for now. There is a new lint for this,
`byte_slice_in_packed_struct_with_derive`.

16 months agoAuto merge of #103019 - Kobzol:ci-multistage-python, r=Mark-Simulacrum
bors [Sun, 29 Jan 2023 22:14:18 +0000 (22:14 +0000)]
Auto merge of #103019 - Kobzol:ci-multistage-python, r=Mark-Simulacrum

Port pgo.sh to Python

This PR ports the `pgo.sh` multi stage build file from bash to Python, to make it easier to add new functionality and gather statistics. Main changes:

1) `pgo.sh` rewritten from Bash to Python. Jump from ~200 Bash LOC to ~650 Python LOC. Bash is, unsurprisingly, more concise for running scripts and binaries.
2) Better logging. Each separate stage is now clearly separated in logs, and the logs can be quickly grepped to find out which stage has completed or failed, and how long it took.
3) Better statistics. At the end of the run, there is now a table that shows the duration of the individual stages, along with a percentual ratio of the total workflow run:

```
2023-01-15T18:13:49.9896916Z stage-build INFO: Timer results
2023-01-15T18:13:49.9902185Z ---------------------------------------------------------
2023-01-15T18:13:49.9902605Z Build rustc (LLVM PGO):                 1815.67s (21.47%)
2023-01-15T18:13:49.9902949Z Gather profiles (LLVM PGO):              418.73s ( 4.95%)
2023-01-15T18:13:49.9903269Z Build rustc (rustc PGO):                 584.46s ( 6.91%)
2023-01-15T18:13:49.9903835Z Gather profiles (rustc PGO):             806.32s ( 9.53%)
2023-01-15T18:13:49.9904154Z Build rustc (LLVM BOLT):                1662.92s (19.66%)
2023-01-15T18:13:49.9904464Z Gather profiles (LLVM BOLT):             715.18s ( 8.46%)
2023-01-15T18:13:49.9914463Z Final build:                            2454.00s (29.02%)
2023-01-15T18:13:49.9914798Z Total duration:                         8457.27s
2023-01-15T18:13:49.9915305Z ---------------------------------------------------------
```

A sample run can be seen [here](https://github.com/rust-lang/rust/actions/runs/3923980164/jobs/6707932029).

I tried to keep the code compatible with Python 3.6 and don't use dependencies, which required me to reimplement some small pieces of functionality (like formatting bytes). I suppose that it shouldn't be so hard to upgrade to a newer Python or install dependencies in the CI container, but I'd like to avoid it if it won't be needed.

The code is in a single file `stage-build.py`, so it's a bit cluttered. I can also separate it into multiple files, although having it in a single file has some benefits. The code could definitely be nicer, but I'm a bit wary of introducing a lot of abstraction and similar stuff, as long as the code is stuffed into a single file.

Currently, the Python pipeline should faithfully mirror the bash pipeline one by one. After this PR, I'd like to try to optimize it, e.g. by caching the LLVM builds on S3.

r? `@Mark-Simulacrum`

16 months agoRemove obsolete comment.
Camille GILLOT [Sun, 29 Jan 2023 22:09:51 +0000 (22:09 +0000)]
Remove obsolete comment.

16 months agoReimplement NormalizeArrayLen.
Camille GILLOT [Sat, 21 Jan 2023 20:51:21 +0000 (20:51 +0000)]
Reimplement NormalizeArrayLen.

16 months agoAuto merge of #107451 - matthiaskrgr:rollup-m4ucfu8, r=matthiaskrgr
bors [Sun, 29 Jan 2023 19:29:49 +0000 (19:29 +0000)]
Auto merge of #107451 - matthiaskrgr:rollup-m4ucfu8, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #96763 (Fix maintainer validation message)
 - #106540 (Insert whitespace to avoid ident concatenation in suggestion)
 - #106763 (print why a test was ignored if its the only test specified)
 - #106769 (libtest: Print why a test was ignored if it's the only test specified.)
 - #106798 (Implement `signum` with `Ord`)
 - #107006 (Output tree representation on thir-tree)
 - #107078 (Update wording of invalid_doc_attributes docs.)
 - #107169 (Pass `--locked` to the x test tidy call)
 - #107431 (docs: remove colon from time header)
 - #107432 (rustdoc: remove unused class `has-srclink`)
 - #107448 (When stamp doesn't exist, should say Error, and print path to stamp file)

Failed merges:

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

16 months agoUpdate tests.
Mara Bos [Thu, 8 Sep 2022 10:45:17 +0000 (12:45 +0200)]
Update tests.

16 months agoDon't re-export private/unstable ArgumentV1 from `alloc`.
Mara Bos [Thu, 8 Sep 2022 10:26:27 +0000 (12:26 +0200)]
Don't re-export private/unstable ArgumentV1 from `alloc`.

16 months agofix typo in {Rc, Arc}::get_mut_unchecked docs
y21 [Sun, 29 Jan 2023 19:11:36 +0000 (20:11 +0100)]
fix typo in {Rc, Arc}::get_mut_unchecked docs

16 months agoRollup merge of #107448 - Teapot4195:pr-107397-followup, r=Mark-Simulacrum
Matthias Krüger [Sun, 29 Jan 2023 19:03:39 +0000 (20:03 +0100)]
Rollup merge of #107448 - Teapot4195:pr-107397-followup, r=Mark-Simulacrum

When stamp doesn't exist, should say Error, and print path to stamp file

Follow up pr for #107397

16 months agoRollup merge of #107432 - notriddle:notriddle/has-srclink, r=GuillaumeGomez
Matthias Krüger [Sun, 29 Jan 2023 19:03:39 +0000 (20:03 +0100)]
Rollup merge of #107432 - notriddle:notriddle/has-srclink, r=GuillaumeGomez

rustdoc: remove unused class `has-srclink`

Stopped being used in CSS with 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0.

16 months agoRollup merge of #107431 - notriddle:notriddle/colon, r=thomcc
Matthias Krüger [Sun, 29 Jan 2023 19:03:38 +0000 (20:03 +0100)]
Rollup merge of #107431 - notriddle:notriddle/colon, r=thomcc

docs: remove colon from time header

It's not used anywhere else; the inconsistency is weird.

16 months agoRollup merge of #107169 - albertlarsan68:lock-in-pre-push, r=Mark-Simulacrum
Matthias Krüger [Sun, 29 Jan 2023 19:03:38 +0000 (20:03 +0100)]
Rollup merge of #107169 - albertlarsan68:lock-in-pre-push, r=Mark-Simulacrum

Pass `--locked` to the x test tidy call

This allows to fail the push when the `Cargo.lock` file needs to be updated.

16 months agoRollup merge of #107078 - ehuss:invalid_doc_attributes-docs, r=jackh726
Matthias Krüger [Sun, 29 Jan 2023 19:03:37 +0000 (20:03 +0100)]
Rollup merge of #107078 - ehuss:invalid_doc_attributes-docs, r=jackh726

Update wording of invalid_doc_attributes docs.

There was a typo in the original docs for `invalid_doc_attributes`. I felt it could use a little rewording to try to clarify the reasoning for the lint. Also, this adds the future-incompatible notice.

16 months agoRollup merge of #107006 - b-naber:thir-tree, r=jackh726
Matthias Krüger [Sun, 29 Jan 2023 19:03:37 +0000 (20:03 +0100)]
Rollup merge of #107006 - b-naber:thir-tree, r=jackh726

Output tree representation on thir-tree

The current output of `-Zunpretty=thir-tree` is really cumbersome to work with, using an actual tree representation should make it easier to see what the thir looks like.

16 months agoRollup merge of #106798 - scottmcm:signum-via-cmp, r=Mark-Simulacrum
Matthias Krüger [Sun, 29 Jan 2023 19:03:36 +0000 (20:03 +0100)]
Rollup merge of #106798 - scottmcm:signum-via-cmp, r=Mark-Simulacrum

Implement `signum` with `Ord`

Rather than needing to do things like #105840 for `signum` too, might as well just implement that method using `Ord`, since it's doing the same "I need `-1`/`0`/`+1`" behaviour that `cmp` is already doing.

This also seems to slightly improve the assembly: <https://rust.godbolt.org/z/5oEEqbxK1>

16 months agoRollup merge of #106769 - lenko-d:libtest-print_why_a_test_was_ignored_if_its_the_onl...
Matthias Krüger [Sun, 29 Jan 2023 19:03:36 +0000 (20:03 +0100)]
Rollup merge of #106769 - lenko-d:libtest-print_why_a_test_was_ignored_if_its_the_only_test_specified, r=Mark-Simulacrum

libtest: Print why a test was ignored if it's the only test specified.

Fixes [#106659](https://github.com/rust-lang/rust/issues/106659)
Needed by [106763](https://github.com/rust-lang/rust/pull/106763)

16 months agoRollup merge of #106763 - lenko-d:106659-Print_why_a_test_was_ignored_if_its_the_only...
Matthias Krüger [Sun, 29 Jan 2023 19:03:35 +0000 (20:03 +0100)]
Rollup merge of #106763 - lenko-d:106659-Print_why_a_test_was_ignored_if_its_the_only_test_specified, r=Mark-Simulacrum

print why a test was ignored if its the only test specified

Fixes [#106659](https://github.com/rust-lang/rust/issues/106659)

16 months agoRollup merge of #106540 - lowr:patch/remove-paren-whitespace, r=cjgillot
Matthias Krüger [Sun, 29 Jan 2023 19:03:35 +0000 (20:03 +0100)]
Rollup merge of #106540 - lowr:patch/remove-paren-whitespace, r=cjgillot

Insert whitespace to avoid ident concatenation in suggestion

This PR tweaks the suggestion of removing misplaced parentheses around trait bounds so as to avoid concatenating two identifiers. Although subtle, this should make outputs less surprising especially when applying the `MachineApplicable` suggestions automatically.

16 months agoRollup merge of #96763 - Abdur-rahmaanJ:patch-1, r=Mark-Simulacrum
Matthias Krüger [Sun, 29 Jan 2023 19:03:34 +0000 (20:03 +0100)]
Rollup merge of #96763 - Abdur-rahmaanJ:patch-1, r=Mark-Simulacrum

Fix maintainer validation message

State clearly why maintainer verification is not activating, ruling out the user thinking they misconfigured something.

16 months agoWhen stamp doesn't exist, should say Error, and print path to stamp file
teapot4195 [Sun, 29 Jan 2023 18:35:37 +0000 (13:35 -0500)]
When stamp doesn't exist, should say Error, and print path to stamp file

16 months agoAuto merge of #100178 - mati865:upgrade-mingw-w64-on-CI, r=nikic
bors [Sun, 29 Jan 2023 16:31:42 +0000 (16:31 +0000)]
Auto merge of #100178 - mati865:upgrade-mingw-w64-on-CI, r=nikic

Upgrade mingw-w64 on CI

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

This will require copying related archives mentioned in https://github.com/rust-lang/rust/pull/100178#issuecomment-1352060140 to Rust's mirror.

This should fix multiple issues with currently used ancient releases but I'll ask folks to retest them using nightly once it goes live.

16 months agoAuto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk
bors [Sun, 29 Jan 2023 13:01:06 +0000 (13:01 +0000)]
Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk

Implement simple CopyPropagation based on SSA analysis

This PR extracts the "copy propagation" logic from https://github.com/rust-lang/rust/pull/106285.

MIR may produce chains of assignment between locals, like `_x = move? _y`.
This PR attempts to remove such chains by unifying locals.

The current implementation is a bit overzealous in turning moves into copies, and in removing storage statements.

16 months agoInsert whitespace to avoid ident concatenation in suggestion
Ryo Yoshida [Thu, 5 Jan 2023 19:43:08 +0000 (04:43 +0900)]
Insert whitespace to avoid ident concatenation in suggestion

16 months agoUpgrade mingw-w64 on CI
Mateusz Mikuła [Fri, 5 Aug 2022 19:08:53 +0000 (21:08 +0200)]
Upgrade mingw-w64 on CI

16 months agoAuto merge of #106253 - nbdd0121:upcast, r=compiler-errors
bors [Sun, 29 Jan 2023 10:20:25 +0000 (10:20 +0000)]
Auto merge of #106253 - nbdd0121:upcast, r=compiler-errors

Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable`

Fix #106247

To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query).

cc `@dtolnay`
r? `@compiler-errors`

16 months agoAuto merge of #107435 - matthiaskrgr:rollup-if5h6yu, r=matthiaskrgr
bors [Sun, 29 Jan 2023 07:01:58 +0000 (07:01 +0000)]
Auto merge of #107435 - matthiaskrgr:rollup-if5h6yu, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #106618 (Disable `linux_ext` in wasm32 and fortanix rustdoc builds.)
 - #107097 (Fix def-use dominance check)
 - #107154 (library/std/sys_common: Define MIN_ALIGN for m68k-unknown-linux-gnu)
 - #107397 (Gracefully exit if --keep-stage flag is used on a clean source tree)
 - #107401 (remove the usize field from CandidateSource::AliasBound)
 - #107413 (make more pleasant to read)
 - #107422 (Also erase substs for new infcx in pin move error)
 - #107425 (Check for missing space between fat arrow and range pattern)

Failed merges:

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

16 months agoRollup merge of #107425 - clubby789:match-range-missing-space, r=compiler-errors
Matthias Krüger [Sun, 29 Jan 2023 05:14:20 +0000 (06:14 +0100)]
Rollup merge of #107425 - clubby789:match-range-missing-space, r=compiler-errors

Check for missing space between fat arrow and range pattern

Fixes #107420

Ideally we wouldn't emit an error about expecting `=>` etc., but I'm not sure how to recover from this.

`@rustbot` label +A-diagnostics

16 months agoRollup merge of #107422 - Nilstrieb:erase-the-ice, r=compiler-errors
Matthias Krüger [Sun, 29 Jan 2023 05:14:20 +0000 (06:14 +0100)]
Rollup merge of #107422 - Nilstrieb:erase-the-ice, r=compiler-errors

Also erase substs for new infcx in pin move error

The code originally correctly erased the regions of the type it passed to the newly created infcx. But after the `fn_sig` query was made to return an `EarlyBinder<T>`, some substs that were around were substituted there without erasing their regions. They were then passed into the newly cerated infcx, which caused the ICE.

Fixes #107419

r? compiler-errors who reviewed the original PR adding this diagnostic

16 months agoRollup merge of #107413 - tshepang:pleasant-readin, r=Nilstrieb
Matthias Krüger [Sun, 29 Jan 2023 05:14:19 +0000 (06:14 +0100)]
Rollup merge of #107413 - tshepang:pleasant-readin, r=Nilstrieb

make more pleasant to read

16 months agoRollup merge of #107401 - lenko-d:remove_the_usize_field_from_CandidateSource_AliasBo...
Matthias Krüger [Sun, 29 Jan 2023 05:14:18 +0000 (06:14 +0100)]
Rollup merge of #107401 - lenko-d:remove_the_usize_field_from_CandidateSource_AliasBound, r=compiler-errors

remove the usize field from CandidateSource::AliasBound

Fixes [#107380](https://github.com/rust-lang/rust/issues/107380)

16 months agoRollup merge of #107397 - Teapot4195:issue-107392-fix, r=albertlarsan68
Matthias Krüger [Sun, 29 Jan 2023 05:14:18 +0000 (06:14 +0100)]
Rollup merge of #107397 - Teapot4195:issue-107392-fix, r=albertlarsan68

Gracefully exit if --keep-stage flag is used on a clean source tree

Instead of quitting with an obscure No such file or directory error, give the user a clearer and easier to understand error (as well as suggesting a possible cause for the error).

This is the first time I have written rust since 2020, and the first PR I will ever make to rust, so please do point out any mistakes I have made :smile: .

This fixes #107392

16 months agoRollup merge of #107154 - glaubitz:m68k-alloc, r=JohnTitor
Matthias Krüger [Sun, 29 Jan 2023 05:14:17 +0000 (06:14 +0100)]
Rollup merge of #107154 - glaubitz:m68k-alloc, r=JohnTitor

library/std/sys_common: Define MIN_ALIGN for m68k-unknown-linux-gnu

This PR adds the missing definition of MIN_ALIGN for the m68k-unknown-linux target.

16 months agoRollup merge of #107097 - tmiasko:ssa, r=cjgillot
Matthias Krüger [Sun, 29 Jan 2023 05:14:17 +0000 (06:14 +0100)]
Rollup merge of #107097 - tmiasko:ssa, r=cjgillot

Fix def-use dominance check

A definition does not dominate a use in the same statement. For example
in MIR generated for compound assignment x += a (when overflow checks
are disabled).

16 months agoRollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitor
Matthias Krüger [Sun, 29 Jan 2023 05:14:16 +0000 (06:14 +0100)]
Rollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitor

Disable `linux_ext` in wasm32 and fortanix rustdoc builds.

The `std::os::unix` module is stubbed out when building docs for these target platforms. The introduction of Linux-specific extension traits caused `std::os::net` to depend on sub-modules of `std::os::unix`, which broke rustdoc for the `wasm32-unknown-unknown` target.

Adding an additional `#[cfg]` guard solves that rustdoc failure by not declaring `linux_ext` on targets with a stubbed `std::os::unix`.

Fixes #105467

16 months agoAuto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
bors [Sun, 29 Jan 2023 04:11:27 +0000 (04:11 +0000)]
Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk

Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877

16 months agoAuto merge of #107406 - cjgillot:eliminate-witnesses, r=compiler-errors
bors [Sun, 29 Jan 2023 01:27:11 +0000 (01:27 +0000)]
Auto merge of #107406 - cjgillot:eliminate-witnesses, r=compiler-errors

Only compute mir_generator_witnesses query in drop_tracking_mir mode.

Attempt to fix the perf regression in https://github.com/rust-lang/rust/pull/101692

r? `@ghost`

16 months agorustdoc: remove unused class `has-srclink`
Michael Howell [Sat, 28 Jan 2023 23:35:02 +0000 (16:35 -0700)]
rustdoc: remove unused class `has-srclink`

Stopped being used in CSS with
73d0f7c7b68784f1db0a1f53855c20d118a7e8b0

16 months agodocs: remove colon from time header
Michael Howell [Sat, 28 Jan 2023 23:07:34 +0000 (16:07 -0700)]
docs: remove colon from time header

It's not used anywhere else; the inconsistency is weird.

16 months agoAuto merge of #103659 - clubby789:improve-partialord-derive, r=nagisa
bors [Sat, 28 Jan 2023 22:11:11 +0000 (22:11 +0000)]
Auto merge of #103659 - clubby789:improve-partialord-derive, r=nagisa

Special-case deriving `PartialOrd` for enums with dataless variants

I was able to get slightly better codegen by flipping the derived `PartialOrd` logic for two-variant enums.  I also tried to document the implementation of the derive macro to make the special-case logic a little clearer.
```rs
#[derive(PartialEq, PartialOrd)]
pub enum A<T> {
    A,
    B(T)
}
```
```diff
impl<T: ::core::cmp::PartialOrd> ::core::cmp::PartialOrd for A<T> {
   #[inline]
   fn partial_cmp(
       &self,
       other: &A<T>,
   ) -> ::core::option::Option<::core::cmp::Ordering> {
       let __self_tag = ::core::intrinsics::discriminant_value(self);
       let __arg1_tag = ::core::intrinsics::discriminant_value(other);
-      match ::core::cmp::PartialOrd::partial_cmp(&__self_tag, &__arg1_tag) {
-          ::core::option::Option::Some(::core::cmp::Ordering::Equal) => {
-              match (self, other) {
-                  (A::B(__self_0), A::B(__arg1_0)) => {
-                      ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
-                  }
-                  _ => ::core::option::Option::Some(::core::cmp::Ordering::Equal),
-              }
+      match (self, other) {
+          (A::B(__self_0), A::B(__arg1_0)) => {
+              ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
           }
-          cmp => cmp,
+          _ => ::core::cmp::PartialOrd::partial_cmp(&__self_tag, &__arg1_tag),
       }
   }
}
```
Godbolt: [Current](https://godbolt.org/z/GYjEzG1T8), [New](https://godbolt.org/z/GoK78qx15)
I'm not sure how common a case comparing two enums like this (such as `Option`) is, and if it's worth the slowdown of adding a special case to the derive. If it causes overall regressions it might be worth just manually implementing this for `Option`.

16 months agoMigrate some range parsing diagnostics
clubby789 [Sat, 28 Jan 2023 21:16:50 +0000 (21:16 +0000)]
Migrate some range parsing diagnostics

16 months agoCheck for missing space between fat arrow and range pattern
clubby789 [Sat, 28 Jan 2023 20:02:00 +0000 (20:02 +0000)]
Check for missing space between fat arrow and range pattern

16 months agoGracefully exit when --keep-stage used on clean source tree
teapot4195 [Sat, 28 Jan 2023 20:20:27 +0000 (15:20 -0500)]
Gracefully exit when --keep-stage used on clean source tree

16 months agoMake unsizing_params_for_adt into a query
Michael Goulet [Sat, 21 Jan 2023 05:43:37 +0000 (05:43 +0000)]
Make unsizing_params_for_adt into a query

16 months agoAlso erase substs for new infcx in pin move error
Nilstrieb [Sat, 28 Jan 2023 19:43:16 +0000 (20:43 +0100)]
Also erase substs for new infcx in pin move error

The code originally correctly erased the regions of the type it passed
to the newly created infcx. But after the `fn_sig` query was made to
return an `EarlyBinder<T>`, some substs that were around were
substituted there without erasing their regions. They were then passed
into the newly cerated infcx, which caused the ICE.

16 months agoAuto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr
bors [Sat, 28 Jan 2023 19:41:21 +0000 (19:41 +0000)]
Auto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr

Intern `CanonicalVarValues`

So that they are copy :sparkles:

16 months agovec: Use SpecCloneIntoVec::clone_into to implement Vec::clone_from
Neil Roberts [Sat, 28 Jan 2023 13:52:31 +0000 (14:52 +0100)]
vec: Use SpecCloneIntoVec::clone_into to implement Vec::clone_from

In the past, Vec::clone_from was implemented using slice::clone_into.
The code from clone_into was later duplicated into clone_from in
8725e4c337, which is the commit that adds custom allocator support to
Vec. Presumably this was done because the slice::clone_into only works
for vecs with the default allocator so it would have the wrong type to
clone into Vec<T, A>.

Now that the clone_into implementation is moved out into a specializable
trait anyway we might as well use that to share the code between the two
methods.

16 months agoslice: Add a specialization for clone_into when T is Copy
Neil Roberts [Sat, 28 Jan 2023 13:19:01 +0000 (14:19 +0100)]
slice: Add a specialization for clone_into when T is Copy

The implementation for the ToOwned::clone_into method on [T] is a copy
of the code for vec::clone_from. In 361398009be6 the code for
vec::clone_from gained a specialization for when T is Copy. This commit
copies that specialization over to the clone_into implementation.

16 months agoAuto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
bors [Sat, 28 Jan 2023 16:11:33 +0000 (16:11 +0000)]
Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin

Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

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

16 months agoReintroduce multiple_supertrait_upcastable lint
Gary Guo [Fri, 9 Dec 2022 02:27:03 +0000 (02:27 +0000)]
Reintroduce multiple_supertrait_upcastable lint

16 months agoRename `is_object_safe` to `check_is_object_safe` to hint side effects
Gary Guo [Sat, 28 Jan 2023 15:07:21 +0000 (15:07 +0000)]
Rename `is_object_safe` to `check_is_object_safe` to hint side effects

16 months agoMake `is_object_safe` a query and move lint_object_unsafe_trait call there
Gary Guo [Thu, 29 Dec 2022 09:53:25 +0000 (09:53 +0000)]
Make `is_object_safe` a query and move lint_object_unsafe_trait call there

16 months agoReplace `object_safety_violations().is_empty()` calls with `is_object_safe`
Gary Guo [Thu, 29 Dec 2022 09:52:46 +0000 (09:52 +0000)]
Replace `object_safety_violations().is_empty()` calls with `is_object_safe`

16 months agomake more pleasant to read
Tshepang Mbambo [Sat, 28 Jan 2023 14:35:07 +0000 (16:35 +0200)]
make more pleasant to read

16 months agoAuto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgr
bors [Sat, 28 Jan 2023 13:12:59 +0000 (13:12 +0000)]
Auto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader)
 - #104252 (Stabilize the const_socketaddr feature)
 - #105524 (Replace libc::{type} with crate::ffi::{type})
 - #107096 (Detect references to non-existant messages in Fluent resources)
 - #107355 (Add regression test for #60755)
 - #107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`)
 - #107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`)
 - #107391 (rustdoc: remove inline javascript from copy-path button)
 - #107398 (Remove `ControlFlow::{BREAK, CONTINUE}`)

Failed merges:

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

16 months agoUse field-less variant for AliasBound.
Lenko Donchev [Sat, 28 Jan 2023 12:00:27 +0000 (06:00 -0600)]
Use field-less variant for AliasBound.

16 months agoRollup merge of #107398 - scottmcm:its-their-funeral, r=dtolnay
Matthias Krüger [Sat, 28 Jan 2023 10:11:09 +0000 (11:11 +0100)]
Rollup merge of #107398 - scottmcm:its-their-funeral, r=dtolnay

Remove `ControlFlow::{BREAK, CONTINUE}`

Libs-API decided to remove these in #102697.

Follow-up to #107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged.

r? libs

16 months agoRollup merge of #107391 - notriddle:notriddle/copy-path-button, r=GuillaumeGomez
Matthias Krüger [Sat, 28 Jan 2023 10:11:09 +0000 (11:11 +0100)]
Rollup merge of #107391 - notriddle:notriddle/copy-path-button, r=GuillaumeGomez

rustdoc: remove inline javascript from copy-path button

16 months agoRollup merge of #107385 - BoxyUwU:ConstInferUnifier_is_folder, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:08 +0000 (11:11 +0100)]
Rollup merge of #107385 - BoxyUwU:ConstInferUnifier_is_folder, r=compiler-errors

Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`

I am not sure why this was using a `TypeRelation`, maybe it predates the ability to have fallible type folders

16 months agoRollup merge of #107384 - Nilstrieb:bool-for-deletion, r=oli-obk
Matthias Krüger [Sat, 28 Jan 2023 10:11:08 +0000 (11:11 +0100)]
Rollup merge of #107384 - Nilstrieb:bool-for-deletion, r=oli-obk

Remove `BOOL_TY_FOR_UNIT_TESTING`

It is not used anymore for unit testing.

16 months agoRollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:07 +0000 (11:11 +0100)]
Rollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors

Add regression test for #60755

Closes #60755
r? compiler-errors
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
16 months agoRollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errors
Matthias Krüger [Sat, 28 Jan 2023 10:11:07 +0000 (11:11 +0100)]
Rollup merge of #107096 - clubby789:fluent-bad-messageref, r=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like #107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes #107370

```@rustbot``` label +A-translation

16 months agoRollup merge of #105524 - Ayush1325:libc-free, r=ChrisDenton
Matthias Krüger [Sat, 28 Jan 2023 10:11:06 +0000 (11:11 +0100)]
Rollup merge of #105524 - Ayush1325:libc-free, r=ChrisDenton

Replace libc::{type} with crate::ffi::{type}

Replace libc::{type} imports with crate::ffi::{type} outside of `std::sys` and `std::os`.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
16 months agoRollup merge of #104252 - faern:stabilize-const_socketaddr, r=JohnTitor
Matthias Krüger [Sat, 28 Jan 2023 10:11:06 +0000 (11:11 +0100)]
Rollup merge of #104252 - faern:stabilize-const_socketaddr, r=JohnTitor

Stabilize the const_socketaddr feature

Stabilizes `#![feature(const_socketaddr)]`. Tracking issue: #82485
Closes #82485

This has been unstably const for over a year now. And the code change simplifying the constness of the `new` constructors has been in stable Rust since 1.64 (a bit over a full release cycle). I'm not aware of any blockers to this stabilization.

16 months agoRollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, r=petrochenkov
Matthias Krüger [Sat, 28 Jan 2023 10:11:05 +0000 (11:11 +0100)]
Rollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, r=petrochenkov

Improve unexpected close and mismatch delimiter hint in TokenTreesReader

Fixes #103882
Fixes #68987
Fixes #69259

The inner indentation mismatching will be covered by outer block, the new added function `report_error_prone_delim_block` will find out the error prone candidates for reporting.

16 months agoAuto merge of #106916 - lukas-code:overlapping-substs, r=estebank
bors [Sat, 28 Jan 2023 10:00:56 +0000 (10:00 +0000)]
Auto merge of #106916 - lukas-code:overlapping-substs, r=estebank

Remove overlapping parts of multipart suggestions

This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes https://github.com/rust-lang/rust/issues/106870.

Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore.

I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.

16 months agoAdapt ui-fulldeps.
Camille GILLOT [Sun, 22 Jan 2023 18:45:37 +0000 (18:45 +0000)]
Adapt ui-fulldeps.

16 months agoRemove `HirId -> LocalDefId` map from HIR.
Camille GILLOT [Sat, 5 Nov 2022 15:33:58 +0000 (15:33 +0000)]
Remove `HirId -> LocalDefId` map from HIR.

16 months agoTake a LocalDefId in hir::Visitor::visit_fn.
Camille GILLOT [Sun, 22 Jan 2023 18:00:33 +0000 (18:00 +0000)]
Take a LocalDefId in hir::Visitor::visit_fn.

16 months agoOnly compute mir_generator_witnesses query in drop_tracking_mir mode.
Camille GILLOT [Sat, 28 Jan 2023 08:41:22 +0000 (08:41 +0000)]
Only compute mir_generator_witnesses query in drop_tracking_mir mode.

16 months agoAuto merge of #107400 - matthiaskrgr:rollup-l6bycds, r=matthiaskrgr
bors [Sat, 28 Jan 2023 06:46:42 +0000 (06:46 +0000)]
Auto merge of #107400 - matthiaskrgr:rollup-l6bycds, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107022 (Implement `SpecOptionPartialEq` for `cmp::Ordering`)
 - #107100 (Use proper `InferCtxt` when probing for associated types in astconv)
 - #107103 (Use new solver in `evaluate_obligation` query (when new solver is enabled))
 - #107190 (Recover from more const arguments that are not wrapped in curly braces)
 - #107306 (Correct suggestions for closure arguments that need a borrow)
 - #107339 (internally change regions to be covariant)
 - #107344 (Minor tweaks in the new solver)
 - #107373 (Don't merge vtables when full debuginfo is enabled.)

Failed merges:

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

16 months agoReplace libc::{type} with crate::ffi::{type}
Ayush Singh [Sat, 10 Dec 2022 08:04:19 +0000 (13:34 +0530)]
Replace libc::{type} with crate::ffi::{type}

Replace libc::{type} imports with crate::ffi::{type} outside of
`std::sys` and `std::os`.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
16 months agoremove the usize field from CandidateSource::AliasBound
Lenko Donchev [Sat, 28 Jan 2023 04:50:24 +0000 (22:50 -0600)]
remove the usize field from CandidateSource::AliasBound

16 months agoRemove from librustdoc and clippy too
Scott McMurray [Sat, 28 Jan 2023 04:02:51 +0000 (20:02 -0800)]
Remove from librustdoc and clippy too