]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoAuto merge of #13891 - bvanjoi:reverse-whitespace-in-assists, r=Veykril
bors [Mon, 9 Jan 2023 14:11:40 +0000 (14:11 +0000)]
Auto merge of #13891 - bvanjoi:reverse-whitespace-in-assists, r=Veykril

fix: keep whitespace in extract function handler

Fixed #13874

17 months agoSimplify code with @Veykril's suggestion.
Tom Kunc [Mon, 9 Jan 2023 14:01:41 +0000 (07:01 -0700)]
Simplify code with @Veykril's suggestion.

17 months agoAdd `convert_ufcs_to_method` assist
Maybe Waffle [Tue, 6 Dec 2022 17:34:47 +0000 (17:34 +0000)]
Add `convert_ufcs_to_method` assist

17 months agoAuto merge of #13816 - WaffleLapkin:postfix_adjustment_hints, r=Veykril
bors [Mon, 9 Jan 2023 13:47:46 +0000 (13:47 +0000)]
Auto merge of #13816 - WaffleLapkin:postfix_adjustment_hints, r=Veykril

Postfix adjustment hints

# Basic Description

This PR implements "postfix" adjustment hints:
![2022-12-21_19-27](https://user-images.githubusercontent.com/38225716/208941721-d48d316f-a918-408a-9757-8d4e2b402a66.png)

They are identical to normal adjustment hints, but are rendered _after_ the expression. E.g. `expr.*` instead of `*expr`. ~~This mirrors "postfix deref" feature that I'm planning to eventually propose to the compiler.~~

# Motivation

The advantage of being postfix is that you need to add parentheses less often:

![2022-12-21_19-38](https://user-images.githubusercontent.com/38225716/208944302-16718112-14a4-4438-8aed-797766391c63.png)
![2022-12-21_19-37](https://user-images.githubusercontent.com/38225716/208944281-d9614888-6597-41ee-bf5d-a081d8048f94.png)

This is because a lot of "reborrow" hints are caused by field access or method calls, both of which are postfix and have higher "precedence" than prefix `&` and `*`.

Also IMHO it just looks nicer and it's more clear what is happening (order of operations).

# Modes

However, there are some cases where postfix hints need parentheses but prefix don't (for example `&x` being turned into `(&x).*.*.&` or `&**&x`).

This PR allows users to choose which look they like more. There are 4 options (`rust-analyzer.inlayHints.expressionAdjustmentHints.mode` setting):
- `prefix` — always use prefix hints (default, what was used before that PR)
- `postfix` — always use postfix hints
- `prefer_prefix` — try to minimize number of parentheses, breaking ties in favor of prefix
- `prefer_postfix` — try to minimize number of parentheses, breaking ties in favor of postfix

Comparison of all modes:

![2022-12-21_19-53](https://user-images.githubusercontent.com/38225716/208947482-26357c82-2b42-47d9-acec-835f5f03f6b4.png)
![2022-12-21_19-49](https://user-images.githubusercontent.com/38225716/208946731-fe566d3b-52b2-4846-994d-c2cecc769e0f.png)
![2022-12-21_19-48](https://user-images.githubusercontent.com/38225716/208946742-6e237f44-805e-469a-a3db-03d8f76e1317.png)
![2022-12-21_19-47](https://user-images.githubusercontent.com/38225716/208946747-79f25fae-e3ea-47d2-8d27-cb4eeac034fe.png)

# Edge cases

Where are some rare cases where chain hints weirdly interact with adjustment hints, for example (note `SourceAnalyzer.&`):

![image](https://user-images.githubusercontent.com/38225716/208947958-41c12971-f1f0-4a41-a930-47939cce9f58.png)

This is pre-existing, you can get the same effect with prefix hints (`SourceAnalyzer)`).

----

Another weird thing is this:

![2022-12-21_20-00](https://user-images.githubusercontent.com/38225716/208948590-ea26d325-2108-4b35-abaa-716a65a1ae99.png)

Here `.&` is a hint and `?` is written in the source code. It looks like `?` is part of the hint because `?.` is ligature in my font. IMO this is a bug in vscode, but still worth mentioning (I'm also too lazy to report it there...).

# Fixed bugs

I've used the "needs parens" API and this accidentally fixed a bug with parens around `as`, see the test diff:
```diff,rust
     let _: *const u32  = &mut 0u32 as *mut u32;
                        //^^^^^^^^^^^^^^^^^^^^^<mut-ptr-to-const-ptr>
+                       //^^^^^^^^^^^^^^^^^^^^^(
+                       //^^^^^^^^^^^^^^^^^^^^^)
...
     let _: *const u32  = &mut 0u32 as *mut u32;
                        //^^^^^^^^^^^^^^^^^^^^^<mut-ptr-to-const-ptr>
+                       //^^^^^^^^^^^^^^^^^^^^^(
+                       //^^^^^^^^^^^^^^^^^^^^^)
```

# Changelog

changelog feature Add an option to make adjustment hints (aka reborrow hints) postfix
changelog fix Fix placement of parentheses around `as` casts for adjustment hints

17 months agoAdd a fixme to remove hacks
Maybe Waffle [Mon, 9 Jan 2023 13:37:37 +0000 (13:37 +0000)]
Add a fixme to remove hacks

17 months agoAdd a "bug" test for adjustment hints to check for status quo
Maybe Waffle [Wed, 21 Dec 2022 15:31:57 +0000 (15:31 +0000)]
Add a "bug" test for adjustment hints to check for status quo

17 months agoAdd an option to minimize parentheses for adjustment hints
Maybe Waffle [Wed, 21 Dec 2022 15:00:05 +0000 (15:00 +0000)]
Add an option to minimize parentheses for adjustment hints

17 months agoAuto merge of #13843 - Overpeek:master, r=Veykril
bors [Mon, 9 Jan 2023 13:34:51 +0000 (13:34 +0000)]
Auto merge of #13843 - Overpeek:master, r=Veykril

fix: generate async delegate methods

Fixes a bug where the generated async method doesn't await the result before returning it.

This is an example of what the output looked like:
```rust
struct Age<T>(T);
impl<T> Age<T> {
    pub(crate) async fn age<J, 'a>(&'a mut self, ty: T, arg: J) -> T {
        self.0
    }
}
struct Person<T> {
    age: Age<T>,
}
impl<T> Person<T> {
    pub(crate) async fn age<J, 'a>(&'a mut self, ty: T, arg: J) -> T {
        self.age.age(ty, arg) // .await is missing
    }
}
```
The `.await` is missing, so the return type is `impl Future<Output = T>` instead of `T`

17 months agoImplement postfix adjustment hints
Maybe Waffle [Tue, 20 Dec 2022 22:07:00 +0000 (22:07 +0000)]
Implement postfix adjustment hints

I'd say "First stab at implementing..." but I've been working on this
for a month already lol

17 months agoRename checkOnSave settings to check
Lukas Wirth [Mon, 9 Jan 2023 13:15:13 +0000 (14:15 +0100)]
Rename checkOnSave settings to check

17 months agoRename checkOnSave settings to flycheck
Lukas Wirth [Tue, 20 Dec 2022 10:31:07 +0000 (11:31 +0100)]
Rename checkOnSave settings to flycheck

17 months agoAuto merge of #2753 - RalfJung:rustup, r=RalfJung
bors [Mon, 9 Jan 2023 13:13:35 +0000 (13:13 +0000)]
Auto merge of #2753 - RalfJung:rustup, r=RalfJung

Rustup

Pulls in https://github.com/rust-lang/rust/pull/104658

17 months agoAuto merge of #13763 - rami3l:fix/gen-partial-eq-generic, r=Veykril
bors [Mon, 9 Jan 2023 13:02:09 +0000 (13:02 +0000)]
Auto merge of #13763 - rami3l:fix/gen-partial-eq-generic, r=Veykril

fix: add generic `TypeBoundList` in generated derivable impl

Potentially fixes #13727.

Continuing with the work in #13732, this fix tries to add correct type bounds in the generated `impl` block:

```diff
  enum Either<T, U> {
      Left(T),
      Right(U),
  }

- impl<T, U> PartialEq for Either<T, U> {
+ impl<T: PartialEq, U: PartialEq> PartialEq for Either<T, U> {
      fn eq(&self, other: &Self) -> bool {
          match (self, other) {
              (Self::Left(l0), Self::Left(r0)) => l0 == r0,
              (Self::Right(l0), Self::Right(r0)) => l0 == r0,
              _ => false,
          }
      }
  }
```

17 months agoMerge from rustc
Ralf Jung [Mon, 9 Jan 2023 12:49:07 +0000 (13:49 +0100)]
Merge from rustc

17 months agoPreparing for merge from rustc
Ralf Jung [Mon, 9 Jan 2023 12:48:31 +0000 (13:48 +0100)]
Preparing for merge from rustc

17 months agoAuto merge of #2752 - RalfJung:win-env-current-exe, r=RalfJung
bors [Mon, 9 Jan 2023 12:47:38 +0000 (12:47 +0000)]
Auto merge of #2752 - RalfJung:win-env-current-exe, r=RalfJung

make env::current_exe work on Windows

17 months agomake env::current_exe work on Windows
Ralf Jung [Mon, 9 Jan 2023 12:43:06 +0000 (13:43 +0100)]
make env::current_exe work on Windows

17 months agoRelocate changes
Fabian Hintringer [Mon, 9 Jan 2023 12:19:41 +0000 (13:19 +0100)]
Relocate changes

17 months agoAuto merge of #106340 - saethlin:propagate-operands, r=oli-obk
bors [Mon, 9 Jan 2023 11:59:51 +0000 (11:59 +0000)]
Auto merge of #106340 - saethlin:propagate-operands, r=oli-obk

Always permit ConstProp to exploit arithmetic identities

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

Initially, I thought I would need to enable operand propagation then do something else, but actually https://github.com/rust-lang/rust/pull/74491 already has the fix for the issue in question! It looks like this optimization was put under MIR opt level 3 due to possible soundness/stability implications, then demoted further to MIR opt level 4 when MIR opt level 2 became associated with `--release`.

Perhaps in the past we were doing CTFE on optimized MIR? We aren't anymore, so this optimization has no stability implications.

r? `@oli-obk`

17 months agoAuto merge of #13744 - vtta:numthreads, r=Veykril
bors [Mon, 9 Jan 2023 11:53:23 +0000 (11:53 +0000)]
Auto merge of #13744 - vtta:numthreads, r=Veykril

feat: add the ability to limit the number of threads launched by `main_loop`

## Motivation
`main_loop` defaults to launch as many threads as cpus in one machine. When developing on multi-core remote servers on multiple projects, this will lead to thousands of idle threads being created. This is very annoying when one wants check whether his program under developing is running correctly via `htop`.

<img width="756" alt="image" src="https://user-images.githubusercontent.com/41831480/206656419-fa3f0dd2-e554-4f36-be1b-29d54739930c.png">

## Contribution
This patch introduce the configuration option `rust-analyzer.numThreads` to set the desired thread number used by the main thread pool.
This should have no effects on the performance as not all threads are actually used.
<img width="1325" alt="image" src="https://user-images.githubusercontent.com/41831480/206656834-fe625c4c-b993-4771-8a82-7427c297fd41.png">

## Demonstration
The following is a snippet of `lunarvim` configuration using my own build.
```lua
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer" })
require("lvim.lsp.manager").setup("rust_analyzer", {
  cmd = { "env", "RA_LOG=debug", "RA_LOG_FILE=/tmp/ra-test.log",
    "/home/jlhu/Projects/rust-analyzer/target/debug/rust-analyzer",
  },
  init_options = {
    numThreads = 4,
  },
  settings = {
    cachePriming = {
      numThreads = 8,
    },
  },
})

```

## Limitations
The `numThreads` can only be modified via `initializationOptions` in early initialisation because everything has to wait until the thread pool starts including the dynamic settings modification support.
The `numThreads` also does not reflect the end results of how many threads is actually created, because I have not yet tracked down everything that spawns threads.

17 months agoAuto merge of #13684 - unvalley:extract-expressions-from-format-string, r=Veykril
bors [Mon, 9 Jan 2023 11:40:48 +0000 (11:40 +0000)]
Auto merge of #13684 - unvalley:extract-expressions-from-format-string, r=Veykril

feat: extract_expressions_from_format_string

closes #13640
- rename to `extract_expressions_from_format_string`
- leave identifier from format string
- but this is from rustc version 1.65.0
- Should I add flag or something?

Note: the assist behaves below cases for now. I'll create an issue for these.
```rs
let var = 1 + 1;
// ok
format!("{var} {1+1}");   // → format!("{var} {}", 1+1);
format!("{var:?} {1+1}"); // → format!("{var:?} {}", 1 + 1);
format!("{var} {var} {1+1}"); // → format!("{var} {var} {}", 1 + 1);

// breaks (need to handle minimum width by postfix`$`)
format!("{var:width$} {1+1}"); // → format!("{var:width\$} {}", 1+1);
format!("{var:.prec$} {1+1}"); // → format!("{var:.prec\$} {}", 1+1);
format!("Hello {:1$}! {1+1}", "x" 5); // → format("Hello {:1\$}! {}", "x", 1+1);
format!("Hello {:width$}! {1+1}", "x", width = 5); // → println!("Hello {:width\$}! {}", "x", 1+1);
```

https://user-images.githubusercontent.com/38400669/204344911-f1f8fbd2-706d-414e-b1ab-d309376efb9b.mov

17 months agoAuto merge of #13458 - cameron1024:suggest-checked-wrapping-saturating, r=Veykril
bors [Mon, 9 Jan 2023 11:24:44 +0000 (11:24 +0000)]
Auto merge of #13458 - cameron1024:suggest-checked-wrapping-saturating, r=Veykril

add wrapping/checked/saturating assist

This addresses #13452

I'm not sure about the structure of the code. I'm not sure if it needs to be 3 separate assists, and if that means it needs to be in 3 separate files as well.

Most of the logic is in `util.rs`, which feels funny to me, but there seems to be a pattern of 1 assist per file, and this seems better than duplicating the logic.

Let me know if anything needs changes :grin:

17 months agofix: add_format_like_completions to handle no exprs
unvalley [Mon, 28 Nov 2022 16:39:27 +0000 (01:39 +0900)]
fix: add_format_like_completions to handle no exprs

17 months agodocs: update assist comment
unvalley [Sun, 27 Nov 2022 09:24:43 +0000 (18:24 +0900)]
docs: update assist comment

17 months agochore: update assist label name
unvalley [Sun, 27 Nov 2022 08:23:46 +0000 (17:23 +0900)]
chore: update assist label name

17 months agofeat: extract only expressions from format string
unvalley [Sun, 27 Nov 2022 06:36:26 +0000 (15:36 +0900)]
feat: extract only expressions from format string

17 months agotest: fix arg_type test
unvalley [Sun, 27 Nov 2022 05:49:30 +0000 (14:49 +0900)]
test: fix arg_type test

17 months agofix: to leave Ident in parse_format_exprs
unvalley [Sun, 27 Nov 2022 05:44:32 +0000 (14:44 +0900)]
fix: to leave Ident in parse_format_exprs

17 months agofix: ide assist handlers order
unvalley [Sat, 26 Nov 2022 14:01:52 +0000 (23:01 +0900)]
fix: ide assist handlers order

17 months agofix: rename to extract_expressions_from_format_string
unvalley [Sat, 26 Nov 2022 14:00:03 +0000 (23:00 +0900)]
fix: rename to extract_expressions_from_format_string

17 months agoRefactor replace_arith assists into one module
Lukas Wirth [Mon, 9 Jan 2023 10:59:09 +0000 (11:59 +0100)]
Refactor replace_arith assists into one module

17 months agoAuto merge of #13905 - rust-lang:dependabot/npm_and_yarn/editors/code/d3-color-and...
bors [Mon, 9 Jan 2023 10:37:46 +0000 (10:37 +0000)]
Auto merge of #13905 - rust-lang:dependabot/npm_and_yarn/editors/code/d3-color-and-d3-graphviz-3.1.0, r=Veykril

Bump d3-color and d3-graphviz in /editors/code

Bumps [d3-color](https://github.com/d3/d3-color) to 3.1.0 and updates ancestor dependency [d3-graphviz](https://github.com/magjac/d3-graphviz). These dependencies need to be updated together.

Updates `d3-color` from 2.0.0 to 3.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/d3/d3-color/releases">d3-color's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<ul>
<li>Add <a href="https://github.com/d3/d3-color/blob/main/README.md#rgb_clamp"><em>rgb</em>.clamp</a> and <a href="https://github.com/d3/d3-color/blob/main/README.md#hsl_clamp"><em>hsl</em>.clamp</a>. <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/102">#102</a></li>
<li>Add <a href="https://github.com/d3/d3-color/blob/main/README.md#color_formatHex8"><em>color</em>.formatHex8</a>. <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/103">#103</a></li>
<li>Fix <a href="https://github.com/d3/d3-color/blob/main/README.md#color_formatHsl"><em>color</em>.formatHsl</a> to clamp values to the expected range. <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/83">#83</a></li>
<li>Fix catastrophic backtracking when parsing colors. <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/89">#89</a> <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/97">#97</a> <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/99">#99</a> <a href="https://github-redirect.dependabot.com/d3/d3-color/issues/100">#100</a> <a href="https://security.snyk.io/vuln/SNYK-JS-D3COLOR-1076592">SNYK-JS-D3COLOR-1076592</a></li>
</ul>
<h2>v3.0.1</h2>
<ul>
<li>Make build reproducible.</li>
</ul>
<h2>v3.0.0</h2>
<ul>
<li>Adopt type: module.</li>
</ul>
<p>This package now requires Node.js 12 or higher. For more, please read <a href="https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c">Sindre Sorhus’s FAQ</a>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/d3/d3-color/commit/7a1573ed260de4fd97d061975244841132adde92"><code>7a1573e</code></a> 3.1.0</li>
<li><a href="https://github.com/d3/d3-color/commit/75c19c40c246e4b3fbcfdeeba29249c51ccf6524"><code>75c19c4</code></a> update LICENSE</li>
<li><a href="https://github.com/d3/d3-color/commit/ef94e0125cce176e2df2f877c70741f4e2856073"><code>ef94e01</code></a> update dependencies</li>
<li><a href="https://github.com/d3/d3-color/commit/5e9f7579dd32a74664f5000ee99aa87e3e463c2b"><code>5e9f757</code></a> method shorthand</li>
<li><a href="https://github.com/d3/d3-color/commit/e4bc34e46cba08c4b7209f2bea74ef570c000b86"><code>e4bc34e</code></a> formatHex8 (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/103">#103</a>)</li>
<li><a href="https://github.com/d3/d3-color/commit/ac660c6b6bd60a2f1cd255fe04ead7d1b053861d"><code>ac660c6</code></a> {rgb,hsl}.clamp() (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/102">#102</a>)</li>
<li><a href="https://github.com/d3/d3-color/commit/70e3a041f1890e63855fad693891652b36f48195"><code>70e3a04</code></a> clamp HSL format (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/101">#101</a>)</li>
<li><a href="https://github.com/d3/d3-color/commit/994d8fd95181484a5a27c5edc919aa625781432d"><code>994d8fd</code></a> avoid backtracking (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/100">#100</a>)</li>
<li><a href="https://github.com/d3/d3-color/commit/7d61bbe6e426a7f3d3f4520a8b31cfc92dc69ee7"><code>7d61bbe</code></a> 3.0.1</li>
<li><a href="https://github.com/d3/d3-color/commit/93bc4ff5423ecbefb6607724384bf6ca788d13b6"><code>93bc4ff</code></a> related <a href="https://github-redirect.dependabot.com/d3/d3/issues/3">d3/d33</a>; extract copyrights from LICENSE</li>
<li>Additional commits viewable in <a href="https://github.com/d3/d3-color/compare/v2.0.0...v3.1.0">compare view</a></li>
</ul>
</details>
<br />

Updates `d3-graphviz` from 4.1.1 to 5.0.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/magjac/d3-graphviz/releases">d3-graphviz's releases</a>.</em></p>
<blockquote>
<h2>v5.0.2</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#502">CHANGELOG</a> for details.</p>
<h2>v5.0.1</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#501">CHANGELOG</a> for details.</p>
<h2>v5.0.0</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#500">CHANGELOG</a> for details.</p>
<h2>v4.5.0</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#450">CHANGELOG</a> for details.</p>
<h2>v4.4.0</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#440">CHANGELOG</a> for details.</p>
<h2>v4.3.0</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#430">CHANGELOG</a> for details.</p>
<h2>v4.2.0</h2>
<p>See the <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md#420">CHANGELOG</a> for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md">d3-graphviz's changelog</a>.</em></p>
<blockquote>
<h2>[5.0.2] – 2022-12-27</h2>
<h3>Fixed</h3>
<ul>
<li>Failed to resolve entry for package &quot;d3-graphviz&quot; <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/263">#263</a></li>
</ul>
<h2>[5.0.1] – 2022-12-27</h2>
<h3>Fixed</h3>
<ul>
<li>Failed to resolve entry for package &quot;d3-graphviz&quot; (partial fix) <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/263">#263</a></li>
</ul>
<h2>[5.0.0] – 2022-12-26</h2>
<p><strong>Note:</strong> This release contains breaking changes compared to version 4.5.0.</p>
<h3>Changed</h3>
<ul>
<li>Like <a href="https://github.com/d3/d3/blob/main/CHANGES.md#changes-in-d3-70">D3
v7</a>,
d3-graphviz now ships as a pure ES module and requires Node.js 14 or
higher. This is a <strong>breaking change</strong>. For more, please read <a href="https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c">Sindre
Sorhus’s
FAQ</a>. For
background and details, see <a href="https://github-redirect.dependabot.com/d3/d3/issues/3469">this D3
issue</a>.</li>
<li>Upgrade to <a href="https://github.com/d3/d3/blob/main/CHANGES.md#changes-in-d3-70">D3 version
7</a>
(version 3 of its
<a href="https://github.com/d3/d3#installing">microlibraries</a>).</li>
<li>Upgrade <code>`@​hpcc-js/wasm</code>` to 2.5.0 (Graphviz 7.0.5)</li>
</ul>
<h2>[4.5.0] – 2022-12-11</h2>
<h3>Changed</h3>
<ul>
<li>Upgrade <code>`@​hpcc-js/wasm</code>` to 1.16.6 (Graphviz 7.0.1)</li>
</ul>
<h2>[4.4.0] – 2022-09-12</h2>
<h3>Changed</h3>
<ul>
<li>Upgrade <code>`@​hpcc-js/wasm</code>` to 1.16.1 (Graphviz 6.0.1)</li>
</ul>
<h2>[4.3.0] – 2022-09-10</h2>
<h3>Changed</h3>
<ul>
<li>Upgrade <code>`@​hpcc-js/wasm</code>` to 1.15.7 (Graphviz unchanged at 5.0.1)  (thanks <a href="https://github.com/mrdrogdrog"><code>`@​mrdrogdrog</code></a>)</li>`
</ul>
<h2>[4.2.0] – 2022-09-06</h2>
<h3>Changed</h3>
<ul>
<li>Upgrade Graphviz to version 5.0.1 through <code>`@​hpcc-js/wasm</code>` version 1.15.4 (thanks <a href="https://github.com/mrdrogdrog"><code>`@​mrdrogdrog</code></a>)</li>`
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/magjac/d3-graphviz/commit/21a1f57612ec94fde0a37bdd4b23af0cfd257c96"><code>21a1f57</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/268">#268</a> from magjac/release-5.0.2</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/3c96187ad3f50c3b0e90a203fabc708485fdd159"><code>3c96187</code></a> add version 5.0.2 to CHANGELOG</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/82c34adb337cfc278cab0804bac86b8b0e904af6"><code>82c34ad</code></a> update version to 5.0.2</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/493e14927c7a76c1ec80e601b064a21053eb3495"><code>493e149</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/267">#267</a> from magjac/fix-main-module-exports-in-package-json-a...</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/1903eea4e55c3d40edf9f520a528d9a651dd04b4"><code>1903eea</code></a> add simple-default-export-test.js</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/ccd6b90f36f5be92568ccaa2ea2ab96073579e5b"><code>ccd6b90</code></a> correct default export in package.json</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/d32e81cbfb05df87fb0bf72f892fc184482f9775"><code>d32e81c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/266">#266</a> from magjac/release-5.0.1</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/d0651e56ec668faddacde490758a1c638fe7e495"><code>d0651e5</code></a> add version 5.0.1 to CHANGELOG</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/0c06f6246be1491fc60f75ba4ac82a40bcfeffa2"><code>0c06f62</code></a> update version to 5.0.1</li>
<li><a href="https://github.com/magjac/d3-graphviz/commit/2df0d3a66f421b6c3aaf7f02646b616c518781c9"><code>2df0d3a</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/magjac/d3-graphviz/issues/265">#265</a> from magjac/fix-main-module-exports-in-package-json</li>
<li>Additional commits viewable in <a href="https://github.com/magjac/d3-graphviz/compare/v4.1.1...v5.0.2">compare view</a></li>
</ul>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language
- ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language
- ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/rust-lang/rust-analyzer/network/alerts).

</details>

17 months agoAuto merge of #2750 - rust-lang:dependabot/cargo/test_dependencies/tokio-1.23.1,...
bors [Mon, 9 Jan 2023 10:29:57 +0000 (10:29 +0000)]
Auto merge of #2750 - rust-lang:dependabot/cargo/test_dependencies/tokio-1.23.1, r=oli-obk

Bump tokio from 1.23.0 to 1.23.1 in /test_dependencies

Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.23.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tokio-rs/tokio/releases">tokio's releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.23.1</h2>
<p>This release forward ports changes from 1.18.4.</p>
<h3>Fixed</h3>
<ul>
<li>net: fix Windows named pipe server builder to maintain option when toggling
pipe mode (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5336">#5336</a>).</li>
</ul>
<p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/5336">#5336</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/5336">tokio-rs/tokio#5336</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/tokio-rs/tokio/commit/1a997ffbd62334af2553775234e75ede2d7d949f"><code>1a997ff</code></a> chore: prepare Tokio v1.23.1 release</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/a8fe333cc45c14b0566d450dff8ff85fbe974fa0"><code>a8fe333</code></a> Merge branch 'tokio-1.20.x' into tokio-1.23.x</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/ba81945ffc2695b71f2bbcadbfb5e46ec55aaef3"><code>ba81945</code></a> chore: prepare Tokio 1.20.3 release</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/763bdc967e3e128d1e6e000238f1d257a81bf59a"><code>763bdc9</code></a> ci: run WASI tasks using latest Rust</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/9f98535877f8f706b436447952f40f153e2a52dc"><code>9f98535</code></a> Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/9241c3eddf4a6a218681b088d71f7191513e2376"><code>9241c3e</code></a> chore: prepare Tokio v1.18.4 release</li>
<li><a href="https://github.com/tokio-rs/tokio/commit/699573d550fabf4bfb45d82505d6709faaae9037"><code>699573d</code></a> net: fix named pipes server configuration builder</li>
<li>See full diff in <a href="https://github.com/tokio-rs/tokio/compare/tokio-1.23.0...tokio-1.23.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.23.0&new-version=1.23.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language
- ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language
- ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/rust-lang/miri/network/alerts).

</details>

17 months agoClean up
kadmin [Wed, 21 Dec 2022 21:53:52 +0000 (21:53 +0000)]
Clean up

Simplify match statement

Add multiple tests
- 1 test for checking `N + 1 + 1` does not unify with `N+1`
- 2 tests for checking that a function that uses two parameters only returns the parameter that
  is actually used.
- Check exact repeat predicates

17 months agoCheck for duplicates
kadmin [Tue, 20 Dec 2022 21:11:19 +0000 (21:11 +0000)]
Check for duplicates

17 months agoSet !const_evaluatable if ambig. and not inferred
kadmin [Tue, 20 Dec 2022 03:36:32 +0000 (03:36 +0000)]
Set !const_evaluatable if ambig. and not inferred

This prevents an ICE due to a value not actually being evaluatable later.

17 months agoChange based on comments
kadmin [Tue, 13 Dec 2022 09:51:13 +0000 (09:51 +0000)]
Change based on comments

Instead of just switching to a probe, check for different matches, and see how many there are.
If one, unify it, otherwise return true and let it be unified later.

17 months agoChange commit_if_ok to probe
kadmin [Sun, 4 Dec 2022 19:58:03 +0000 (19:58 +0000)]
Change commit_if_ok to probe

17 months agoAuto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnr
bors [Mon, 9 Jan 2023 08:40:08 +0000 (08:40 +0000)]
Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnr

Improve spans of non-WF implied bound types

Fixes #60980

17 months agoAuto merge of #106616 - compiler-errors:rollup-emcj0o3, r=compiler-errors
bors [Mon, 9 Jan 2023 05:09:45 +0000 (05:09 +0000)]
Auto merge of #106616 - compiler-errors:rollup-emcj0o3, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #104163 (Don't derive Debug for `OnceWith` & `RepeatWith`)
 - #106131 (Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible)
 - #106363 (Structured suggestion for `&mut dyn Iterator` when possible)
 - #106497 (Suggest using clone when we have &T and T implemented Clone)
 - #106584 (Document that `Vec::from_raw_parts[_in]` must be given a pointer from the correct allocator.)
 - #106600 (Suppress type errors that come from private fields)
 - #106602 (Add goml scripts to tidy checks)
 - #106606 (Do not emit structured suggestion for turbofish with wrong span)

Failed merges:

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

17 months agofix: fix CI errors
Ezra Shaw [Mon, 9 Jan 2023 02:44:33 +0000 (15:44 +1300)]
fix: fix CI errors

17 months agoRollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errors
Michael Goulet [Mon, 9 Jan 2023 03:57:56 +0000 (19:57 -0800)]
Rollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errors

Do not emit structured suggestion for turbofish with wrong span

Fix #79161.

17 months agoRollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum
Michael Goulet [Mon, 9 Jan 2023 03:57:56 +0000 (19:57 -0800)]
Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum

Add goml scripts to tidy checks

r? ``@notriddle``

17 months agoRollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebank
Michael Goulet [Mon, 9 Jan 2023 03:57:55 +0000 (19:57 -0800)]
Rollup merge of #106600 - compiler-errors:no-private-field-ty-err, r=estebank

Suppress type errors that come from private fields

Fixes #57320

There was some discussion here (https://github.com/rust-lang/rust/issues/57320#issuecomment-451308420), but I honestly think the second error is worth suppressing regardless.

I would be open to feedback though -- perhaps we can suppress the `.len()` suggestion if there's type error (since we have access to [`Expectation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/enum.Expectation.html), we can determine that).

r? ``@estebank``

17 months agoRollup merge of #106584 - kpreid:vec-allocator, r=JohnTitor
Michael Goulet [Mon, 9 Jan 2023 03:57:54 +0000 (19:57 -0800)]
Rollup merge of #106584 - kpreid:vec-allocator, r=JohnTitor

Document that `Vec::from_raw_parts[_in]` must be given a pointer from the correct allocator.

Currently, the documentation of `Vec::from_raw_parts` and `Vec::from_raw_parts_in` says nothing about what allocator the pointer must come from. This PR adds that missing information explicitly.

17 months agoRollup merge of #106497 - chenyukang:yukang/fix-106443-sugg-clone, r=estebank
Michael Goulet [Mon, 9 Jan 2023 03:57:54 +0000 (19:57 -0800)]
Rollup merge of #106497 - chenyukang:yukang/fix-106443-sugg-clone, r=estebank

Suggest using clone when we have &T and T implemented Clone

Fixes #106443

17 months agoRollup merge of #106363 - estebank:mutability-mismatch-arg, r=Nilstrieb
Michael Goulet [Mon, 9 Jan 2023 03:57:53 +0000 (19:57 -0800)]
Rollup merge of #106363 - estebank:mutability-mismatch-arg, r=Nilstrieb

Structured suggestion for `&mut dyn Iterator` when possible

Fix #37914.

17 months agoRollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwco
Michael Goulet [Mon, 9 Jan 2023 03:57:53 +0000 (19:57 -0800)]
Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwco

Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible

Fixes #80929
Fixes #67296

17 months agoRollup merge of #104163 - H4x5:once-repeat-with-debug, r=dtolnay
Michael Goulet [Mon, 9 Jan 2023 03:57:52 +0000 (19:57 -0800)]
Rollup merge of #104163 - H4x5:once-repeat-with-debug, r=dtolnay

Don't derive Debug for `OnceWith` & `RepeatWith`

Closures don't impl Debug, so the derived impl is kinda useless. The behavior of not debug-printing closures is consistent with the rest of the iterator adapters/sources.

17 months agodocs/test: add error-docs and UI test for `E0711`
Ezra Shaw [Sun, 8 Jan 2023 08:36:19 +0000 (21:36 +1300)]
docs/test: add error-docs and UI test for `E0711`

17 months agodocs/test: add empty error-docs for `E0208`, `E0640` and `E0717`
Ezra Shaw [Sun, 8 Jan 2023 08:35:50 +0000 (21:35 +1300)]
docs/test: add empty error-docs for `E0208`, `E0640` and `E0717`

17 months agoAdd regression test for #100772
Yuki Okushi [Thu, 5 Jan 2023 15:05:41 +0000 (00:05 +0900)]
Add regression test for #100772

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
17 months agoFix tests
mejrs [Sun, 8 Jan 2023 23:23:27 +0000 (00:23 +0100)]
Fix tests

17 months agoAuto merge of #90291 - geeklint:loosen_weak_debug_bound, r=dtolnay
bors [Sun, 8 Jan 2023 22:40:38 +0000 (22:40 +0000)]
Auto merge of #90291 - geeklint:loosen_weak_debug_bound, r=dtolnay

Loosen the bound on the Debug implementation of Weak.

Both `rc::Weak<T>` and `sync::Weak<T>` currently require `T: Debug` in their own `Debug` implementations, but they don't currently use it;  they only ever print a fixed string.

A general implementation of Debug for Weak that actually attempts to upgrade and rely on the contents is unlikely in the future because it may have unbounded recursion in the presence of reference cycles, which Weak is commonly used in.  (This was the justification for why the current implementation [was implemented the way it is](https://github.com/rust-lang/rust/pull/19388/commits/f0976e2cf3f6b0027f118b791e0888b29fbb41a7)).

When I brought it up [on the forum](https://internals.rust-lang.org/t/could-the-bound-on-weak-debug-be-relaxed/15504), it was suggested that, even if an implementation is specialized in the future that relies on the data stored within the Weak, it would likely rely on specialization anyway, and could therefore easily specialize on the Debug bound as well.

17 months agoMake translate_message return result and add tests
mejrs [Sun, 8 Jan 2023 22:35:43 +0000 (23:35 +0100)]
Make translate_message return result and add tests

17 months agoDo not emit structured suggestion for turbofish with wrong span
Esteban Küber [Sun, 8 Jan 2023 22:27:13 +0000 (22:27 +0000)]
Do not emit structured suggestion for turbofish with wrong span

Fix #79161.

17 months agoFix tidy issues in goml scripts
Guillaume Gomez [Sun, 8 Jan 2023 20:29:57 +0000 (21:29 +0100)]
Fix tidy issues in goml scripts

17 months agoAdd goml scripts to tidy checks
Guillaume Gomez [Sun, 8 Jan 2023 20:29:45 +0000 (21:29 +0100)]
Add goml scripts to tidy checks

17 months agoSuppress type errors that come from private fields
Michael Goulet [Sun, 8 Jan 2023 19:45:23 +0000 (19:45 +0000)]
Suppress type errors that come from private fields

17 months agoDon't store spans in assumed_wf_types actually
Michael Goulet [Sun, 8 Jan 2023 19:02:58 +0000 (19:02 +0000)]
Don't store spans in assumed_wf_types actually

17 months agoNormalize assumed_wf_types after wfchecking is complete, for better spans
Michael Goulet [Sun, 8 Jan 2023 03:14:27 +0000 (03:14 +0000)]
Normalize assumed_wf_types after wfchecking is complete, for better spans

17 months agoImprove spans of non-WF implied bound types
Michael Goulet [Sun, 8 Jan 2023 02:40:59 +0000 (02:40 +0000)]
Improve spans of non-WF implied bound types

17 months agoAuto merge of #106449 - GuillaumeGomez:rustdoc-gui-retry-mechanism, r=Mark-Simulacrum
bors [Sun, 8 Jan 2023 17:49:31 +0000 (17:49 +0000)]
Auto merge of #106449 - GuillaumeGomez:rustdoc-gui-retry-mechanism, r=Mark-Simulacrum

Add retry mechanism for rustdoc GUI tests to reduce flakyness

Part of #93784.

I added 3 retries for failing GUI tests. An important note: if more than half of total tests fail, I don't retry because it's very likely not flakyness anymore at this point but a missing update after changes.

17 months agoAuto merge of #13860 - danieleades:clippy, r=lnicola
bors [Sun, 8 Jan 2023 17:29:57 +0000 (17:29 +0000)]
Auto merge of #13860 - danieleades:clippy, r=lnicola

fix a bunch of clippy lints

fixes a bunch of clippy lints for fun and profit

i'm aware of this repo's position on clippy. The changes are split into separate commits so they can be reviewed separately

17 months agoRemove extra space
Yukang [Sun, 8 Jan 2023 14:51:42 +0000 (22:51 +0800)]
Remove extra space

17 months agoAuto merge of #106235 - compiler-errors:rework-bounds-collection, r=davidtwco
bors [Sun, 8 Jan 2023 14:40:52 +0000 (14:40 +0000)]
Auto merge of #106235 - compiler-errors:rework-bounds-collection, r=davidtwco

Rework `Bounds` collection

I think it's weird for the `Bounds` struct in astconv to store its predicates *almost* converted into real predicates... so we do this eagerly, instead of lazily.

17 months agoAuto merge of #105733 - compiler-errors:ty-ct-late-flags, r=cjgillot
bors [Sun, 8 Jan 2023 11:51:41 +0000 (11:51 +0000)]
Auto merge of #105733 - compiler-errors:ty-ct-late-flags, r=cjgillot

Add type flags support for `Ty` and `Const` late-bound variables

I've been working on `for<T>` binders, and these will eventually be useful.

17 months agoAuto merge of #106588 - JohnTitor:rollup-4z80tjx, r=JohnTitor
bors [Sun, 8 Jan 2023 09:00:31 +0000 (09:00 +0000)]
Auto merge of #106588 - JohnTitor:rollup-4z80tjx, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #103104 (Stabilize `main_separator_str`)
 - #106410 (Suggest `mut self: &mut Self` for `?Sized` impls)
 - #106457 (Adjust comments about pre-push.sh hook)
 - #106546 (jsondoclint: Check local items in `paths` are also in `index`.)
 - #106557 (Add some UI tests and reword error-code docs)
 - #106562 (Clarify examples for `VecDeque::get/get_mut`)
 - #106580 (remove unreachable error code `E0313`)
 - #106581 (Do not emit wrong E0308 suggestion for closure mismatch)

Failed merges:

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

17 months agoRollup merge of #106581 - estebank:bad-suggestion, r=compiler-errors
Yuki Okushi [Sun, 8 Jan 2023 08:01:49 +0000 (17:01 +0900)]
Rollup merge of #106581 - estebank:bad-suggestion, r=compiler-errors

Do not emit wrong E0308 suggestion for closure mismatch

Found in #76353.

17 months agoRollup merge of #106580 - Ezrashaw:remove-e0313, r=compiler-errors
Yuki Okushi [Sun, 8 Jan 2023 08:01:49 +0000 (17:01 +0900)]
Rollup merge of #106580 - Ezrashaw:remove-e0313, r=compiler-errors

remove unreachable error code `E0313`

Fixes #103742
Makes #103433 redundant

Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing?

Also removed a redundant `// ignore-tidy-filelength` that I found while reading code.

cc ``@GuillaumeGomez`` #61137

17 months agoRollup merge of #106562 - clubby789:vec-deque-example, r=Mark-Simulacrum
Yuki Okushi [Sun, 8 Jan 2023 08:01:48 +0000 (17:01 +0900)]
Rollup merge of #106562 - clubby789:vec-deque-example, r=Mark-Simulacrum

Clarify examples for `VecDeque::get/get_mut`

Closes #106114

``@rustbot`` label +A-docs

17 months agoRollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomez
Yuki Okushi [Sun, 8 Jan 2023 08:01:48 +0000 (17:01 +0900)]
Rollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomez

Add some UI tests and reword error-code docs

Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit.

I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously.

r? ``@GuillaumeGomez``

17 months agoRollup merge of #106546 - aDotInTheVoid:jsondoclint-path-local-item, r=notriddle
Yuki Okushi [Sun, 8 Jan 2023 08:01:47 +0000 (17:01 +0900)]
Rollup merge of #106546 - aDotInTheVoid:jsondoclint-path-local-item, r=notriddle

jsondoclint: Check local items in `paths` are also in `index`.

Would have caught #104064 (if core.json was linted in CI).

Closes #106433.

r? rustdoc

17 months agoRollup merge of #106457 - kadiwa4:no-bless, r=Mark-Simulacrum
Yuki Okushi [Sun, 8 Jan 2023 08:01:47 +0000 (17:01 +0900)]
Rollup merge of #106457 - kadiwa4:no-bless, r=Mark-Simulacrum

Adjust comments about pre-push.sh hook

Follow-up to #101175.

17 months agoRollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, r=compiler-errors
Yuki Okushi [Sun, 8 Jan 2023 08:01:46 +0000 (17:01 +0900)]
Rollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, r=compiler-errors

Suggest `mut self: &mut Self` for `?Sized` impls

Closes #106325
Closes #93078

The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start.

``@rustbot`` label +A-diagnostics

17 months agoRollup merge of #103104 - SUPERCILEX:sep-ref, r=dtolnay
Yuki Okushi [Sun, 8 Jan 2023 08:01:46 +0000 (17:01 +0900)]
Rollup merge of #103104 - SUPERCILEX:sep-ref, r=dtolnay

Stabilize `main_separator_str`

See reasoning here: https://github.com/rust-lang/rust/issues/94071#issuecomment-1279872605. Closes #94071.

17 months agoMention signature rather than fn pointers when comparing impl/trait methods
Michael Goulet [Sat, 24 Dec 2022 23:17:25 +0000 (23:17 +0000)]
Mention signature rather than fn pointers when comparing impl/trait methods

17 months agoAdd type flags support for Ty and Const late-bound regions
Michael Goulet [Thu, 15 Dec 2022 02:38:39 +0000 (02:38 +0000)]
Add type flags support for Ty and Const late-bound regions

17 months agoDo not emit wrong E0308 suggestion for closure mismatch
Esteban Küber [Sun, 8 Jan 2023 01:53:39 +0000 (01:53 +0000)]
Do not emit wrong E0308 suggestion for closure mismatch

17 months agoAdd test
Esteban Küber [Sun, 8 Jan 2023 01:53:08 +0000 (01:53 +0000)]
Add test

17 months agoremove unreachable error code `E0313`
Ezra Shaw [Sun, 8 Jan 2023 01:46:01 +0000 (14:46 +1300)]
remove unreachable error code `E0313`

17 months agoAuto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrum
bors [Sun, 8 Jan 2023 01:34:05 +0000 (01:34 +0000)]
Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrum

Update `rand` in the stdlib tests, and remove the `getrandom` feature from it.

The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones.

~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now.

For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy".

Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature).

See also some previous attempts:
- https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial)
- https://github.com/rust-lang/rust/pull/89131
- https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal).
- https://github.com/rust-lang/rust/pull/104185
- Probably more. It's very tempting of a thing to "just update".

r? `@Mark-Simulacrum`

17 months agodoc/test: add UI test and reword docs for `E0013` and `E0015`
Ezra Shaw [Sat, 7 Jan 2023 05:37:40 +0000 (18:37 +1300)]
doc/test: add UI test and reword docs for `E0013` and `E0015`

17 months agoDocument that `Vec::from_raw_parts[_in]` must be given a pointer from the correct...
Kevin Reid [Sat, 7 Jan 2023 23:56:36 +0000 (15:56 -0800)]
Document that `Vec::from_raw_parts[_in]` must be given a pointer from the correct allocator.

17 months agoAuto merge of #106573 - matthiaskrgr:rollup-zkgfsta, r=matthiaskrgr
bors [Sat, 7 Jan 2023 22:42:39 +0000 (22:42 +0000)]
Auto merge of #106573 - matthiaskrgr:rollup-zkgfsta, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #101936 (Migrating rustc_infer to session diagnostics (part 3))
 - #104081 (PhantomData layout guarantees)
 - #104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3])
 - #105128 (Add O(1) `Vec -> VecDeque` conversion guarantee)
 - #105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.)
 - #105859 (Point out span where we could introduce higher-ranked lifetime)
 - #106509 (Detect closures assigned to binding in block)
 - #106553 (docs: make `HashSet::retain` doctest more clear)
 - #106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`)
 - #106564 (Change to immutable borrow when cloning element of RepeatN)

Failed merges:

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

17 months agoRollup merge of #106564 - Folyd:feat-repeatn, r=scottmcm
Matthias Krüger [Sat, 7 Jan 2023 19:43:23 +0000 (20:43 +0100)]
Rollup merge of #106564 - Folyd:feat-repeatn, r=scottmcm

Change to immutable borrow when cloning element of RepeatN

17 months agoRollup merge of #106556 - notriddle:notriddle/margin-left-content-mobile, r=Guillaume...
Matthias Krüger [Sat, 7 Jan 2023 19:43:23 +0000 (20:43 +0100)]
Rollup merge of #106556 - notriddle:notriddle/margin-left-content-mobile, r=GuillaumeGomez

rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`

This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.

17 months agoRollup merge of #106553 - Ezrashaw:fix-hashset-doctest, r=JohnTitor
Matthias Krüger [Sat, 7 Jan 2023 19:43:22 +0000 (20:43 +0100)]
Rollup merge of #106553 - Ezrashaw:fix-hashset-doctest, r=JohnTitor

docs: make `HashSet::retain` doctest more clear

Fixes #106535

Extremely simple fix suggested by ``@compiler-errors`` in the linked issue.

17 months agoRollup merge of #106509 - estebank:closure-in-block, r=davidtwco
Matthias Krüger [Sat, 7 Jan 2023 19:43:22 +0000 (20:43 +0100)]
Rollup merge of #106509 - estebank:closure-in-block, r=davidtwco

Detect closures assigned to binding in block

Fix #58497.

17 months agoRollup merge of #105859 - compiler-errors:hr-lifetime-add, r=davidtwco
Matthias Krüger [Sat, 7 Jan 2023 19:43:21 +0000 (20:43 +0100)]
Rollup merge of #105859 - compiler-errors:hr-lifetime-add, r=davidtwco

Point out span where we could introduce higher-ranked lifetime

Somewhat addresses #105422, but not really. We don't have that much useful information here since we're still in resolution :^(

Maybe this suggestion isn't worth it. If the reviewer has an idea how we can get a more succinct binder information for a structured suggestion, it would be appreciated.

17 months agoRollup merge of #105517 - pcc:process-panic-after-fork, r=davidtwco
Matthias Krüger [Sat, 7 Jan 2023 19:43:20 +0000 (20:43 +0100)]
Rollup merge of #105517 - pcc:process-panic-after-fork, r=davidtwco

Fix process-panic-after-fork.rs to pass on newer versions of Android.

The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.

17 months agoRollup merge of #105128 - Sp00ph:vec_vec_deque_conversion, r=dtolnay
Matthias Krüger [Sat, 7 Jan 2023 19:43:20 +0000 (20:43 +0100)]
Rollup merge of #105128 - Sp00ph:vec_vec_deque_conversion, r=dtolnay

Add O(1) `Vec -> VecDeque` conversion guarantee

(See #105072)

17 months agoRollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs...
Matthias Krüger [Sat, 7 Jan 2023 19:43:19 +0000 (20:43 +0100)]
Rollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco

Migrate `codegen_ssa` to diagnostics structs - [Part 3]

Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates:
1. [`rustc_middle::mir::interpret::InterpError`](https://github.com/rust-lang/rust/blob/b6097f2e1b2ca62e188ba53cf43bd66b06b36915/compiler/rustc_middle/src/mir/interpret/error.rs#L475): I saw `rustc_middle` is unassigned, I am open to take this work.

2.  `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](https://github.com/rust-lang/rust/commit/9a31b3cdda78a2c0891828254fe9886e0a1cfd16) of this PR, but would like to know the team's preference on how we should keep replacing the other macros:
2.1. Update macros to expect a `Diagnostic`
2.2. Remove macros and expand the code on each use.
See [some examples of the different options in this experimental commit](https://github.com/JhonnyBillM/rust/commit/64aee83e80857dcfa450f0c6e31d5f29c6d577e6)

_Part 2 - https://github.com/rust-lang/rust/pull/103792_

r? ``@davidtwco``
Cc ``@compiler-errors``

17 months agoRollup merge of #104081 - joshlf:patch-6, r=dtolnay
Matthias Krüger [Sat, 7 Jan 2023 19:43:19 +0000 (20:43 +0100)]
Rollup merge of #104081 - joshlf:patch-6, r=dtolnay

PhantomData layout guarantees

17 months agoRollup merge of #101936 - IntQuant:issue-100717-infer-4, r=compiler-errors
Matthias Krüger [Sat, 7 Jan 2023 19:43:18 +0000 (20:43 +0100)]
Rollup merge of #101936 - IntQuant:issue-100717-infer-4, r=compiler-errors

Migrating rustc_infer to session diagnostics (part 3)

``@rustbot`` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717

Seems like a part of static_impl_trait.rs emits suggestions in a loop, and note.rs needs to have two instances of the same subdiagnostic, so these will need to wait until we have eager translation/list support.
Other than that, there is only error_reporting/mod.rs left to migrate.

17 months agoDon't derive Debug for `OnceWith` & `RepeatWith`
Sky [Sat, 7 Jan 2023 19:16:59 +0000 (14:16 -0500)]
Don't derive Debug for `OnceWith` & `RepeatWith`

17 months agoAuto merge of #106036 - JohnTitor:issue-86106, r=nikic
bors [Sat, 7 Jan 2023 19:26:25 +0000 (19:26 +0000)]
Auto merge of #106036 - JohnTitor:issue-86106, r=nikic

Add regression test for #86106

Closes #86106
r? `@nikic`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
17 months agoBump d3-color and d3-graphviz in /editors/code
dependabot[bot] [Sat, 7 Jan 2023 19:20:08 +0000 (19:20 +0000)]
Bump d3-color and d3-graphviz in /editors/code

Bumps [d3-color](https://github.com/d3/d3-color) to 3.1.0 and updates ancestor dependency [d3-graphviz](https://github.com/magjac/d3-graphviz). These dependencies need to be updated together.

Updates `d3-color` from 2.0.0 to 3.1.0
- [Release notes](https://github.com/d3/d3-color/releases)
- [Commits](https://github.com/d3/d3-color/compare/v2.0.0...v3.1.0)

Updates `d3-graphviz` from 4.1.1 to 5.0.2
- [Release notes](https://github.com/magjac/d3-graphviz/releases)
- [Changelog](https://github.com/magjac/d3-graphviz/blob/master/CHANGELOG.md)
- [Commits](https://github.com/magjac/d3-graphviz/compare/v4.1.1...v5.0.2)

---
updated-dependencies:
- dependency-name: d3-color
  dependency-type: indirect
- dependency-name: d3-graphviz
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
17 months agoAuto merge of #13876 - lnicola:zip-artifacts, r=lnicola
bors [Sat, 7 Jan 2023 19:19:37 +0000 (19:19 +0000)]
Auto merge of #13876 - lnicola:zip-artifacts, r=lnicola

feat: Package Windows release artifacts as ZIP and add symbols file

Closes #13872
Closes #7747
CC #10371

This allows us to ship a format that's easier to handle on Windows. As a bonus, we can also include the PDB, to get useful stack traces. Unfortunately, it adds a couple of dependencies to `xtask`, increasing the debug build times from 1.28 to 1.58 s (release from 1.60s to 2.20s) on my system.

17 months agoAuto merge of #13894 - lowr:patch/fallback-before-final-obligation-resolution, r...
bors [Sat, 7 Jan 2023 19:03:34 +0000 (19:03 +0000)]
Auto merge of #13894 - lowr:patch/fallback-before-final-obligation-resolution, r=lnicola

Apply fallback before final obligation resolution

Fixes #13249
Fixes #13518

We've been applying fallback to type variables independently even when there are some unresolved obligations that associate them. This PR applies fallback to unresolved scalar type variables before the final attempt of resolving obligations, which enables us to infer more.

Unlike rustc, which has separate storages for each kind of type variables, we currently don't have a way to retrieve only integer/float type variables without folding/visiting every single type we've inferred. I've repurposed `TypeVariableData` as bitflags that also hold the kind of the type variable it's referring to so that we can "reconstruct" scalar type variables from their indices.

This PR increases the number of ??ty for rust-analyzer repo not because we regress and fail to infer the existing code but because we fail to infer the new code. It seems we have problems inferring some functions bitflags produces.