Commit Graph

17702 Commits

Author SHA1 Message Date
bors
8769cd24bc Auto merge of #15140 - tetsuharuohzeki:issue-15088-comment, r=Veykril
Add the comment why `HasSource::source()` returns `Option`

Fix https://github.com/rust-lang/rust-analyzer/issues/15088
2023-06-26 10:12:00 +00:00
Tetsuharu Ohzeki
7b418d3a8c Add the comment why HasSource::source() returns Option 2023-06-26 17:05:13 +09:00
bors
4a2ceeff0f Auto merge of #15135 - HKalbasi:mir, r=HKalbasi
Fix some unsizing problems in mir
2023-06-25 22:28:23 +00:00
hkalbasi
6d2d1387af Fix some unsizing problems in mir 2023-06-26 01:57:12 +03:30
Josh Stone
380773b3e8 Upgrade to indexmap v2 2023-06-24 17:35:20 -07:00
hkalbasi
5eb4796d3d Support more intrinsics in mir interpreter 2023-06-23 21:08:05 +03:30
hkalbasi
99a4f2e983 Support manual impl of fn traits in mir interpreter 2023-06-22 22:24:21 +03:30
bors
3a4f9a1416 Auto merge of #15110 - HKalbasi:run-test-command, r=HKalbasi
internal: Add run-tests command

This command is similar to `cargo test` except that it uses r-a to run tests instead of compiling and running them with rustc. This is slower than `cargo test` and it is only useful for me to see a bird view of what needs to be fixed. The current output is:
```
48 passed, 5028 failed, 2 ignored
All tests            174.74s, 648ginstr
```
48 is very low, but higher than what I originally thought.

Now that there is some passing tests, I can show the plan:

https://github.com/rust-lang/rust-analyzer/assets/45197576/76d7d777-1843-4ca4-b7fe-e463bdade6cb

That is, at the end, I want to be able to immediately re run every test after every change. (0.5s is not really immediate, but it's not finished yet, and it is way better than 8s that running a typical test in r-a will take on my system)
2023-06-22 16:04:16 +00:00
hkalbasi
674cd5ab57 Add run-tests command 2023-06-22 19:33:37 +03:30
bors
6c73f67998 Auto merge of #15105 - dfireBird:fix-15096, r=HKalbasi
Change comparsion for checking if number is negative to include 128

The last byte in Little-Endian representation of negative integers start at 128 (Ox80) till 255 (OxFF). The comparison before the fix didn't check for 128 which made is_negative variable as false.

Potentially fixes #15096
2023-06-22 12:35:22 +00:00
dfireBird
410ede9101
Add some tests in number evaluvation and hover to prevent regression
Added a test near positive extermes and two test near negative
extermes as well one for 0.
Added a test using the `as` cast and one with comparison with 0.
2023-06-22 17:58:12 +05:30
bors
f0e00ed599 Auto merge of #14948 - alibektas:14386, r=Veykril
feature : assist delegate impl

This PR ( fixes #14386 ) introduces a new IDE assist that generates a trait impl for a struct that delegates a field. This is a draft because the current `ide_db::path_transform::PathTransform` produces some unwanted results when it deals with extern crates, an example of which I attach as a GIF.

GIFs :
1. A general case
![14386-functional](https://github.com/rust-lang/rust-analyzer/assets/20956650/22114959-caa6-45ec-a154-b4b2f458f6b1)

2. A case where `ide_db::path_transform::PathTransform` fails to correctly resolve a property ( take `Allocator` as an example ) to its full path, thus causing an error to occur. ( Not to even mention that resolving this causes another error `use of unstable library feature 'allocator_api'` to occur
![14386-erroneous](https://github.com/rust-lang/rust-analyzer/assets/20956650/922ca715-594e-4168-a579-7c5c006f93aa)
2023-06-22 10:44:01 +00:00
Lukas Wirth
0953e85b59 Downgrade some deps to get rif of windows-sys duplication 2023-06-22 11:44:10 +02:00
Lukas Wirth
8823db6c78 Bump more deps 2023-06-22 11:44:10 +02:00
Lukas Wirth
4fa3f1ef5c Bump serde 2 things 2023-06-22 11:44:10 +02:00
dfireBird
b8017928af
Change comparsion for checking if number is negative to include 128
Reason: The last byte in Little Endian representation of negative
integers start at 128 (Ox80) till 255 (OxFF). The comparison before
the fix didn't check for 128 which made is_negative variable as false.
2023-06-22 12:51:35 +05:30
bors
85493dfdb0 Auto merge of #15104 - Veykril:mir-borrow-synthetic, r=Veykril
Skip mutable diagnostics on synthetic bindings

Fixes https://github.com/rust-lang/rust-analyzer/issues/15099

We probabnly need to look into this in a more general manner in the future now that we desugar more things
2023-06-21 17:41:00 +00:00
Lukas Wirth
d8b970f1fc Skip mutable diagnostics on synthetic bindings 2023-06-21 19:38:19 +02:00
Laurențiu Nicola
f5876aee1e Simplify VfsPath fmt 2023-06-21 16:13:17 +03:00
bors
bc26e81cd5 Auto merge of #15070 - Veykril:analysis-stat-stuff, r=Veykril
internal: Report metric timings for file item trees and crate def map creation
2023-06-21 05:58:13 +00:00
hkalbasi
10aba11b29 Fix VfsPath Display and Debug impls 2023-06-20 23:17:42 +03:30
David Lattimore
bea3a33d84 Change in-tree libs to workspace dependencies 2023-06-20 13:53:39 +10:00
hkalbasi
3c87825074 Use ArgumentV1 instead of Argument 2023-06-19 22:48:49 +03:30
bors
f99348578a Auto merge of #15074 - oxalica:fix/inline-async-fn, r=lowr
Correctly handle inlining of async fn

Fixes #10198
2023-06-19 15:46:55 +00:00
oxalica
2cd7b0cfce Remove unused StmtList::push_front 2023-06-19 22:56:31 +08:00
bors
67e1f52062 Auto merge of #15086 - Veykril:import-intern, r=Veykril
internal: Intern use and extern crate items like other items

Looking a bit into supporting use aliases and attributes better
2023-06-19 13:51:41 +00:00
Lukas Wirth
8d33b39b4a Use RA_LOG in slow tests logging infra again 2023-06-19 15:11:47 +02:00
Lukas Wirth
9476fdaaa9 HIR ExternCrateDecl 2023-06-19 14:15:08 +02:00
Alex Kladov
6303551cb8 internal: use consistent style for error handling 2023-06-19 13:01:47 +01:00
Lukas Wirth
0bde3fc77e Intern use and extern crate items like other items 2023-06-19 13:51:44 +02:00
Alex Kladov
49318bbae7 fix: ensure that ws loading error includes path to ws 2023-06-19 12:32:04 +01:00
bors
00b9d9faf4 Auto merge of #15071 - matklad:no-regex, r=matklad
internal: remove spurious regex dependency

- replace tokio's env-filter with a smaller&simpler targets filter
- reshuffle logging infra a bit to make sure there's only a single place where we read environmental variables
- use anyhow::Result in rust-analyzer binary
2023-06-19 10:51:03 +00:00
oxalica
52f1ce17aa Correctly handle inlining of async fn 2023-06-19 17:14:17 +08:00
Alex Kladov
424ef77809 internal: remove spurious regex dependency
- replace tokio's env-filter with a smaller&simpler targets filter
- reshuffle logging infra a bit to make sure there's only a single place
  where we read environmental variables
- use anyhow::Result in rust-analyzer binary
2023-06-18 13:59:32 +01:00
bors
cd3bf9fe51 Auto merge of #15076 - Veykril:bindings, r=Veykril
internal: Shrink size of hir::Binding
2023-06-18 10:19:27 +00:00
Lukas Wirth
c3186202a2 Shrink size of hir::Binding 2023-06-18 12:03:04 +02:00
bors
5dccf3010b Auto merge of #15075 - Veykril:bindings, r=Veykril
fix: Add binding definition for for-expr iterator desugared binding
2023-06-18 09:45:49 +00:00
Lukas Wirth
83d7724629 fix: Add binding definition for for-expr iterator desugared binding 2023-06-18 11:44:01 +02:00
bors
a1b536ec6f Auto merge of #15054 - ponyii:fix/implement-missing-members-do-not-transform-const-params, r=lowr
fix: implement missing members doesn't transform const params and default types

Fixes https://github.com/rust-lang/rust-analyzer/issues/13363
2023-06-18 09:30:13 +00:00
Ali Bektas
4ed1197662 Version 3
Remove scope_for_def calls as the definition have been removed entirely.
As a result of this change the problem with false path resolutions has been solved.
2023-06-17 21:27:52 +02:00
Ali Bektas
19a9de72f6 Version 2 2023-06-17 13:52:34 +02:00
Ali Bektas
59cc783a3b Correct errors produced by CI 2023-06-17 13:52:34 +02:00
Ali Bektas
8123a39c82 Generate delegate trait 2023-06-17 13:52:34 +02:00
Lukas Wirth
a824b734dd Report metric timings for file item trees and crate def map creation 2023-06-17 11:20:21 +02:00
Lukas Wirth
58ac823864 Less eager parsing for module sources 2023-06-17 10:58:52 +02:00
Lukas Wirth
b5e0452c71 Lazy progress reporting 2023-06-17 10:34:44 +02:00
Lukas Wirth
64a8887a94 Add body lowering step, track time of each step separtely 2023-06-17 09:55:48 +02:00
bors
fdba1b6a5c Auto merge of #15066 - Veykril:analysis-stats, r=Veykril
internal: Analyze all bodies in analysis-stats, not just functions
2023-06-17 07:09:50 +00:00
Lukas Wirth
bd762e62df internal: Add more context to overly long loop turn message 2023-06-16 19:31:07 +02:00
Lukas Wirth
76acf3b992 internal: Analyze all bodies in analysis-stats, not just functions 2023-06-16 19:14:46 +02:00