]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoRollup merge of #106749 - glandium:dwarf, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:00 +0000 (23:21 -0500)]
Rollup merge of #106749 - glandium:dwarf, r=Mark-Simulacrum

Update cc to 1.0.77

Fixes (without a test) #98746.

17 months agoRollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8Ki
Michael Goulet [Sun, 22 Jan 2023 04:20:59 +0000 (23:20 -0500)]
Rollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8Ki

Label closure captures/generator locals that make opaque types recursive

cc https://github.com/rust-lang/rust/issues/46415#issuecomment-1374665828

17 months agoRollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:20:59 +0000 (23:20 -0500)]
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum

Improve the documentation of `black_box`

There don't seem to be many great resources on how `black_box` should be used, so I added some information here

17 months agoRollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic

llvm-wrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.

17 months agoRollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco

Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report

See https://github.com/rust-lang/rust/issues/79813 for a discussion of this lint. This has been warn-by-default for over a year, so adding it to the future-incompat report should help to find libraries that haven't yet updated.

17 months agoAuto merge of #106948 - cuviper:ci-mingw-check, r=nikic
bors [Sat, 21 Jan 2023 21:42:21 +0000 (21:42 +0000)]
Auto merge of #106948 - cuviper:ci-mingw-check, r=nikic

ci: upgrade mingw-check to ubuntu:22.04

17 months agoAdd `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report
Aaron Hill [Sat, 22 Oct 2022 22:28:08 +0000 (17:28 -0500)]
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report

17 months agoAuto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
bors [Sat, 21 Jan 2023 17:44:20 +0000 (17:44 +0000)]
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum

Remap paths in UI tests by default

If you think this needs further discussions / something RFC-like, please let me know the best forum for that.

This PR runs UI tests with a remapped "src base" directory by default.

Why? Because some UI tests currently depend on the length of the absolute path to the `src/test/ui` directory. Remapping makes the tests independent of the absolute path.

The path to the source file (which is absolute on CI) is part of the type name of closures. `rustc` diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics.

(I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)).

Additional changes:

* All boolean `compiletest` directives now support explicit `no-` versions to disable them.
* Adapt existing tests when necessary:
  * Disable remapping for individual tests that fail with it enabled (when there's no obvious alternative fix).
  * For tests that already check something remapping related switch to the new option unless we gain something significant by keeping the manual remap.

Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590

17 months agoAuto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obk
bors [Sat, 21 Jan 2023 14:18:17 +0000 (14:18 +0000)]
Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obk

Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)

This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.

The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.

~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~

Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)).

Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).

r? `@ghost`

17 months agoAuto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillot
bors [Sat, 21 Jan 2023 11:02:29 +0000 (11:02 +0000)]
Auto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillot

Lazy dominator tree construction in borrowck

Motivated by the observation that sometimes constructed dominator tree was never queried.

17 months agoAuto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
bors [Sat, 21 Jan 2023 07:49:09 +0000 (07:49 +0000)]
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister

Simplify `derive(Debug)` output for fieldless enums

Fixes #106875

17 months agoLabel closure captures/generator locals that make opaque types recursive
Michael Goulet [Sun, 8 Jan 2023 00:29:30 +0000 (00:29 +0000)]
Label closure captures/generator locals that make opaque types recursive

17 months agoAuto merge of #107143 - compiler-errors:rollup-zabvmo5, r=compiler-errors
bors [Sat, 21 Jan 2023 04:19:03 +0000 (04:19 +0000)]
Auto merge of #107143 - compiler-errors:rollup-zabvmo5, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #104154 (Change `bindings_with_variant_name` to deny-by-default)
 - #104347 (diagnostics: suggest changing `s@self::{macro}`@::macro`` for exported)
 - #104672 (Unify stable and unstable sort implementations in same core module)
 - #107048 (check for x version updates)
 - #107061 (Implement some more new solver candidates and fix some bugs)
 - #107095 (rustdoc: remove redundant CSS selector `.sidebar .current`)
 - #107112 (Fix typo in opaque_types.rs)
 - #107124 (fix check macro expansion)
 - #107131 (rustdoc: use CSS inline layout for radio line instead of flexbox)

Failed merges:

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

17 months agoRollup merge of #107131 - notriddle:notriddle/rustdoc-radio-display-inline-flex,...
Michael Goulet [Sat, 21 Jan 2023 02:33:24 +0000 (21:33 -0500)]
Rollup merge of #107131 - notriddle:notriddle/rustdoc-radio-display-inline-flex, r=GuillaumeGomez

rustdoc: use CSS inline layout for radio line instead of flexbox

This uses less code to lay them out the same way. Already tested here:

https://github.com/rust-lang/rust/blob/5ce39f42bd2c8bca9c570f0560ebe1fce4eddb14/tests/rustdoc-gui/settings.goml#L123

17 months agoRollup merge of #107124 - DebugSteven:check-macro-expansion, r=albertlarsan68
Michael Goulet [Sat, 21 Jan 2023 02:33:24 +0000 (21:33 -0500)]
Rollup merge of #107124 - DebugSteven:check-macro-expansion, r=albertlarsan68

fix check macro expansion

If the only argument to `check!` is the module name I get this error:

```
error: expected expression, found `,`
   --> src/tools/tidy/src/main.rs:63:42
    |
57  | /         macro_rules! check {
58  | |             ($p:ident $(, $args:expr)* ) => {
59  | |                 drain_handles(&mut handles);
60  | |
...   |
63  | |                     $p::check($($args),* , &mut flag);
    | |                                          ^ expected expression
...   |
69  | |             }
70  | |         }
    | |_________- in this expansion of `check!`
...
117 |           check!(hey);
    |           ----------- in this macro invocation
```

This change makes it so commas are added only when there are `args`.

r? ```@albertlarsan68```

17 months agoRollup merge of #107112 - eltociear:patch-19, r=albertlarsan68
Michael Goulet [Sat, 21 Jan 2023 02:33:23 +0000 (21:33 -0500)]
Rollup merge of #107112 - eltociear:patch-19, r=albertlarsan68

Fix typo in opaque_types.rs

paramters -> parameters

17 months agoRollup merge of #107095 - notriddle:notriddle/sidebar-current, r=GuillaumeGomez
Michael Goulet [Sat, 21 Jan 2023 02:33:23 +0000 (21:33 -0500)]
Rollup merge of #107095 - notriddle:notriddle/sidebar-current, r=GuillaumeGomez

rustdoc: remove redundant CSS selector `.sidebar .current`

Since the current sidebar item is already a link, it doesn't do anything.

17 months agoRollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr
Michael Goulet [Sat, 21 Jan 2023 02:33:22 +0000 (21:33 -0500)]
Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr

Implement some more new solver candidates and fix some bugs

First, fix some bugs:

1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix.
2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes!
3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄
4. Check GATs' own predicates during projection confirmation.

Then implement a few builtin traits:

5. Implement `PointerSized`. Pretty independent.
6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test.

r? ```@lcnr```

17 months agoRollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
Michael Goulet [Sat, 21 Jan 2023 02:33:22 +0000 (21:33 -0500)]
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68

check for x version updates

This PR adds a check to tidy to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It checks the installed version of `x` by parsing the output of `cargo install --list` (as an option proposed in this [issue](https://github.com/rust-lang/rust/issues/106469)).

It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.

17 months agoRollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
Michael Goulet [Sat, 21 Jan 2023 02:33:21 +0000 (21:33 -0500)]
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc

Unify stable and unstable sort implementations in same core module

This moves the stable sort implementation to the core::slice::sort module. By virtue of being in core it can't access `Vec`. The two `Vec` used by merge sort, `buf` and `runs`, are modelled as custom types that implement the very limited required `Vec` interface with the help of provided allocation and free functions. This is done to allow future re-use of functions and logic between stable and unstable sort. Such as `insert_head`.

This is in preparation of #100856 and #104116. It only moves code, it *doesn't* change any of the sort related logic. This unlocks the ability to share `insert_head`, `insert_tail`, `swap_if_less` `merge` and more.

Tagging ````@Mark-Simulacrum```` I hope this allows progress on #100856, by moving `merge_sort` here I hope future changes will be easier to review.

17 months agoRollup merge of #104347 - notriddle:notriddle/import-macro-from-self-fixup, r=TaKO8Ki
Michael Goulet [Sat, 21 Jan 2023 02:33:21 +0000 (21:33 -0500)]
Rollup merge of #104347 - notriddle:notriddle/import-macro-from-self-fixup, r=TaKO8Ki

diagnostics: suggest changing `s@self::{macro}@::macro` for exported

Fixes #99695

17 months agoRollup merge of #104154 - timrobertsdev:deny-by-default-bindings_with_variant_name...
Michael Goulet [Sat, 21 Jan 2023 02:33:20 +0000 (21:33 -0500)]
Rollup merge of #104154 - timrobertsdev:deny-by-default-bindings_with_variant_name, r=scottmcm

Change `bindings_with_variant_name` to deny-by-default

Changed the `bindings_with_variant_name` lint to deny-by-default and fixed up the affected tests.

Addresses #103442.

17 months agoAuto merge of #107139 - rust-lang:pa-bump-git2, r=Mark-Simulacrum
bors [Sat, 21 Jan 2023 01:18:13 +0000 (01:18 +0000)]
Auto merge of #107139 - rust-lang:pa-bump-git2, r=Mark-Simulacrum

[master] Update git2 version

This PR bumps the version of the `git2` and `libgit2-sys` crates to pull in fixes for https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3.

This **does not fix any security vulnerability**: Cargo is already protected thanks to the fixes we implemented as part of CVE-2022-46176. The only purpose of this PR is to avoid dependency scanners from flagging vulnerabilities.

17 months agoupdate git2 dependency
Pietro Albini [Fri, 20 Jan 2023 23:17:15 +0000 (00:17 +0100)]
update git2 dependency

17 months agodiagnostics: remvoe unnecessary use of `source_map.start_point`
Michael Howell [Tue, 6 Dec 2022 15:44:48 +0000 (08:44 -0700)]
diagnostics: remvoe unnecessary use of `source_map.start_point`

17 months agodiagnostics: use `module_path` to check crate import instead of strings
Michael Howell [Tue, 6 Dec 2022 15:42:30 +0000 (08:42 -0700)]
diagnostics: use `module_path` to check crate import instead of strings

17 months agodiagnostics: add `};` only if `{` was added too
Michael Howell [Sun, 13 Nov 2022 05:08:07 +0000 (22:08 -0700)]
diagnostics: add `};` only if `{` was added too

17 months agodiagnostics: suggest changing `s@self::{macro}@::macro` for exported
Michael Howell [Sun, 13 Nov 2022 04:46:05 +0000 (21:46 -0700)]
diagnostics: suggest changing `s@self::{macro}@::macro` for exported

Fixes #99695

17 months agoAuto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
bors [Fri, 20 Jan 2023 21:29:52 +0000 (21:29 +0000)]
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr

Check ADT fields for copy implementations considering regions

Fixes #88901
r? `@ghost`

17 months agorustdoc: use CSS inline layout for radio line instead of flexbox
Michael Howell [Fri, 20 Jan 2023 21:28:16 +0000 (14:28 -0700)]
rustdoc: use CSS inline layout for radio line instead of flexbox

This uses less code to lay them out the same way.

17 months agoAuto merge of #107120 - weihanglo:update-cargo, r=weihanglo
bors [Fri, 20 Jan 2023 18:25:42 +0000 (18:25 +0000)]
Auto merge of #107120 - weihanglo:update-cargo, r=weihanglo

Update cargo

3 commits in 50eb688c2bbea5de5a2e8496230a7428798089d1..985d561f0bb9b76ec043a2b12511790ec7a2b954

2023-01-19 10:09:05 +0000 to 2023-01-20 14:39:28 +0000
- Stabilize sparse-registry (rust-lang/cargo#11224)
- Wrapper type for data that should never be logged (rust-lang/cargo#11545)
- Add semver rule for lints (rust-lang/cargo#11596)

r? `@ghost`

17 months agoremove leading comma when there are no args in check macro expansion
DebugSteven [Thu, 19 Jan 2023 20:56:15 +0000 (13:56 -0700)]
remove leading comma when there are no args in check macro expansion

17 months agorun cargo install to check for x installation and version
DebugSteven [Thu, 5 Jan 2023 04:57:20 +0000 (21:57 -0700)]
run cargo install to check for x installation and version

17 months agoUpdate cargo
Weihang Lo [Fri, 20 Jan 2023 15:52:56 +0000 (15:52 +0000)]
Update cargo

3 commits in 50eb688c2bbea5de5a2e8496230a7428798089d1..985d561f0bb9b76ec043a2b12511790ec7a2b954

2023-01-19 10:09:05 +0000 to 2023-01-20 14:39:28 +0000
- Stabilize sparse-registry (rust-lang/cargo#11224)
- Wrapper type for data that should never be logged (rust-lang/cargo#11545)
- Add semver rule for lints (rust-lang/cargo#11596)

17 months agoAuto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgr
bors [Fri, 20 Jan 2023 15:28:40 +0000 (15:28 +0000)]
Auto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #106699 ([drop tracking] Visit break expressions )
 - #106738 (Fix known-bug annotations)
 - #106891 (Tweak "borrow closure argument" suggestion)
 - #106928 (add raw identifier for keyword in suggestion)
 - #107065 (Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic)
 - #107068 (autoderive Subdiagnostic for AddtoExternBlockSuggestion)

Failed merges:

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

17 months agoAuto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgr
bors [Fri, 20 Jan 2023 12:58:13 +0000 (12:58 +0000)]
Auto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #106783 (Recover labels written as identifiers)
 - #106973 (Don't treat closures from other crates as local)
 - #106979 (Document how to get the type of a default associated type)
 - #107053 (signal update string representation for haiku.)
 - #107058 (Recognise double-equals homoglyph)
 - #107067 (Custom MIR: Support storage statements)
 - #107076 (Added const-generic ui test case for issue #106419)
 - #107091 (Fix broken format strings in `infer.ftl`)

Failed merges:

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

17 months agoFix typo in opaque_types.rs
Ikko Eltociear Ashimine [Fri, 20 Jan 2023 08:56:29 +0000 (17:56 +0900)]
Fix typo in opaque_types.rs

paramters -> parameters

17 months agoAdd `compile_fail` to doctest for `bindings_with_variant_name`
--global [Tue, 8 Nov 2022 16:01:03 +0000 (11:01 -0500)]
Add `compile_fail` to doctest for `bindings_with_variant_name`

17 months agoChange `bindings_with_variant_name` to deny-by-default
--global [Tue, 8 Nov 2022 15:24:06 +0000 (10:24 -0500)]
Change `bindings_with_variant_name` to deny-by-default

17 months agoRollup merge of #107068 - mejrs:use_derive, r=estebank
Matthias Krüger [Fri, 20 Jan 2023 06:25:30 +0000 (07:25 +0100)]
Rollup merge of #107068 - mejrs:use_derive, r=estebank

autoderive Subdiagnostic for AddtoExternBlockSuggestion

17 months agoRollup merge of #107065 - flip1995:clippyup, r=Manishearth
Matthias Krüger [Fri, 20 Jan 2023 06:25:29 +0000 (07:25 +0100)]
Rollup merge of #107065 - flip1995:clippyup, r=Manishearth

Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic

This was merged one day too late in order to make it into the last sync. But since we talked about moving this lint to `pedantic` in the meeting, I'd like to get this in rather sooner than later.

https://github.com/rust-lang/rust-clippy/pull/10194

r? ``@Manishearth``

17 months agoRollup merge of #106928 - bvanjoi:print-keyword-raw-identifier, r=petrochenkov
Matthias Krüger [Fri, 20 Jan 2023 06:25:29 +0000 (07:25 +0100)]
Rollup merge of #106928 - bvanjoi:print-keyword-raw-identifier, r=petrochenkov

add raw identifier for keyword in suggestion

fix https://github.com/rust-lang/rust/issues/106841

17 months agoRollup merge of #106891 - estebank:issue-45727, r=petrochenkov
Matthias Krüger [Fri, 20 Jan 2023 06:25:28 +0000 (07:25 +0100)]
Rollup merge of #106891 - estebank:issue-45727, r=petrochenkov

Tweak "borrow closure argument" suggestion

Fix #45727.

17 months agoRollup merge of #106738 - compiler-errors:known-bugs-oops, r=jackh726
Matthias Krüger [Fri, 20 Jan 2023 06:25:28 +0000 (07:25 +0100)]
Rollup merge of #106738 - compiler-errors:known-bugs-oops, r=jackh726

Fix known-bug annotations

r? ``@Nilstrieb``

17 months agoRollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser
Matthias Krüger [Fri, 20 Jan 2023 06:25:27 +0000 (07:25 +0100)]
Rollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser

[drop tracking] Visit break expressions

This fixes https://github.com/rust-lang/rust/issues/102383 by remembering to visit the expression in `break expr` when building the drop tracking CFG. Missing this step was causing an off-by-one error which meant after a number of awaits we'd be
looking for dropped values at the wrong point in the code.

Additionally, this changes the order of traversal for assignment expressions to visit the rhs and then the lhs. This matches what is done elsewhere.

Finally, this improves some of the debugging output (for example, the CFG visualizer) to make it easier to figure out these sorts of issues.

17 months agoRollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors
Matthias Krüger [Fri, 20 Jan 2023 06:16:12 +0000 (07:16 +0100)]
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors

Fix broken format strings in `infer.ftl`

Fixes #107088

17 months agoRollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors
Matthias Krüger [Fri, 20 Jan 2023 06:16:11 +0000 (07:16 +0100)]
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors

Added const-generic ui test case for issue #106419

This PR adds a test case for #106419 which has been fixed in master by #105292

I also ran the test on f769d34291e489db19d3c972348ddb24b6b32481 (the commit before #105292 was merged)
and it did fail there with the following output.
```
--- stderr -------------------------------
error[E0308]: mismatched types
  --> /home/patrikk/src/rust/src/test/ui/const-generics/issue-106419-struct-with-multiple-const-params.rs:5:10
   |
LL | #[derive(Clone)]
   |          ^^^^^
   |          |
   |          expected `A`, found `B`
   |          expected `Bar<A, B>` because of return type
   |
   = note: expected struct `Bar<A, _>`
              found struct `Bar<B, _>`
   = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
------------------------------------------
```

17 months agoRollup merge of #107067 - tmiasko:custom-mir-storage-statements, r=oli-obk
Matthias Krüger [Fri, 20 Jan 2023 06:16:11 +0000 (07:16 +0100)]
Rollup merge of #107067 - tmiasko:custom-mir-storage-statements, r=oli-obk

Custom MIR: Support storage statements

r? `@oli-obk` `@JakobDegen`

17 months agoRollup merge of #107058 - clubby789:eqeq-homoglyph, r=wesleywiser
Matthias Krüger [Fri, 20 Jan 2023 06:16:10 +0000 (07:16 +0100)]
Rollup merge of #107058 - clubby789:eqeq-homoglyph, r=wesleywiser

Recognise double-equals homoglyph

Recognise `⩵` as a homoglyph for `==`.

The first commit switches `char` to `&str`, as all previous homoglyphs corresponded to a single ASCII character, while the second implements the fix.

`@rustbot` label +A-diagnostics +A-parser

17 months agoRollup merge of #107053 - devnexen:sigstringrepr_haiku, r=thomcc
Matthias Krüger [Fri, 20 Jan 2023 06:16:10 +0000 (07:16 +0100)]
Rollup merge of #107053 - devnexen:sigstringrepr_haiku, r=thomcc

signal update string representation for haiku.

17 months agoRollup merge of #106979 - Nilstrieb:type-of-default-assoc-type, r=petrochenkov
Matthias Krüger [Fri, 20 Jan 2023 06:16:09 +0000 (07:16 +0100)]
Rollup merge of #106979 - Nilstrieb:type-of-default-assoc-type, r=petrochenkov

Document how to get the type of a default associated type

17 months agoRollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
Matthias Krüger [Fri, 20 Jan 2023 06:16:09 +0000 (07:16 +0100)]
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr

Don't treat closures from other crates as local

fixes #104817

r? `@lcnr`

Specialization can prefer an impl for an opaque type over a blanket impls that also matches. If the blanket impl only applies if an auto-trait applies, we look at the hidden type of the opaque type to see if that implements the auto trait. The hidden type can be a closure or generator, and thus we will end up seeing these types in coherence and have to handle them properly.

17 months agoRollup merge of #106783 - WaffleLapkin:break-my-ident, r=wesleywiser
Matthias Krüger [Fri, 20 Jan 2023 06:16:08 +0000 (07:16 +0100)]
Rollup merge of #106783 - WaffleLapkin:break-my-ident, r=wesleywiser

Recover labels written as identifiers

This adds recovery for `break label expr` and `continue label`, as well as a test for `break label`.

17 months agoAuto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
bors [Fri, 20 Jan 2023 04:52:28 +0000 (04:52 +0000)]
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb

Remove some `ref` patterns from the compiler

Previous PR: https://github.com/rust-lang/rust/pull/105368

r? `@Nilstrieb`

17 months agoAuto merge of #107083 - GuillaumeGomez:revert-104889, r=notriddle
bors [Fri, 20 Jan 2023 01:55:36 +0000 (01:55 +0000)]
Auto merge of #107083 - GuillaumeGomez:revert-104889, r=notriddle

rustdoc: Revert #104889

Reverts #104889.

I don't think I'll be able to finish https://github.com/rust-lang/rust/pull/107000 on time unfortunately so to prevent https://github.com/rust-lang/rust/issues/106373, better to revert it and to make it into the next release.

r? `@notriddle`

17 months agorustdoc: remove redundant CSS selector `.sidebar .current`
Michael Howell [Thu, 19 Jan 2023 23:30:05 +0000 (16:30 -0700)]
rustdoc: remove redundant CSS selector `.sidebar .current`

Since the current sidebar item is already a link, it doesn't
do anything.

17 months agoFix broken format strings in `infer.ftl`
clubby789 [Thu, 19 Jan 2023 23:13:01 +0000 (23:13 +0000)]
Fix broken format strings in `infer.ftl`

17 months agoAuto merge of #107072 - weihanglo:update-cargo, r=weihanglo
bors [Thu, 19 Jan 2023 22:40:12 +0000 (22:40 +0000)]
Auto merge of #107072 - weihanglo:update-cargo, r=weihanglo

Update cargo

3 commits in a5d47a72595dd6fbe7d4e4f6ec20dc5fe724edd1..50eb688c2bbea5de5a2e8496230a7428798089d1 2023-01-16 18:51:50 +0000 to 2023-01-19 10:09:05 +0000

- Normalize git deps when doing `cargo vendor` for resolving deps inherited from a workspace (rust-lang/cargo#11414)
- Ignore `workspace.default-members` when running `cargo install` on root package of a non-virtual workspace (rust-lang/cargo#11067)
- Corrected documentation of how to cache binaries installed with `cargo install` in CI workflows (rust-lang/cargo#11592)

r? `@ghost`

17 months agoMake bare known-bug an error
Michael Goulet [Wed, 11 Jan 2023 19:44:49 +0000 (19:44 +0000)]
Make bare known-bug an error

17 months agoFix known-bug, silence ICE stderr
Michael Goulet [Wed, 11 Jan 2023 19:42:27 +0000 (19:42 +0000)]
Fix known-bug, silence ICE stderr

17 months agoTweak "borrow closure argument" suggestion
Esteban Küber [Sat, 14 Jan 2023 23:53:56 +0000 (23:53 +0000)]
Tweak "borrow closure argument" suggestion

Fix #45727.

17 months agoRevert "Fix missing const expression items visit"
Guillaume Gomez [Thu, 19 Jan 2023 19:28:17 +0000 (20:28 +0100)]
Revert "Fix missing const expression items visit"

This reverts commit cdfc5051b1286938f56160243c28538f79dce6b1.

17 months agoRevert "Add regression test for impl blocks in const expr"
Guillaume Gomez [Thu, 19 Jan 2023 19:27:37 +0000 (20:27 +0100)]
Revert "Add regression test for impl blocks in const expr"

This reverts commit 9cce0bc583ee2cff88935ce0e08d8ec1eb1239a8.

17 months agoRevert "Update newly failing UI tests"
Guillaume Gomez [Thu, 19 Jan 2023 19:27:00 +0000 (20:27 +0100)]
Revert "Update newly failing UI tests"

This reverts commit 9c46173895430c63066731440e00faf0ab2195dd.

17 months agoRevert "Improve code readability"
Guillaume Gomez [Thu, 19 Jan 2023 19:26:01 +0000 (20:26 +0100)]
Revert "Improve code readability"

This reverts commit eb93d1bedeab64c6f5d661df6a309a5b8a9273ca.

17 months agoRevert "Speed up execution a bit by removing some walks"
Guillaume Gomez [Thu, 19 Jan 2023 19:25:53 +0000 (20:25 +0100)]
Revert "Speed up execution a bit by removing some walks"

This reverts commit a9d582f51f547583380f2f2894ae0c799b609a86.

17 months agoRevert "Improve code"
Guillaume Gomez [Thu, 19 Jan 2023 19:25:46 +0000 (20:25 +0100)]
Revert "Improve code"

This reverts commit a954d6334d000225ae38f65f5f9e9c182e6764ae.

17 months agoAuto merge of #107038 - compiler-errors:dont-wfcheck-non-local-rpit, r=oli-obk
bors [Thu, 19 Jan 2023 16:49:06 +0000 (16:49 +0000)]
Auto merge of #107038 - compiler-errors:dont-wfcheck-non-local-rpit, r=oli-obk

Don't wf-check non-local RPITs

We were using `ty::is_impl_trait_defn(..).is_none()` to check if we need to add WF obligations for an opaque type.

This is *supposed* to be checking if the type is a TAIT, since RPITs' wfness is implied by wf checking its parent item, but since `is_impl_trait_defn` returns `None` for non-local RPIT and async futures, we unnecessarily consider wf predicates for an RPIT if it is coming from a foreign crate.

Fixes #107036

r? `@oli-obk` but feel free to reassign

17 months agoClean up and document unord collections a bit.
Michael Woerister [Thu, 19 Jan 2023 16:37:59 +0000 (17:37 +0100)]
Clean up and document unord collections a bit.

17 months agoadd raw identifier for keyword in suggestion
bohan [Mon, 16 Jan 2023 07:09:05 +0000 (15:09 +0800)]
add raw identifier for keyword in suggestion

17 months agotrait solver: Implement Fn traits and tuple trait
Michael Goulet [Thu, 19 Jan 2023 01:20:34 +0000 (01:20 +0000)]
trait solver: Implement Fn traits and tuple trait

17 months agotrait solver: PointerSized
Michael Goulet [Wed, 18 Jan 2023 23:21:12 +0000 (23:21 +0000)]
trait solver: PointerSized

17 months agoswap Ambiguity and Unimplemented in new trait engine
Michael Goulet [Thu, 19 Jan 2023 04:50:14 +0000 (04:50 +0000)]
swap Ambiguity and Unimplemented in new trait engine

17 months agoAssert goal is fully normalized during assemble
Michael Goulet [Thu, 19 Jan 2023 15:32:20 +0000 (15:32 +0000)]
Assert goal is fully normalized during assemble

17 months agoConditionally encode boolean
Michael Goulet [Thu, 19 Jan 2023 16:09:10 +0000 (16:09 +0000)]
Conditionally encode boolean

17 months agoSpecial case `derive(Debug)` for fieldless enums
clubby789 [Thu, 19 Jan 2023 15:52:29 +0000 (15:52 +0000)]
Special case `derive(Debug)` for fieldless enums

17 months agoAdd test
Michael Goulet [Wed, 18 Jan 2023 18:11:19 +0000 (18:11 +0000)]
Add test

17 months agoEncode whether foreign opaques are TAITs or not
Michael Goulet [Wed, 18 Jan 2023 18:03:06 +0000 (18:03 +0000)]
Encode whether foreign opaques are TAITs or not

17 months agoAdd enum for fieldless unification
clubby789 [Sat, 14 Jan 2023 21:16:25 +0000 (21:16 +0000)]
Add enum for fieldless unification

17 months agoHACK: self ty ambiguity hack
Michael Goulet [Thu, 19 Jan 2023 03:26:54 +0000 (03:26 +0000)]
HACK: self ty ambiguity hack

17 months agoFix IndexVec::drain_enumerated
Michael Goulet [Thu, 19 Jan 2023 15:24:00 +0000 (15:24 +0000)]
Fix IndexVec::drain_enumerated

17 months agoAdded UI test case for issue #106419
Patrik Kårlin [Thu, 19 Jan 2023 14:39:05 +0000 (15:39 +0100)]
Added UI test case for issue #106419

17 months agoUpdate cargo
Weihang Lo [Thu, 19 Jan 2023 14:18:36 +0000 (14:18 +0000)]
Update cargo

3 commits in a5d47a72595dd6fbe7d4e4f6ec20dc5fe724edd1..50eb688c2bbea5de5a2e8496230a7428798089d1
2023-01-16 18:51:50 +0000 to 2023-01-19 10:09:05 +0000

- Normalize git deps when doing `cargo vendor` for resolving deps inherited from a workspace (rust-lang/cargo#11414)
- Ignore `workspace.default-members` when running `cargo install` on root package of a non-virtual workspace (rust-lang/cargo#11067)
- Corrected documentation of how to cache binaries installed with `cargo install` in CI workflows (rust-lang/cargo#11592)

17 months agoAuto merge of #106910 - aliemjay:alias-ty-in-regionck, r=oli-obk
bors [Thu, 19 Jan 2023 14:05:07 +0000 (14:05 +0000)]
Auto merge of #106910 - aliemjay:alias-ty-in-regionck, r=oli-obk

even more unify Projection/Opaque handling in region outlives code

edit: This continues ate the same pace as #106829. New changes are described in https://github.com/rust-lang/rust/pull/106910#issuecomment-1383251254.

~This touches `OutlivesBound`, `Component`, `GenericKind` enums.~

r? `@oli-obk` (because of overlap with #95474)

17 months agoAutoderive ExternBlockSuggestion
mejrs [Thu, 19 Jan 2023 12:52:15 +0000 (13:52 +0100)]
Autoderive ExternBlockSuggestion

17 months agoadd test for ICE fix
Ali MJ Al-Nasrawy [Sun, 15 Jan 2023 22:35:51 +0000 (01:35 +0300)]
add test for ICE fix

17 months agoeven more unify Projection/Opaque in outlives code
Ali MJ Al-Nasrawy [Sun, 15 Jan 2023 16:38:31 +0000 (19:38 +0300)]
even more unify Projection/Opaque in outlives code

17 months agoDon't treat closures from other crates as local
Oli Scherer [Tue, 17 Jan 2023 09:39:35 +0000 (09:39 +0000)]
Don't treat closures from other crates as local

17 months agoAuto merge of #107064 - GuillaumeGomez:rollup-pbgu6r3, r=GuillaumeGomez
bors [Thu, 19 Jan 2023 11:12:31 +0000 (11:12 +0000)]
Auto merge of #107064 - GuillaumeGomez:rollup-pbgu6r3, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #105977 (Transform async `ResumeTy` in generator transform)
 - #106927 (make `CastError::NeedsDeref` create a `MachineApplicable` suggestion)
 - #106931 (document + UI test `E0208` and make its output more user-friendly)
 - #107027 (Remove extra removal from test path)
 - #107037 (Fix Dominators::rank_partial_cmp to match documentation)

Failed merges:

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

17 months agoCustom MIR: Support storage statements
Tomasz Miąsko [Thu, 19 Jan 2023 00:00:00 +0000 (00:00 +0000)]
Custom MIR: Support storage statements

17 months agoRollup merge of #107037 - tmiasko:rank, r=oli-obk
Guillaume Gomez [Thu, 19 Jan 2023 10:19:36 +0000 (11:19 +0100)]
Rollup merge of #107037 - tmiasko:rank, r=oli-obk

Fix Dominators::rank_partial_cmp to match documentation

The only use site is also updated accordingly and there is no change in end-to-end behaviour.

17 months agoRollup merge of #107027 - GuillaumeGomez:rm-extra-removal, r=tmiasko
Guillaume Gomez [Thu, 19 Jan 2023 10:19:36 +0000 (11:19 +0100)]
Rollup merge of #107027 - GuillaumeGomez:rm-extra-removal, r=tmiasko

Remove extra removal from test path

I don't know how to describe it shortly so better show what it's doing instead. Currently, there is one extra "rust/" before the test folder when running tests:

```
failures:

---- [rustdoc] rust/tests/rustdoc/redirect.rs stdout ----
```

This is a bit annoying when copying the test path. This is due to the moving of the `tests` folder one level up, meaning we were trimming too much of the `root_path`.

Now it is again displaying the correct path:

```
failures:

---- [rustdoc] tests/rustdoc/redirect.rs stdout ----
```

17 months agoRollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errors
Guillaume Gomez [Thu, 19 Jan 2023 10:19:35 +0000 (11:19 +0100)]
Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errors

document + UI test `E0208` and make its output more user-friendly

Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it.

r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off.

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

17 months agoRollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank
Guillaume Gomez [Thu, 19 Jan 2023 10:19:34 +0000 (11:19 +0100)]
Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank

make `CastError::NeedsDeref` create a `MachineApplicable` suggestion

Fixes #106903

Simple impl for the linked issue. I also made some other small changes:
- `CastError::ErrorGuaranteed` now owns an actual `ErrorGuaranteed`. This better enforces the static guarantees of `ErrorGuaranteed`.
- `CastError::NeedDeref` code simplified a bit, we now just suggest the `*`, instead of the whole expression as well.

17 months agoRollup merge of #105977 - Swatinem:async-mir-context, r=oli-obk
Guillaume Gomez [Thu, 19 Jan 2023 10:19:34 +0000 (11:19 +0100)]
Rollup merge of #105977 - Swatinem:async-mir-context, r=oli-obk

Transform async `ResumeTy` in generator transform

- Eliminates all the `get_context` calls that async lowering created.
- Replace all `Local` `ResumeTy` types with `&mut Context<'_>`.

The `Local`s that have their types replaced are:
- The `resume` argument itself.
- The argument to `get_context`.
- The yielded value of a `yield`.

The `ResumeTy` hides a `&mut Context<'_>` behind an unsafe raw pointer, and the `get_context` function is being used to convert that back to a `&mut Context<'_>`.

Ideally the async lowering would not use the `ResumeTy`/`get_context` indirection, but rather directly use `&mut Context<'_>`, however that would currently lead to higher-kinded lifetime errors.
See <https://github.com/rust-lang/rust/issues/105501>.

The async lowering step and the type / lifetime inference / checking are still using the `ResumeTy` indirection for the time being, and that indirection is removed here. After this transform, the generator body only knows about `&mut Context<'_>`.

---

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1330 CC `@bjorn3`

r? `@compiler-errors`

17 months agoMove `unchecked_duration_subtraction` to pedantic
Alex Macleod [Fri, 13 Jan 2023 00:04:28 +0000 (00:04 +0000)]
Move `unchecked_duration_subtraction` to pedantic

17 months agoAllow for more efficient sorting when exporting Unord collections.
Michael Woerister [Wed, 18 Jan 2023 09:47:31 +0000 (10:47 +0100)]
Allow for more efficient sorting when exporting Unord collections.

17 months agoUse UnordMap instead of FxHashMap in define_id_collections!().
Michael Woerister [Tue, 17 Jan 2023 11:05:01 +0000 (12:05 +0100)]
Use UnordMap instead of FxHashMap in define_id_collections!().

17 months agoUse UnordSet instead of FxHashSet in define_id_collections!().
Michael Woerister [Fri, 2 Dec 2022 15:27:25 +0000 (16:27 +0100)]
Use UnordSet instead of FxHashSet in define_id_collections!().

17 months agoAuto merge of #106989 - clubby789:is-zero-num, r=scottmcm
bors [Thu, 19 Jan 2023 08:04:26 +0000 (08:04 +0000)]
Auto merge of #106989 - clubby789:is-zero-num, r=scottmcm

Implement `alloc::vec::IsZero` for `Option<$NUM>` types

Fixes #106911

Mirrors the `NonZero$NUM` implementations with an additional `assert_zero_valid`.
`None::<i32>` doesn't stricly satisfy `IsZero` but for the purpose of allocating we can produce more efficient codegen.