Commit Graph

214775 Commits

Author SHA1 Message Date
Ralf Jung
5977a1626d make env::current_exe work on Windows 2023-01-09 13:46:15 +01:00
Fabian Hintringer
c364d329dd
Relocate changes 2023-01-09 13:19:41 +01:00
bors
89e0576bd3 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`
2023-01-09 11:59:51 +00:00
bors
fe8ee9c43a 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.
2023-01-09 11:53:23 +00:00
bors
1e20bf38b2 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
2023-01-09 11:40:48 +00:00
bors
814ff01620 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 😁
2023-01-09 11:24:44 +00:00
unvalley
9eabc2cde8 fix: add_format_like_completions to handle no exprs 2023-01-09 12:23:59 +01:00
unvalley
a310fc0cd5 docs: update assist comment 2023-01-09 12:23:06 +01:00
unvalley
872df2f413 chore: update assist label name 2023-01-09 12:22:29 +01:00
unvalley
285f09cfa8 feat: extract only expressions from format string 2023-01-09 12:22:29 +01:00
unvalley
29f3d7dee7 test: fix arg_type test 2023-01-09 12:22:29 +01:00
unvalley
13267adb12 fix: to leave Ident in parse_format_exprs 2023-01-09 12:22:29 +01:00
unvalley
796a106412 fix: ide assist handlers order 2023-01-09 12:22:25 +01:00
unvalley
9290399ec4 fix: rename to extract_expressions_from_format_string 2023-01-09 12:21:37 +01:00
Lukas Wirth
0dd2682178 Refactor replace_arith assists into one module 2023-01-09 11:59:17 +01:00
bors
25717af4aa 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="7a1573ed26"><code>7a1573e</code></a> 3.1.0</li>
<li><a href="75c19c40c2"><code>75c19c4</code></a> update LICENSE</li>
<li><a href="ef94e0125c"><code>ef94e01</code></a> update dependencies</li>
<li><a href="5e9f7579dd"><code>5e9f757</code></a> method shorthand</li>
<li><a href="e4bc34e46c"><code>e4bc34e</code></a> formatHex8 (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/103">#103</a>)</li>
<li><a href="ac660c6b6b"><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="70e3a041f1"><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="994d8fd951"><code>994d8fd</code></a> avoid backtracking (<a href="https://github-redirect.dependabot.com/d3/d3-color/issues/100">#100</a>)</li>
<li><a href="7d61bbe6e4"><code>7d61bbe</code></a> 3.0.1</li>
<li><a href="93bc4ff542"><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="21a1f57612"><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="3c96187ad3"><code>3c96187</code></a> add version 5.0.2 to CHANGELOG</li>
<li><a href="82c34adb33"><code>82c34ad</code></a> update version to 5.0.2</li>
<li><a href="493e14927c"><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="1903eea4e5"><code>1903eea</code></a> add simple-default-export-test.js</li>
<li><a href="ccd6b90f36"><code>ccd6b90</code></a> correct default export in package.json</li>
<li><a href="d32e81cbfb"><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="d0651e56ec"><code>d0651e5</code></a> add version 5.0.1 to CHANGELOG</li>
<li><a href="0c06f6246b"><code>0c06f62</code></a> update version to 5.0.1</li>
<li><a href="2df0d3a66f"><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>
2023-01-09 10:37:46 +00:00
bors
c0f5dc813e 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="1a997ffbd6"><code>1a997ff</code></a> chore: prepare Tokio v1.23.1 release</li>
<li><a href="a8fe333cc4"><code>a8fe333</code></a> Merge branch 'tokio-1.20.x' into tokio-1.23.x</li>
<li><a href="ba81945ffc"><code>ba81945</code></a> chore: prepare Tokio 1.20.3 release</li>
<li><a href="763bdc967e"><code>763bdc9</code></a> ci: run WASI tasks using latest Rust</li>
<li><a href="9f98535877"><code>9f98535</code></a> Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20</li>
<li><a href="9241c3eddf"><code>9241c3e</code></a> chore: prepare Tokio v1.18.4 release</li>
<li><a href="699573d550"><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>
2023-01-09 10:29:57 +00:00
kadmin
21c5ffe008 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
2023-01-09 08:41:21 +00:00
kadmin
7c5cb73735 Check for duplicates 2023-01-09 08:41:21 +00:00
kadmin
b79a9a0900 Set !const_evaluatable if ambig. and not inferred
This prevents an ICE due to a value not actually being evaluatable later.
2023-01-09 08:41:21 +00:00
kadmin
77b61379b6 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.
2023-01-09 08:41:21 +00:00
kadmin
abe040d876 Change commit_if_ok to probe 2023-01-09 08:41:21 +00:00
bors
c54c8cbac8 Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnr
Improve spans of non-WF implied bound types

Fixes #60980
2023-01-09 08:40:08 +00:00
bors
2e677c0645 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
2023-01-09 05:09:45 +00:00
Ezra Shaw
2c92c72c46
fix: fix CI errors 2023-01-09 17:05:56 +13:00
Michael Goulet
5e8e97f981
Rollup merge of #106606 - estebank:bad-nested-turbofish, r=compiler-errors
Do not emit structured suggestion for turbofish with wrong span

Fix #79161.
2023-01-08 19:57:56 -08:00
Michael Goulet
bb6a88ad5e
Rollup merge of #106602 - GuillaumeGomez:tidy-goml-scripts, r=Mark-Simulacrum
Add goml scripts to tidy checks

r? ``@notriddle``
2023-01-08 19:57:56 -08:00
Michael Goulet
29420a8e7a
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``
2023-01-08 19:57:55 -08:00
Michael Goulet
70f1566b2b
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.
2023-01-08 19:57:54 -08:00
Michael Goulet
eefc44b7e2
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
2023-01-08 19:57:54 -08:00
Michael Goulet
334426b7a8
Rollup merge of #106363 - estebank:mutability-mismatch-arg, r=Nilstrieb
Structured suggestion for `&mut dyn Iterator` when possible

Fix #37914.
2023-01-08 19:57:53 -08:00
Michael Goulet
6afd16171d
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
2023-01-08 19:57:53 -08:00
Michael Goulet
db87e276c4
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.
2023-01-08 19:57:52 -08:00
Ezra Shaw
24ce65c8d6
docs/test: add error-docs and UI test for E0711 2023-01-09 15:48:53 +13:00
Ezra Shaw
ecc0507fdd
docs/test: add empty error-docs for E0208, E0640 and E0717 2023-01-09 15:48:52 +13:00
Yuki Okushi
1ab06ed765
Add regression test for #100772
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-09 08:28:06 +09:00
mejrs
4c0c32c895 Fix tests 2023-01-09 00:23:27 +01:00
bors
a377893da2 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](f0976e2cf3)).

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.
2023-01-08 22:40:38 +00:00
mejrs
262ff86138 Make translate_message return result and add tests 2023-01-08 23:35:43 +01:00
Esteban Küber
6fdb54d2f1 Do not emit structured suggestion for turbofish with wrong span
Fix #79161.
2023-01-08 22:27:13 +00:00
Guillaume Gomez
31b39be9ce Fix tidy issues in goml scripts 2023-01-08 22:03:08 +01:00
Guillaume Gomez
65fae266eb Add goml scripts to tidy checks 2023-01-08 21:29:45 +01:00
Michael Goulet
59aa421f35 Suppress type errors that come from private fields 2023-01-08 20:04:40 +00:00
Michael Goulet
e77e8eb945 Don't store spans in assumed_wf_types actually 2023-01-08 19:38:17 +00:00
Michael Goulet
0bddce5090 Normalize assumed_wf_types after wfchecking is complete, for better spans 2023-01-08 18:50:09 +00:00
Michael Goulet
ca554efaf7 Improve spans of non-WF implied bound types 2023-01-08 18:50:08 +00:00
bors
cc47b06998 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.
2023-01-08 17:49:31 +00:00
bors
f77b68a3cb 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
2023-01-08 17:29:57 +00:00
Yukang
0e570e58f2
Remove extra space 2023-01-08 22:51:42 +08:00
bors
fa51fc01ca 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.
2023-01-08 14:40:52 +00:00