]> git.lizzy.rs Git - rust.git/log
rust.git
16 months agoPrefer queries over Compiler methods
Oli Scherer [Wed, 7 Dec 2022 11:55:29 +0000 (11:55 +0000)]
Prefer queries over Compiler methods

16 months agoMake `output_filenames` a real query
Oli Scherer [Mon, 23 Jan 2023 10:25:51 +0000 (10:25 +0000)]
Make `output_filenames` a real query

16 months agoRemove another unneeded use of the resolver
Oli Scherer [Wed, 7 Dec 2022 09:33:25 +0000 (09:33 +0000)]
Remove another unneeded use of the resolver

16 months agoAuto merge of #107215 - Dylan-DPC:rollup-zqtiufk, r=Dylan-DPC
bors [Mon, 23 Jan 2023 07:32:07 +0000 (07:32 +0000)]
Auto merge of #107215 - Dylan-DPC:rollup-zqtiufk, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #104926 (Move relationships from FulfillmentContext to Inherited)
 - #106854 (Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.)
 - #107108 (Consider doc(alias) when providing typo suggestions)
 - #107186 (rustdoc: Use correct pseudo-element selector)
 - #107192 (Add myself to the mailmap)
 - #107195 (Fix typo in universal_regions.rs comment)
 - #107203 (Suggest remove deref for type mismatch)

Failed merges:

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

16 months agoRollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors
Dylan DPC [Mon, 23 Jan 2023 06:22:07 +0000 (11:52 +0530)]
Rollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors

Suggest remove deref for type mismatch

Fixes #106496

16 months agoRollup merge of #107195 - smoelius:patch-2, r=Nilstrieb
Dylan DPC [Mon, 23 Jan 2023 06:22:06 +0000 (11:52 +0530)]
Rollup merge of #107195 - smoelius:patch-2, r=Nilstrieb

Fix typo in universal_regions.rs comment

16 months agoRollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68
Dylan DPC [Mon, 23 Jan 2023 06:22:06 +0000 (11:52 +0530)]
Rollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68

Add myself to the mailmap

16 months agoRollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle
Dylan DPC [Mon, 23 Jan 2023 06:22:05 +0000 (11:52 +0530)]
Rollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle

rustdoc: Use correct pseudo-element selector

As explained [here](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#syntax).

I wrote it on top of #107152 so we'll need to wait for this one to be merged first.

r? `@notriddle`

16 months agoRollup merge of #107108 - sulami:issue-83968-doc-alias-typo-suggestions, r=compiler...
Dylan DPC [Mon, 23 Jan 2023 06:22:05 +0000 (11:52 +0530)]
Rollup merge of #107108 - sulami:issue-83968-doc-alias-typo-suggestions, r=compiler-errors

Consider doc(alias) when providing typo suggestions

This means that

```rust
impl Foo {
    #[doc(alias = "quux")]
    fn bar(&self) {}
}

fn main() {
    (Foo {}).quux();
}
```

will suggest `bar`. This currently uses the "there is a method with a similar name" help text, because the point where we choose and emit a suggestion is different from where we gather the suggestions. Changes have mainly been made to the latter.

The selection code will now fall back to aliased candidates, but generally only if there is no candidate that matches based on the existing Levenshtein methodology.

Fixes #83968.

16 months agoRollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
Dylan DPC [Mon, 23 Jan 2023 06:22:04 +0000 (11:52 +0530)]
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum

Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.

ACP: rust-lang/libs-team#162

Reviving #79665.

I want to get this merged this time; this does not contain changes (apart from very minor changes in comments/docs).

See #79665 for further description of the PR. The only “unresolved” points that led to that PR being closed, AFAICT, were

* The desire to also implement a `Rc::into_inner` function
  * however, this can very well also happen as a subsequent PR
* Possible need for further discussion on the naming “`into_inner`” (?)
  * `into_inner` seems fine to me; also, this PR introduces unstable API, and names can be changed later, too
* ~~I don't know if a tracking issue for the feature flag is supposed to be opened before or after this PR gets merged (if *before*, then I can add the issue number to the `#[unstable…]` attribute)~~ There is a [tracking issue](https://github.com/rust-lang/rust/issues/106894) now.

I say “unresolved” in quotation marks because from my point of view, if reviewers agree, the PR can be merged immediately and as-is :-)

16 months agoRollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, r=lcnr
Dylan DPC [Mon, 23 Jan 2023 06:22:04 +0000 (11:52 +0530)]
Rollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, r=lcnr

Move relationships from FulfillmentContext to Inherited

r? `@lcnr`

16 months agoAuto merge of #107044 - cuviper:more-llvm-ci, r=Mark-Simulacrum
bors [Mon, 23 Jan 2023 04:36:34 +0000 (04:36 +0000)]
Auto merge of #107044 - cuviper:more-llvm-ci, r=Mark-Simulacrum

ci: add runners for vanilla LLVM 14 and 15

As discussed in [zulip #t-infra][1] -- r? Mark-Simulacrum

[1]: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/testing.20multiple.20llvm.20versions

16 months agoConsider doc(alias) when providing typo suggestions
Robin Schroer [Wed, 18 Jan 2023 10:58:50 +0000 (19:58 +0900)]
Consider doc(alias) when providing typo suggestions

This means that

```rust
impl Foo {
    #[doc(alias = "quux")]
    fn bar(&self) {}
}

fn main() {
    (Foo {}).quux();
}
```

will suggest `bar`. This currently uses the "there is a method with a
similar name" help text, because the point where we choose and emit a
suggestion is different from where we gather the suggestions. Changes
have mainly been made to the latter.

The selection code will now fall back to aliased candidates, but
generally only if there is no candidate that matches based on the
existing Levenshtein methodology.

Fixes #83968.

16 months agoAuto merge of #106981 - joboet:std_remove_box_syntax, r=thomcc
bors [Mon, 23 Jan 2023 01:05:56 +0000 (01:05 +0000)]
Auto merge of #106981 - joboet:std_remove_box_syntax, r=thomcc

Do not use box syntax in `std`

See #94970 and #49733. About half of the `box` instances in `std` do not even need to allocate, the other half can simply be replaced with `Box::new`.

`@rustbot` label +T-libs
r? rust-lang/libs

16 months agoAuto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot
bors [Sun, 22 Jan 2023 21:35:21 +0000 (21:35 +0000)]
Auto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot

Refactor basic blocks control flow caches

No functional changes.

16 months agoAuto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
bors [Sun, 22 Jan 2023 18:39:13 +0000 (18:39 +0000)]
Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper

Update LLVM to 15.0.7

This commit pulls in rust-lang/llvm-project#143 which updates the LLVM version used by rustc to 15.0.7, namely pulling in https://reviews.llvm.org/D136110 which is needed for some work I'm working on with wasm.

16 months agoFix #106496, suggest remove deref for type mismatch
yukang [Sun, 22 Jan 2023 16:42:20 +0000 (00:42 +0800)]
Fix #106496, suggest remove deref for type mismatch

16 months agofn-trait-closure test now pass on new solver
Santiago Pastorino [Sun, 22 Jan 2023 15:36:58 +0000 (12:36 -0300)]
fn-trait-closure test now pass on new solver

16 months agoRename relationships to infer_var_info
Santiago Pastorino [Fri, 20 Jan 2023 19:45:01 +0000 (16:45 -0300)]
Rename relationships to infer_var_info

16 months agoMove relationships::update to Inherited::update_infer_var_info
Santiago Pastorino [Fri, 20 Jan 2023 19:42:22 +0000 (16:42 -0300)]
Move relationships::update to Inherited::update_infer_var_info

16 months agoStore relationships on Inherent
Santiago Pastorino [Fri, 25 Nov 2022 21:18:03 +0000 (18:18 -0300)]
Store relationships on Inherent

16 months agoRemove duplicated debug call
Santiago Pastorino [Thu, 24 Nov 2022 17:26:57 +0000 (14:26 -0300)]
Remove duplicated debug call

16 months agoAuto merge of #107187 - matthiaskrgr:rollup-lvwzlg2, r=matthiaskrgr
bors [Sun, 22 Jan 2023 13:22:34 +0000 (13:22 +0000)]
Auto merge of #107187 - matthiaskrgr:rollup-lvwzlg2, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107102 (Implement some more predicates in the new solver)
 - #107111 (Fix missing arguments issues and copy-paste bug for fluent)
 - #107114 (Add note about absolute paths to Path::join)
 - #107127 (Enable sanitizers for s390x-linux)
 - #107152 (Migrate scraped-examples top and bottom "borders" to CSS variables)
 - #107170 (Add myself to .mailmap)
 - #107174 (rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`)
 - #107180 (Remove unnecessary `&format!`)

Failed merges:

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

16 months agoUpdate universal_regions.rs
Samuel Moelius [Sun, 22 Jan 2023 12:38:02 +0000 (07:38 -0500)]
Update universal_regions.rs

16 months agoadd fmease to mailmap
León Orell Valerian Liehr [Sun, 22 Jan 2023 11:36:04 +0000 (12:36 +0100)]
add fmease to mailmap

16 months agoRollup merge of #107180 - nvzqz:rm-fmt-ref, r=joshtriplett
Matthias Krüger [Sun, 22 Jan 2023 10:43:09 +0000 (11:43 +0100)]
Rollup merge of #107180 - nvzqz:rm-fmt-ref, r=joshtriplett

Remove unnecessary `&format!`

These were likely from before the `PartialEq<str>` impl for `&String`.

16 months agoRollup merge of #107174 - petrochenkov:defidoc, r=notriddle
Matthias Krüger [Sun, 22 Jan 2023 10:43:08 +0000 (11:43 +0100)]
Rollup merge of #107174 - petrochenkov:defidoc, r=notriddle

rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`

Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
cc https://github.com/rust-lang/rust/pull/106977

16 months agoRollup merge of #107170 - albertlarsan68:update-mailmap, r=compiler-errors
Matthias Krüger [Sun, 22 Jan 2023 10:43:08 +0000 (11:43 +0100)]
Rollup merge of #107170 - albertlarsan68:update-mailmap, r=compiler-errors

Add myself to .mailmap

16 months agoRollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle
Matthias Krüger [Sun, 22 Jan 2023 10:43:07 +0000 (11:43 +0100)]
Rollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle

Migrate scraped-examples top and bottom "borders" to CSS variables

r? `@notriddle`

16 months agoRollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum
Matthias Krüger [Sun, 22 Jan 2023 10:43:07 +0000 (11:43 +0100)]
Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum

Enable sanitizers for s390x-linux

Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan) in the target definition, as well as in the compiletest supported list.

Build sanitizer runtime for the target.  Enable sanitizers in the CI.

16 months agoRollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
Matthias Krüger [Sun, 22 Jan 2023 10:43:06 +0000 (11:43 +0100)]
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se

Add note about absolute paths to Path::join

The note already exists on `PathBuf::push`, but I think it is good to have it on `Path::join` as well since it can cause issues if you are not careful with your input.

16 months agoRollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, r=petrochenkov
Matthias Krüger [Sun, 22 Jan 2023 10:43:06 +0000 (11:43 +0100)]
Rollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, r=petrochenkov

Fix missing arguments issues and copy-paste bug for fluent

Fixes #107090

16 months agoRollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr
Matthias Krüger [Sun, 22 Jan 2023 10:43:05 +0000 (11:43 +0100)]
Rollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr

Implement some more predicates in the new solver

Implement a few more goals. The subtype goal specifically is important, since it's required for this code to compile:

```
fn main() {
  let mut x = vec![];
  x.push(1i32);
}
```

(I think we emit a subtype goal here because of coercion).

Drive-by: Also implements `--compare-mode=next-solver` -- I've been using this locally a lot to find out what works and what doesn't. I'm also happy to split this out into another PR.
r? `@lcnr`

16 months agoAuto merge of #107137 - Mark-Simulacrum:169, r=Mark-Simulacrum
bors [Sun, 22 Jan 2023 10:30:59 +0000 (10:30 +0000)]
Auto merge of #107137 - Mark-Simulacrum:169, r=Mark-Simulacrum

Bump to 1.69.0

r? `@Mark-Simulacrum`

16 months agoUse correct pseudo-element selector
Guillaume Gomez [Sun, 22 Jan 2023 10:11:29 +0000 (11:11 +0100)]
Use correct pseudo-element selector

16 months agoAuto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors
bors [Sun, 22 Jan 2023 06:53:36 +0000 (06:53 +0000)]
Auto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #103418 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report)
 - #106113 (llvm-wrapper: adapt for LLVM API change)
 - #106144 (Improve the documentation of `black_box`)
 - #106578 (Label closure captures/generator locals that make opaque types recursive)
 - #106749 (Update cc to 1.0.77)
 - #106935 (Fix `SingleUseLifetime` ICE)
 - #107015 (Re-enable building rust-analyzer on riscv64)
 - #107029 (Add new bootstrap members to triagebot.toml)

Failed merges:

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

16 months agoRollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:02 +0000 (23:21 -0500)]
Rollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum

Add new bootstrap members to triagebot.toml

```@ozkanonur``` if you want to be assigned to review PRs too, just post a message to this thread.

Should a `T-bootstrap` label be created, since `src/tools/tidy` is assigned to the `bootstrap` members, but labeled `A-testsuite` (and not `A-bootstrap`) ?

cc ```@jyn514```

16 months agoRollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:01 +0000 (23:21 -0500)]
Rollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum

Re-enable building rust-analyzer on riscv64

It was disabled in #75103 due to an LLVM bug, but followup comments have
confirmed that it builds fine on Fedora with LLVM 15.

r? ```@Mark-Simulacrum```
cc ```@matklad``` ```@davidlt```

16 months agoRollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot
Michael Goulet [Sun, 22 Jan 2023 04:21:00 +0000 (23:21 -0500)]
Rollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot

Fix `SingleUseLifetime` ICE

Fixes #104440
cc: ``@matthiaskrgr``

16 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.

16 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

16 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

16 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.

16 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.

16 months agoAuto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, r=Mark-Simulacrum
bors [Sun, 22 Jan 2023 03:58:52 +0000 (03:58 +0000)]
Auto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, r=Mark-Simulacrum

Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"

This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36 aka PR #84022

I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.

16 months agoRemove unnecessary `&format!`
Nikolai Vazquez [Sun, 22 Jan 2023 03:00:25 +0000 (22:00 -0500)]
Remove unnecessary `&format!`

These were likely from before the `PartialEq<str>` impl for `&String`.

16 months agorustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`
Vadim Petrochenkov [Sat, 21 Jan 2023 21:33:53 +0000 (01:33 +0400)]
rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`

Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.

16 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

16 months agoAdd myself to .mailmap
Albert Larsan [Sat, 21 Jan 2023 20:52:20 +0000 (20:52 +0000)]
Add myself to .mailmap

16 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

16 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

16 months agoAddress goal nits
Michael Goulet [Fri, 20 Jan 2023 18:38:33 +0000 (18:38 +0000)]
Address goal nits

16 months agoAdd Arc::into_inner for safely discarding Arcs without calling the destructor on...
Frank Steffahn [Tue, 25 Aug 2020 15:30:46 +0000 (17:30 +0200)]
Add Arc::into_inner for safely discarding Arcs without calling the destructor on the inner type.

Mainly rebased and squashed from PR rust-lang/rust#79665,
furthermore includes minor changes in comments.

16 months agoImplement some more predicates
Michael Goulet [Fri, 20 Jan 2023 03:05:06 +0000 (03:05 +0000)]
Implement some more predicates

16 months agoAdd compare-mode-next-solver
Michael Goulet [Fri, 20 Jan 2023 02:05:57 +0000 (02:05 +0000)]
Add compare-mode-next-solver

16 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`

16 months agoExtend rustdoc GUI test for scraped examples top and bottom "borders"
Guillaume Gomez [Sat, 21 Jan 2023 11:16:02 +0000 (12:16 +0100)]
Extend rustdoc GUI test for scraped examples top and bottom "borders"

16 months agoMigrate scraped-examples top and bottom "borders" to CSS variables
Guillaume Gomez [Sat, 21 Jan 2023 11:15:42 +0000 (12:15 +0100)]
Migrate scraped-examples top and bottom "borders" to CSS variables

16 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.

16 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

16 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

16 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

16 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

16 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```

16 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

16 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.

16 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```

16 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.

16 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.

16 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

16 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.

16 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.

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

16 months agoBump to 1.69.0
Mark Rousskov [Fri, 20 Jan 2023 23:06:54 +0000 (18:06 -0500)]
Bump to 1.69.0

16 months agoRevert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"
Felix S. Klock II [Fri, 20 Jan 2023 22:13:55 +0000 (17:13 -0500)]
Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"

This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36.

I am doing this to buy us some time with respect to issue #106337 w.r.t. the
1.67 release.

16 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`

16 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

16 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

16 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

16 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`

16 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.

16 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`

16 months agoEnable sanitizers for s390x-linux
Ulrich Weigand [Fri, 20 Jan 2023 17:34:24 +0000 (18:34 +0100)]
Enable sanitizers for s390x-linux

Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan)
in the target definition, as well as in the compiletest supported list.

Build sanitizer runtime for the target.  Enable sanitizers in the CI.

16 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

16 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

16 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)

16 months agoPull in more LLVM commits
Alex Crichton [Fri, 20 Jan 2023 15:48:59 +0000 (07:48 -0800)]
Pull in more LLVM commits

16 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

16 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

16 months agoadd example of joining with a absolute path
Valdemar Erk [Fri, 20 Jan 2023 11:03:43 +0000 (12:03 +0100)]
add example of joining with a absolute path

16 months agoAdd note about absolute paths to Path::join
Valdemar Erk [Fri, 20 Jan 2023 10:16:38 +0000 (11:16 +0100)]
Add note about absolute paths to Path::join

16 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

16 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`

16 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

16 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

16 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``

16 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

16 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.

16 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``

16 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.