Commit graph

26487 commits

Author SHA1 Message Date
bors
82ef6991d7 Auto merge of #15203 - Veykril:proc-macro-expand, r=Veykril
Shuffle some proc_macro_expand query things around

Removes some unnecessary extra work we are doing in proc-macro expansion, and more importantly `Arc` the result of the proc_macro_expand query, that way we can reuse the instance for the `macro_expand` query's result
2023-07-03 13:07:26 +00:00
Lukas Wirth
bdc3d0f551 Shuffle some proc_macro_expand query things around 2023-07-03 15:05:25 +02:00
bors
8094e05c0f Auto merge of #15202 - Veykril:builtin-derive-diags, r=Veykril
internal: Don't diagnose builtin derives
2023-07-03 12:24:36 +00:00
Lukas Wirth
321e570d92 Don't diagnose builtin derives 2023-07-03 14:23:36 +02:00
bors
e175595985 Auto merge of #15186 - matklad:panic, r=HKalbasi
feat: don't add panics to error jump list by default

To re-enable this, use

    "rust-analyzer.runnables.problemMatcher": [
        "$rustc",
        "$rust-panic"
    ],

setting.

closes: #14977
2023-07-03 02:40:35 +00:00
bors
ff485b63bf Auto merge of #15199 - lowr:patch/revert-15125, r=lowr
Revert "Support `#[rustc_coinductive]`"

Reverts #15125, addresses https://github.com/rust-lang/rust-analyzer/pull/15125#issuecomment-1615517893

I'll add the support again once I figure out the problem.
2023-07-02 20:27:18 +00:00
Ryo Yoshida
6086ced61d Revert "Support #[rustc_coinductive]"
This reverts commit d026479ba6.
2023-07-03 05:06:55 +09:00
bors
2b6a132087 Auto merge of #108537 - GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle
rustdoc: Allow whitespace as path separator like double colon

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

I think it makes sense since it allows more common cases, however it also makes the syntax heavier. Not sure what the rest of the team thinks about it. In any case we'll need to go through FCP.

Full explanation for the changes is available [here](https://github.com/rust-lang/rust/pull/108537#issuecomment-1589480564).

r? `@notriddle`
2023-07-02 18:49:29 +00:00
bors
fab41c61b6 Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko
Add `-Zremark-dir` unstable flag to write LLVM optimization remarks to YAML

This PR adds an option for `rustc` to emit LLVM optimization remarks to a set of YAML files, which can then be digested by existing tools, like https://github.com/OfekShilon/optview2. When `-Cremark-dir` is passed, and remarks are enabled (`-Cremark=all`), the remarks will be now written to the specified directory, **instead** of being printed to standard error output.  The files are named based on the CGU from which they are being generated.

Currently, the remarks are written using the LLVM streaming machinery, directly in the diagnostics handler. It seemed easier than going back to Rust and then form there back to C++ to use the streamer from the diagnostics handler. But there are many ways to implement this, of course, so I'm open to suggestions :)

I included some comments with questions into the code. Also, I'm not sure how to test this.

r? `@tmiasko`
2023-07-02 12:48:44 +00:00
bors
9bdc9aaceb Auto merge of #15195 - davidlattimore:proc-macro-test-no-version, r=HKalbasi
Don't specify proc-macro-test version

proc-macro-test is only used as a dev-dependency and isn't published to crates.io, so a version doesn't make sense. Having a version also breaks automatic publishing.
2023-07-02 09:23:06 +00:00
David Lattimore
0810827b97 Don't specify proc-macro-test version
proc-macro-test is only used as a dev-dependency and isn't published to
crates.io, so a version doesn't make sense. Having a version also breaks
automatic publishing.
2023-07-02 19:06:20 +10:00
bors
d32775d39f Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillot
Make simd_shuffle_indices use valtrees

This removes the second-to-last user of the `destructure_mir_constant` query. So in a follow-up we can remove the query and just move the query provider function directly into pretty printing (which is the last user).

cc `@rust-lang/clippy` there's a small functional change, but I think it is correct?
2023-07-02 07:43:36 +00:00
bors
f5f0c48ac3 Auto merge of #15194 - HKalbasi:mir, r=HKalbasi
Fix layout of simd types and respect align in mir interpreter
2023-07-01 21:13:08 +00:00
hkalbasi
6f7452882a Fix layout of simd types and respect align in mir interpreter 2023-07-02 00:42:33 +03:30
bors
3d3f325a4e Auto merge of #15189 - HKalbasi:mir, r=HKalbasi
Fix overflow checking in shift operator
2023-07-01 13:47:41 +00:00
hkalbasi
15a0da6f30 Fix overflow checking in shift operator 2023-07-01 17:16:56 +03:30
bors
27597022f8 Auto merge of #112550 - loongarch-rs:fix-eflags, r=cjgillot
loongarch: Fix ELF header flags

This patch changes the ELF header flags so that the ABI matches the floating-point features. It also updates the link to the new official documentation.
2023-07-01 09:31:35 +00:00
bors
f697b36a7e Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-se
Test benchmarks with `-Z panic-abort-tests`

During test execution, when a `#[bench]` benchmark is encountered it's executed once to check whether it works. Unfortunately that was not compatible with `-Z panic-abort-tests`: the feature works by spawning a subprocess for each test, which prevents the use of dynamic tests as we cannot pass closures to child processes, and before this PR the conversion from benchmark to test was done by turning benchmarks into dynamic tests whose closures execute the benchmark once.

The approach this PR took was to add two new kinds of `TestFn`s: `StaticBenchAsTestFn` and `DynBenchAsTestFn` (⚠️ **this is a breaking change** ⚠️). With that change, a `StaticBenchFn` can be converted into a `StaticBenchAsTestFn` without creating dynamic tests, and making it possible to test `#[bench]` functions with `-Z panic-abort-tests`. The subprocess test runner also had to be updated to perform the conversion from benchmark to test when appropriate.

Along with the bug fix, in the first commit I refactored how tests are executed: rather than executing the test function in multiple places across `libtest`, there is now a private `TestFn::into_runnable()` method, which returns either a `RunnableTest` or `RunnableBench`, on which you can call the `run()` method. This simplified the rest of the changes in the PR.

This PR is best reviewed commit-by-commit.
Fixes https://github.com/rust-lang/rust/issues/73509
2023-07-01 07:07:50 +00:00
bors
6970494361 Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errors
change snapshot tracking in fulfillment contexts

use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-07-01 01:53:10 +00:00
Alex Kladov
832a64e290 feat: don't add panics to error jump list by default
To re-enable this, use

    "rust-analyzer.runnables.problemMatcher": [
        "$rustc",
        "$rust-panic"
    ],

setting.

closes: #14977
2023-06-30 22:23:13 +01:00
bors
46cd8b8495 Auto merge of #15185 - HKalbasi:mir, r=HKalbasi
Bump chalk

This fixes some issues, but I didn't add fix #num for them since 1. I don't know all of them and 2. we may want to add test for them.
2023-06-30 20:12:06 +00:00
hkalbasi
bb85a980e0 Bump chalk 2023-06-30 23:36:47 +03:30
bors
0841a84935 Auto merge of #15184 - HKalbasi:mir, r=HKalbasi
Disable mir interpreter for targets with different pointer size from host

fix #15182
2023-06-30 17:53:11 +00:00
hkalbasi
45828cdb54 Disable mir interpreter for targets with different pointer size from host 2023-06-30 21:21:52 +03:30
bors
76bcd9946a Auto merge of #15169 - lowr:patch/impl-header-anon-lifetime, r=HKalbasi
Use anonymous lifetime where possible

Because anonymous lifetimes are *super* cool.

More seriously, I believe anonymous lifetimes, especially those in impl headers, reduce cognitive load to a certain extent because they usually signify that they are not relevant in the signature of the methods within (or that we can apply the usual lifetime elision rules even if they are relevant).
2023-06-30 16:57:20 +00:00
Ryo Yoshida
5db0e1a346
Restructure ImportMap collection 2023-07-01 00:18:23 +09:00
Ryo Yoshida
2b106648a7
Only store item name instead of full path 2023-07-01 00:17:57 +09:00
bors
7a3991a544 Auto merge of #15180 - alibektas:15176, r=Veykril
Purge of unwraps

Removes unnecessary unwraps that I have overlooked in #15101 ( fixes #15176 )
2023-06-30 14:46:49 +00:00
Ryo Yoshida
860628af7c
Remove SearchMode:Contains
Also micro-optimizes fuzzy search.
2023-06-30 23:37:23 +09:00
Ryo Yoshida
8cd4e9f7ec
Merge assoc_items_only and exclude_import_kinds into assoc_mode 2023-06-30 23:37:10 +09:00
Ryo Yoshida
97b725e269
Remove name_only from import map query 2023-06-30 23:35:55 +09:00
Ali Bektas
cfbeb66a63 Purge of unwrap version 2 2023-06-30 16:31:20 +02:00
Ali Bektas
72aeaef5f3 Purge of unwraps 2023-06-30 15:47:17 +02:00
bors
0ab008bf1e Auto merge of #109524 - bzEq:aix-embed-llvmbc, r=nagisa
Support embedding LLVM bitcode on AIX
2023-06-30 11:39:58 +00:00
bors
78621cc50b Auto merge of #106619 - agausmann:avr-object-file, r=nagisa
Fix unset e_flags in ELF files generated for AVR targets

Closes #106576

~~Sort-of blocked by gimli-rs/object#500~~ (merged)

I'm not sure whether the list of AVR CPU names is okay here. Maybe it could be moved out-of-line to improve the readability of the function.
2023-06-30 08:55:56 +00:00
bors
f96442aa90 Auto merge of #15177 - rust-lang:Veykril-patch-1, r=Veykril
Fix panic in `handle_code_action`

🤞 that CI is happy with this, edited this via github
2023-06-30 06:56:21 +00:00
Lukas Wirth
7e7f401a81
Fix panic in handle_code_action 2023-06-30 08:42:46 +02:00
Lukas Wirth
60d046f567
Fix panic in handle_code_action 2023-06-30 08:38:44 +02:00
bors
d597369253 Auto merge of #15175 - lnicola:cross-env, r=Veykril
internal: Drop `cross-env` npm dep
2023-06-30 06:35:09 +00:00
Laurențiu Nicola
477a75d671 Drop cross-env npm dep 2023-06-30 09:20:02 +03:00
bors
40b2a68381 Auto merge of #15174 - tetsuharuohzeki:switch-to-use-vscode-vcse, r=Veykril
editor/code: Switch to `@vscode/vsce`

This follows up https://github.com/rust-lang/rust-analyzer/pull/15151

`vsce` was renamed to ``@vscode/vsce`.` We should switch to it now.

- https://code.visualstudio.com/updates/v1_74#_extension-authoring
- https://www.npmjs.com/package/`@vscode/vsce`
2023-06-30 05:48:47 +00:00
Tetsuharu Ohzeki
0500b1d5f8 editor/code: Switch to @vscode/vsce
`vsce` was renamed to `@vscode/vsce`.
We should switch to it now.

- https://code.visualstudio.com/updates/v1_74#_extension-authoring
- https://www.npmjs.com/package/@vscode/vsce
2023-06-30 09:55:43 +09:00
bors
3e579460df Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk
A mish-mash of micro-optimizations

These were aimed at speeding up LLVM codegen, but ended up affecting other places as well.

r? `@bjorn3`
2023-06-30 00:35:19 +00:00
bors
769c80dc62 Auto merge of #15173 - HKalbasi:mir, r=HKalbasi
Fix data layout of reference to nested unsized structs
2023-06-29 20:25:42 +00:00
hkalbasi
302bb3c871 Fix data layout of reference to nested unsized structs 2023-06-29 23:38:13 +03:30
bors
263a2b8198 Auto merge of #113059 - Kobzol:ci-concurrency-fix, r=pietroalbini
CI: do not cancel concurrent builds on the same branch

Do not cancel concurrent builds on the same branch (outside of PRs).

Instead, only cancel them if the builds have the same commit SHA.

From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context):
> The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53.

Fixes: https://github.com/rust-lang/rust/pull/112955#discussion_r1242273658

r? `@pietroalbini`
2023-06-29 18:18:52 +00:00
bors
b9c3d091ca Auto merge of #15172 - HKalbasi:mir, r=HKalbasi
Support #[derive_const(Trait)]

This is a nightly feature used in the standard library.
2023-06-29 18:17:21 +00:00
hkalbasi
f53f9230f0 Support #[derive_const(Trait)] 2023-06-29 20:58:35 +03:30
bors
007b3fe936 Auto merge of #113108 - compiler-errors:normalize-opaques-with-late-bound-vars-again, r=jackh726
Normalize opaques with late-bound vars again

We have a hack in the compiler where if an opaque has escaping late-bound vars, we skip revealing it even though we *could* reveal it from a technical perspective. First of all, this is weird, since we really should be revealing all opaques in `Reveal::All` mode. Second of all, it causes subtle bugs (linked below).

I attempted to fix this in #100980, which was unfortunately reverted due to perf regressions on codebases that used really deeply nested futures in some interesting ways. The worst of which was #103423, which caused the project to hang on build. Another one was #104842, which was just a slow-down, but not a hang. I took some time afterwards to investigate how to rework `normalize_erasing_regions` to take advantage of better caching, but that effort kinda fizzled out (#104133).

However, recently, I was made aware of more bugs whose root cause is not revealing opaques during codegen. That made me want to fix this again -- in the process, interestingly, I took the the minimized example from https://github.com/rust-lang/rust/issues/103423#issuecomment-1292947043, and it doesn't seem to hang any more...

Thinking about this harder, there have been some changes to the way we lower and typecheck async futures that may have reduced the pathologically large number of outlives obligations (see description of #103423) that we were encountering when normalizing opaques with bound vars the last time around:
* #104321 (lower `async { .. }` directly as a generator that implements `Future`, removing the `from_generator` shim)
* #104833 (removing an `identity_future` fn that was wrapping desugared future generators)

... so given that I can see:
* No significant regression on rust perf bot (https://github.com/rust-lang/rust/pull/107620#issuecomment-1600070317)
* No timeouts in crater run I did (https://github.com/rust-lang/rust/pull/107620#issuecomment-1605428952, rechecked failing crates in https://github.com/rust-lang/rust/pull/107620#issuecomment-1605973434)

... and given that this PR:
* Fixes #104601
* Fixes #107557
* Fixes #109464
* Allows us to remove a `DefiningAnchor::Bubble` from codegen (75a8f681837c70051e0200a14f58ae07dbe58e66)

I'm inclined to give this another shot at landing this. Best case, it just works -- worst case, we get more examples to study how we need to improve the compiler to make this work.

r? types
2023-06-29 15:37:11 +00:00
Ryo Yoshida
4e793e7859
Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00