Commit Graph

56 Commits

Author SHA1 Message Date
hkalbasi
b55fbd3ad7 Add moved-out-of-ref diagnostic 2023-05-18 19:17:06 +03:30
hkalbasi
4adfbbfbad partially support panic message in MirEvalError 2023-05-18 18:30:49 +03:30
bors
034d7c8537 Auto merge of #14787 - HKalbasi:mir2, r=HKalbasi
MIR episode 5

This PR inits drop support (it is very broken at this stage, some things are dropped multiple time, drop scopes are wrong, ...) and adds stdout support (`println!` doesn't work since its expansion is dummy, but `stdout().write(b"hello world\n")` works if you use `RA_SYSROOT_HACK`) for interpreting. There is no useful unit test that it can interpret yet, but it is a good sign that it didn't hit a major road block yet.

In MIR lowering, it adds support for slice pattern and anonymous const blocks, and some fixes so that we can evaluate `SmolStr::new_inline` in const eval. With these changes, 57 failed mir body remains.
2023-05-18 09:44:26 +00:00
hkalbasi
cbcafd3539 MIR episode 5 2023-05-12 18:17:15 +03:30
hkalbasi
7da80d4f67 Use double reference in debug derive 2023-05-12 12:36:57 +03:30
Ariel Davis
4b28ad92e9 Make text-size a workspace dep 2023-05-06 00:49:23 -07:00
hkalbasi
d9f4cbbe8f Emit function bodies in expanding builtin derives 2023-05-03 14:14:47 +03:30
Lukas Wirth
a64626d99e Highlight closure captures when cursor is on pipe 2023-05-02 08:59:40 +02:00
hkalbasi
6312fbf521 MIR episode 4 2023-05-01 23:23:10 +03:30
hkalbasi
232f293c19 Fix some typos in StructFlags 2023-04-23 21:55:47 +03:30
hkalbasi
f05f7ab082 Add minicore smoke test 2023-04-18 17:38:38 +03:30
Ryo Yoshida
4db87f9346
Fix release channel detection
See bootstrap code in rust-lang/rust for versioning details: e49122fb1c/src/bootstrap/lib.rs (L1244)
2023-04-18 02:12:17 +09:00
bors
7afd2048f0 Auto merge of #14544 - HKalbasi:dev, r=Veykril
Infer types of nested RPITs

fix https://github.com/rust-lang/rust-analyzer/issues/14474#issuecomment-1501235394
2023-04-11 14:49:04 +00:00
Ryo Yoshida
584d2697cc
Add toolchain meta for tests 2023-04-11 21:21:10 +09:00
hkalbasi
a584cb998f Infer types of nested RPITs 2023-04-11 04:32:11 +03:30
hkalbasi
c54cb88950 Add bounds for associated types in derive macro 2023-04-07 19:33:14 +03:30
hkalbasi
eb4939e217 Support overloaded deref MIR lowering 2023-03-17 14:02:55 +03:30
hkalbasi
9564773d5e Improve pattern matching MIR lowering 2023-03-17 13:08:36 +03:30
hkalbasi
b7b9ae59a0 desugar ? operator 2023-03-17 13:08:35 +03:30
Lukas Wirth
f34b2469bd lint incoherent inherent impls 2023-03-14 19:20:44 +01:00
bors
44ff3c407a Auto merge of #14232 - HKalbasi:mir, r=Veykril
MIR episode 2

This PR adds:
1. `need-mut` and `unused-mut` diagnostics
2. `View mir` command which shows MIR for the body under cursor, useful for debugging
3. MIR lowering for or-patterns and for-loops
2023-03-07 09:49:49 +00:00
Lukas Wirth
199bc82ce8 feature: Make replace_or_with_or_else assists more generally applicable 2023-03-06 22:17:30 +01:00
hkalbasi
6377d50bd1 Support "for loop" MIR lowering 2023-03-06 21:09:09 +03:30
hkalbasi
cd67589f63 beginning of MIR 2023-02-27 23:45:54 +03:30
bors
bfe82cda48 Auto merge of #14036 - Veykril:write-method-resolution, r=Veykril
Record method resolution for remaining operator expressions

This allows goto def and future substituted hover to work for the concrete impls.
2023-02-01 10:23:33 +00:00
hkalbasi
0bf0d937b8 unsize cast array only on pointer type 2023-01-31 20:23:38 +03:30
Lukas Wirth
54da0bfbf0 Record method resolution for call expressions 2023-01-27 11:06:41 +01:00
Lukas Wirth
f8ed4d7ae4 Use lang item resolution instead of known paths 2023-01-21 19:03:36 +01:00
bors
fa874627f0 Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril
Use workspace.dependencies to declare local dependencies
2023-01-17 10:29:27 +00:00
Lukas Wirth
bed4db3c62 Use workspace.dependencies to declare local dependencies 2023-01-17 10:52:26 +01:00
Lukas Wirth
e4858fe480 Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
Lukas Wirth
679df2adf1 Specify rust-version via workspace.package 2023-01-16 16:33:01 +01: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
Lukas Wirth
f51111aacb Write down adjustments introduced by binary operators 2023-01-02 23:16:09 +01:00
Daniel Eades
7530d76f00 use pointer args 2023-01-02 14:52:32 +00:00
Daniel Eades
ed128872eb remove needless borrows 2023-01-02 14:52:32 +00:00
Daniel Eades
77051679d7 use inline format args 2023-01-02 14:52:32 +00:00
Yuri Astrakhan
d3dbf9c194 Moar linting: needless_borrow, let_unit_value, ...
* There are a few needless borrows that don't seem to be needed. I even did a quick assembly comparison and posted a q to stackoveflow on it. See [here](https://stackoverflow.com/questions/74910196/advantages-of-pass-by-ref-val-with-impl-intoiteratoritem-impl-asrefstr)
* removed several `let _ = ...` when they don't look necessary (even a few ones that were not suggested by clippy (?))
* there were a few `then(|| ctor{})` that clippy suggested to replace with `then_some(ctor{})` -- seems reasonable?
* some unneeded assignment+return - keep the code a bit leaner
* a few `writeln!` instead of `write!`, or even consolidate write!
* a nice optimization to use `ch.is_ascii_digit` instead of `ch.is_digit(10)`
2022-12-25 05:07:47 -05:00
Yuri Astrakhan
e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Lukas Wirth
a694c342fa Fix tests not using appropriate target data 2022-12-21 20:23:43 +01:00
bors
6e8a54d0f6 Auto merge of #13490 - HKalbasi:layout, r=jonas-schievink
Compute data layout of types

cc #4091

Things that aren't working:
* Closures
* Generators (so no support for `Future` I think)
* Opaque types
* Type alias and associated types which may need normalization

Things that show wrong result:
* ~Enums with explicit discriminant~
* SIMD types
* ~`NonZero*` and similar standard library items which control layout with special attributes~

At the user level, I didn't put much work, since I wasn't confident about what is the best way to present this information. Currently it shows size and align for ADTs, and size, align, offset for struct fields, in the hover, similar to clangd. I used it some days and I feel I liked it, but we may consider it too noisy and move it to an assist or command.
2022-12-07 15:22:03 +00:00
Ryo Yoshida
cf54b8c3a4
Parse and collect derive helpers for builtin derive macros 2022-12-06 16:00:46 +09:00
Lukas Wirth
ca1389ef9f Support rustc_has_incoherent_inherent_impls 2022-12-04 20:37:17 +01:00
hkalbasi
f2c9502185 support nonzero* niche optimizations 2022-12-04 00:29:34 +03:30
Lukas Wirth
ffd7bf8bf9 Bump Cargo rust-version fields to latest stable 2022-11-07 12:59:51 +01:00
Lukas Wirth
8047512dca
Revert "feat: Diagnose some incorrect usages of the question mark operator" 2022-10-18 14:18:59 +02:00
Lukas Wirth
381366f1dd Diagnose incorrect usages of the question mark operator 2022-10-16 12:58:24 +02:00
Lukas Wirth
28c21bc8a8 internal: Allow minicore flags specification to be order independent 2022-10-06 14:31:06 +02:00
Ryo Yoshida
4b5a66e0bc
Add tests for type inference for generators 2022-09-13 02:43:07 +09:00
Justin Ridgewell
5810c8188a Implement IntoFuture type inference 2022-08-08 21:05:56 -04:00