Commit Graph

25708 Commits

Author SHA1 Message Date
bors
f6ae0c11ac Auto merge of #15270 - ChristianSchott:patch-1, r=HKalbasi
Make fields of mir::Terminator public

When trying to use the RA crate, I am unable to access the fields in `hir_def::mir::Terminator`.
I don't see any reason, why these should be private, especially as the fields of `hir_def::mir::Statement` are `pub`.

I am not sure if the fields in `hir_def::mir::SwitchTargets` should be made `pub` too, but at least they are read-accessible via some public methods..

Sorry if I missed something, this is my first PR.
2023-07-13 07:54:44 +00:00
bors
132ba2cf77 Auto merge of #15248 - Veykril:eager, r=Veykril
Fix eager token mapping panics
2023-07-13 07:39:30 +00:00
Lukas Wirth
6a7b905c86 Fix the eager token maps by re-mapping the textranges between the input and input expansion 2023-07-13 09:22:38 +02:00
bors
215b149a8b Auto merge of #15272 - lnicola:links, r=lnicola
minor: Use a permalink to the SIMD line index code, and add a note on the GitHub API
2023-07-12 23:34:43 +00:00
bors
d16d5fcf68 Auto merge of #15268 - HKalbasi:mir, r=HKalbasi
Add write_bytes and ctlz intrinsics
2023-07-12 23:19:30 +00:00
bors
642420fb60 Auto merge of #15267 - lowr:patch/exceeding-exec-limit-is-slow, r=lnicola
Mark test for MIR execution limit as slow test

The test for MIR execution limit accounts for ~2/3 of total execution time of non-slow hir-ty tests. It significantly slows down edit-and-run-test type of workflow. Can we mark it as a slow test?
2023-07-12 23:04:16 +00:00
bors
584dca4a35 Auto merge of #15266 - tetsuharuohzeki:cleanup-editor-config, r=lnicola
Set .editorconfig default indent size to `4`

We uses `indent_size = 4` for almost files in this repository. This sorts the config to it.
2023-07-12 22:45:28 +00:00
bors
da02dc8a47 Auto merge of #15264 - rust-lang:dependabot/npm_and_yarn/editors/code/semver-5.7.2, r=lnicola
Bump semver from 5.7.1 to 5.7.2 in /editors/code

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/npm/node-semver/releases">semver's releases</a>.</em></p>
<blockquote>
<h2>v5.7.2</h2>
<h2><a href="https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2">5.7.2</a> (2023-07-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><a href="2f8fd41487"><code>2f8fd41</code></a> <a href="https://redirect.github.com/npm/node-semver/pull/585">#585</a> better handling of whitespace (<a href="https://redirect.github.com/npm/node-semver/issues/585">#585</a>) (<a href="https://github.com/joaomoreno"><code>`@​joaomoreno</code></a>,` <a href="https://github.com/lukekarrys"><code>`@​lukekarrys</code></a>)</li>`
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md">semver's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2">5.7.2</a> (2023-07-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><a href="2f8fd41487"><code>2f8fd41</code></a> <a href="https://redirect.github.com/npm/node-semver/pull/585">#585</a> better handling of whitespace (<a href="https://redirect.github.com/npm/node-semver/issues/585">#585</a>) (<a href="https://github.com/joaomoreno"><code>`@​joaomoreno</code></a>,` <a href="https://github.com/lukekarrys"><code>`@​lukekarrys</code></a>)</li>`
</ul>
<h2>5.7</h2>
<ul>
<li>Add <code>minVersion</code> method</li>
</ul>
<h2>5.6</h2>
<ul>
<li>Move boolean <code>loose</code> param to an options object, with
backwards-compatibility protection.</li>
<li>Add ability to opt out of special prerelease version handling with
the <code>includePrerelease</code> option flag.</li>
</ul>
<h2>5.5</h2>
<ul>
<li>Add version coercion capabilities</li>
</ul>
<h2>5.4</h2>
<ul>
<li>Add intersection checking</li>
</ul>
<h2>5.3</h2>
<ul>
<li>Add <code>minSatisfying</code> method</li>
</ul>
<h2>5.2</h2>
<ul>
<li>Add <code>prerelease(v)</code> that returns prerelease components</li>
</ul>
<h2>5.1</h2>
<ul>
<li>Add Backus-Naur for ranges</li>
<li>Remove excessively cute inspection methods</li>
</ul>
<h2>5.0</h2>
<ul>
<li>Remove AMD/Browserified build artifacts</li>
<li>Fix ltr and gtr when using the <code>*</code> range</li>
<li>Fix for range <code>*</code> with a prerelease identifier</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f8cc313550"><code>f8cc313</code></a> chore: release 5.7.2</li>
<li><a href="2f8fd41487"><code>2f8fd41</code></a> fix: better handling of whitespace (<a href="https://redirect.github.com/npm/node-semver/issues/585">#585</a>)</li>
<li><a href="deb5ad51bf"><code>deb5ad5</code></a> chore: <code>`@​npmcli/template-oss</code><a` href="https://github.com/4"><code>`@​4</code></a>.16.0</li>`
<li>See full diff in <a href="https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~lukekarrys">lukekarrys</a>, a new releaser for semver since your current version.</p>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=semver&package-manager=npm_and_yarn&previous-version=5.7.1&new-version=5.7.2)](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)
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-07-12 22:30:09 +00:00
bors
f45fdd9123 Auto merge of #15260 - DropDemBits:structured-snippet-migrate-3, r=lowr
internal: Migrate assists to the structured snippet API, part 3

Continuing from #15231

Migrates the following assists:
- `add_missing_match_arms`
- `fix_visibility`
- `promote_local_to_const`

The `add_missing_match_arms` changes are best reviewed commit-by-commit since they're relatively big changes compared to the rest of the commits.
2023-07-12 22:05:30 +00:00
Laurențiu Nicola
a2b159dcc6 Use a permalink to the SIMD line index code, and add a note on the GitHub API 2023-07-12 20:51:20 +03:00
ChristianSchott
8f612b5352
Make fields of mir::Terminator public 2023-07-12 09:35:44 +02:00
dependabot[bot]
f0e2ad5a95
Bump semver from 5.7.1 to 5.7.2 in /editors/code
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-11 22:02:42 +00:00
hkalbasi
274e8301c1 Add write_bytes and ctlz intrinsics 2023-07-12 01:14:49 +03:30
DropDemBits
a9889a0f1c
fix the rest of the nits 2023-07-11 17:32:12 -04:00
DropDemBits
f9a144f0ed
Hoist out make::name_ref
`clone_for_update` is relatively cheap in comparison, since making a
node require parsing an entire source text

Adds a test to make sure that it doesn't crash when multiple uses are
present.
2023-07-11 17:28:17 -04:00
Ryo Yoshida
0312c6c321
Mark test for MIR execution limit as slow test 2023-07-11 23:36:47 +09:00
Tetsuharu Ohzeki
505d506a47 Set .editorconfig default indent size to 4
We uses indent_size = 4 for almost files in this repository.
This sorts the config to it.
2023-07-11 23:02:54 +09:00
bors
75ac37f317 Auto merge of #15259 - tetsuharuohzeki:sort-the-style-to-import, r=Veykril
editor/code: Sort the style to import types

This pull requests enables new lint rule to sorts the style to import types/symbols.

## see details of enabled rules
- https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md
- https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md
2023-07-11 12:01:57 +00:00
Lukas Wirth
2366c16bf9 Fix eager token mapping panics 2023-07-11 13:54:28 +02:00
bors
a5f0c6b8de Auto merge of #15263 - Veykril:lsp-server-serde-derive, r=Veykril
Enable derive feature for serde in lsp-server

Publishing failed due to this
2023-07-11 11:46:16 +00:00
Lukas Wirth
9031f385e0 Enable derive feature for serde in lsp-server 2023-07-11 13:45:27 +02:00
bors
cabe26c228 Auto merge of #15257 - sebastiansturm:master, r=lnicola
[lsp-server] Ignore 'Content-Length' case

this is a trivial PR meant to address issue #15197: the 'Content-Length' header field should probably be treated as case-insensitive
2023-07-11 05:35:46 +00:00
DropDemBits
99abcdc1eb
format let-else in promote_local_to_const 2023-07-10 17:49:27 -04:00
DropDemBits
11debaf61a
Migrate fix_visibility to mutable ast 2023-07-10 17:39:55 -04:00
Tetsuharu Ohzeki
445b4fc27f editor/code: Sort the style to import types
see:
- https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md
- https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md
2023-07-11 06:12:00 +09:00
bors
949ecea0d0 Auto merge of #15258 - HKalbasi:mir, r=HKalbasi
Support getrandom syscall

And fix some simd intrinsic bugs and add a memory limit to prevent huge allocations from breaking the main process.
2023-07-10 21:02:04 +00:00
hkalbasi
59420afa46 Support getrandom syscall 2023-07-11 00:29:06 +03:30
Sebastian Sturm
872cd30325 [lsp-server] Ignore 'Content-Length' case 2023-07-10 22:36:52 +02:00
bors
ea02f4cba1 Auto merge of #15251 - Veykril:builtin-expand, r=Veykril
Skip building subtrees for builtin derives

This is a waste of resources, we go from node to subtree just to go from subtree to node in the expander impl. We can skip the subtree building and only build the tokenmap instead.
2023-07-10 16:14:47 +00:00
bors
785a33d3e1 Auto merge of #15254 - tetsuharuohzeki:add-fixme-exactOptionalPropertyTypes, r=lnicola
editor/code: Add FIXME comments for TS' `--exactOptionalPropertyTypes` option

This add the FIXME comment for  https://github.com/rust-lang/rust-analyzer/issues/15253
2023-07-10 14:40:47 +00:00
Tetsuharu Ohzeki
e54f6636b6 editor/code: Add FIXME comments for TS' --exactOptionalPropertyTypes option 2023-07-10 23:39:08 +09:00
Lukas Wirth
f6c09099da Don't unnecessarily clone the input tt for decl macros 2023-07-10 16:28:23 +02:00
Lukas Wirth
d5f64f875a Infallibe ExpandDatabase::macro_def 2023-07-10 16:23:29 +02:00
bors
6f2e8aaba6 Auto merge of #15252 - tetsuharuohzeki:enable-unknonw-catch, r=lnicola
editor/code: Enable TypeScript's `--useUnknownInCatchVariables` option

This enables TypeScript's [`--useUnknownInCatchVariables`](https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables).
2023-07-10 14:22:21 +00:00
Tetsuharu Ohzeki
444bc5b3ba editor/code: Enable TypeScript's --useUnknownInCatchVariables option
see: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
2023-07-10 23:13:36 +09:00
Tetsuharu Ohzeki
a66b7e3eba editor/code: Remove unused sendRequestWithRetry 2023-07-10 23:13:36 +09:00
Tetsuharu Ohzeki
fd31006646 editor/code: Assert types in catch in sendRequestWithRetry() properly 2023-07-10 23:13:36 +09:00
Lukas Wirth
4ff93398fd Skip buildin subtrees for builtin derives 2023-07-10 15:19:00 +02:00
bors
2f6d545535 Auto merge of #15231 - DropDemBits:structured-snippet-migrate-2, r=lowr
internal: Migrate more assists to use the structured snippet API

Continuing from #14979

Migrates the following assists:
- `generate_derive`
- `wrap_return_type_in_result`
- `generate_delegate_methods`

As a bonus, `generate_delegate_methods` now generates the function and impl block at the correct indentation 🎉.
2023-07-10 10:57:24 +00:00
bors
9b2d4ce49f Auto merge of #15249 - lnicola:load-cargo-description, r=lnicola
minor: Fix publishing of load-cargo crate

https://github.com/rust-lang/rust-analyzer/actions/runs/5506737360/jobs/10035802204
2023-07-10 10:41:23 +00:00
Laurențiu Nicola
0f09a7742d Fix publishing of load-cargo crate 2023-07-10 13:40:37 +03:00
DropDemBits
8c40fa33df
Add HasVisibilityEdit::set_visibility 2023-07-09 20:50:20 -04:00
DropDemBits
27444eda56
Migrate promote_local_to_const to mutable ast 2023-07-09 18:49:29 -04:00
DropDemBits
6ab2788978
Migrate add_missing_match_arms to mutable ast
Requires a hack in order to work inside of macros
2023-07-09 18:31:38 -04:00
bors
ff15634831 Auto merge of #15245 - HKalbasi:mir, r=HKalbasi
Fix missing terminator in pattern matching of consts

fix #15238
2023-07-09 21:33:42 +00:00
hkalbasi
42d35f8af9 Fix missing terminator in pattern matching of consts 2023-07-10 01:01:59 +03:30
bors
5f11c9a1c3 Auto merge of #15081 - adenine-dev:master, r=HKalbasi
Feature: Add a memory layout viewer

**Motivation**: rustc by default doesn't enforce a particular memory layout, however it can be useful to see what it is doing under the hood, or if using a particular repr ensure it is behaving how you want it to. This command provides a way to visually explore memory layouts of structures.

**Example**:
this structure:
```rust
struct X {
    x: i32,
    y: u8,
    z: Vec<bool>,
    w: usize,
}
```
produces this output:
<img width="692" alt="image" src="https://github.com/rust-lang/rust-analyzer/assets/22418744/e0312233-18a7-4bb9-ae5b-7b52fcff158a">

**Work yet to be done**:
- tests (see below)
- html is mildly janky (see below)
- enums and unions are viewed flatly, how should they be represented?
- should niches be marked somehow?

This was written for my own use, and the jank is fine for me, but in its current state it is probably not ready to merge mostly because it is missing tests, and also because the code quality is not great. However, before I spend time fixing those things idk if this is even something wanted, if it is I am happy to clean it up, if not that's cool too.
2023-07-09 20:30:20 +00:00
Adenine
d0df00d274 Rework view memory layout tests to use expect_test and to_strings. 2023-07-09 16:11:15 -04:00
Adenine
add9056c32
Merge branch 'rust-lang:master' into master 2023-07-09 16:10:40 -04:00
bors
dcda13ac69 Auto merge of #15244 - HKalbasi:mir, r=HKalbasi
Support read_via_copy intrinsic
2023-07-09 19:48:54 +00:00