Commit Graph

44 Commits

Author SHA1 Message Date
Ryo Yoshida
d026479ba6
Support #[rustc_coinductive] 2023-06-25 00:13:31 +09:00
hkalbasi
5eb4796d3d Support more intrinsics in mir interpreter 2023-06-23 21:08:05 +03:30
hkalbasi
527dfede48 Support Pointee trait 2023-06-16 16:43:43 +03:30
Laurențiu Nicola
6d6354e5b5 Rename minicore ArgumentV1 to match libcore 2023-06-14 07:33:37 +03:00
hkalbasi
a481e004b0 Lower const params with a bad id 2023-06-11 00:39:28 +03:30
Lukas Wirth
f9a9e40c0a Update builtin attribute list 2023-06-04 10:02:11 +02:00
hkalbasi
08f89193b5 Fix drop scopes in mir 2023-06-04 01:03:32 +03:30
hkalbasi
f9e3b180b7 Add enum, reference, array and slice to render_const_scalar 2023-06-02 13:47:02 +03:30
Lukas Wirth
be9cc0baae Render size, align and offset hover values in hex 2023-05-26 16:41:45 +02:00
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
hkalbasi
d9f4cbbe8f Emit function bodies in expanding builtin derives 2023-05-03 14:14:47 +03:30
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
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
Lukas Wirth
f51111aacb Write down adjustments introduced by binary operators 2023-01-02 23:16:09 +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
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
Michael Chisolm
1c32fcfeb4
Fix generated PartialEq::ne 2022-07-20 00:26:50 -04:00
Peh
1f011fa4a3 style: rename crates to kebab case 2022-05-01 10:48:58 +00:00