Lukas Wirth
20f7ab5ab4
fix: Always explicitly set trait ref self types when lowering
2024-09-06 14:06:41 +02:00
Shoyu Vanilla
d186bdc617
feat: Implement cast typechecks
2024-09-03 04:11:36 +09:00
Shoyu Vanilla
6520a43ca3
feat: Implement object safety
2024-08-29 22:22:21 +09:00
hkalbasi
850a83c7ce
Implement floating point casts in const eval
2024-08-22 09:16:00 -04:00
Chayim Refael Friedman
9d3368f2c2
Properly account for editions in names
...
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896 , but the FIXMEs were fixed here).
It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.
The rules of thumb are:
- If we show the identifier to the user, its rawness should be determined
by the edition of the edited crate. This is nice for IDE features,
but really important for changes we insert to the source code.
- For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
tests when an edition becomes stable, to avoid churn).
- For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
beetrees
d5db933f9d
Add f16
and f128
support
2024-07-10 10:43:14 +01:00
Lukas Wirth
866102cdaf
Re-implement tidy as an xtask action
2024-07-07 09:12:16 +02:00
Lukas Wirth
b9c1c42959
Allow new clippy lint in test
2024-07-07 08:41:41 +02:00
Hamir Mahal
7c34eb3880
style: simplify string interpolation
2024-05-30 16:18:49 -07:00
6d7a
142ef764ee
fix: Check stack depth to prevent stack overflows in create_memory_map
2024-03-24 10:19:25 +01:00
6d7a
7c1be82cd9
fix: Prevent stack overflow in recursive const types
...
In the evaluation of const values of recursive types
certain declarations could cause an endless call-loop
within the interpreter (hir-ty’s create_memory_map),
which would lead to a stack overflow.
This commit adds a check that prevents values that contain
an address in their value (such as TyKind::Ref) from being
allocated at the address they contain.
The commit also adds a test for this edge case.
2024-03-21 22:57:21 +01:00
Tetsuharu Ohzeki
d580b2c7bc
hir-ty: Fix warnings about clippy str_to_string
rule
2024-02-10 01:00:40 +09:00
Lukas Wirth
f49a2fed3f
internal: Move out WithFixture
into dev-dep only crate
2023-12-18 15:24:08 +01:00
Lukas Wirth
35620306a6
internal: Move proc-macro knowledge out of base-db
2023-12-18 12:37:18 +01:00
hkalbasi
8b82ea4f51
Store binding mode for each instance independently
2023-10-22 23:35:33 +03:30
Lukas Wirth
f13b184eb3
Implement write_via_move
intrinsic for mir-eval
2023-09-06 21:49:16 +02:00
hkalbasi
3864b43d28
Update offset intrinsic to match 1.72
2023-08-25 22:24:40 +03:30
hkalbasi
021802c59c
Support enum in memory map patch address
2023-08-09 00:27:23 +03:30
hkalbasi
31c30933cf
Support closure in clone shim
2023-08-08 01:49:34 +03:30
hkalbasi
b96e4f2f4a
Add mir lower support for tuple destructing assignment
2023-08-07 02:12:35 +03:30
hkalbasi
6990d0f26a
Fix unsized struct problems in mir eval
2023-08-02 17:36:11 +03:30
hkalbasi
bd2a8ca507
Add manual implementation of clone for tuples in mir interpreter
2023-07-28 18:52:01 +03:30
hkalbasi
17cc813e92
Support atomic fence intrinsic
2023-07-27 12:28:16 +03:30
hkalbasi
ed8e1fd472
Lookup super traits in is_dyn_method
2023-07-20 15:43:42 +03:30
hkalbasi
eb143383c3
Pass TraitEnvironment
into layout_ty
and const_eval
2023-07-20 13:08:38 +03:30
bors
8e5f944317
Auto merge of #15282 - HKalbasi:mir, r=HKalbasi
...
Give real discriminant_type to chalk
2023-07-14 16:46:35 +00:00
hkalbasi
5208bf8f55
implement type_name intrinsic
2023-07-14 16:52:36 +03:30
bors
d16d5fcf68
Auto merge of #15268 - HKalbasi:mir, r=HKalbasi
...
Add write_bytes and ctlz intrinsics
2023-07-12 23:19:30 +00:00
hkalbasi
274e8301c1
Add write_bytes and ctlz intrinsics
2023-07-12 01:14:49 +03:30
Ryo Yoshida
0312c6c321
Mark test for MIR execution limit as slow test
2023-07-11 23:36:47 +09:00
hkalbasi
59420afa46
Support getrandom syscall
2023-07-11 00:29:06 +03:30
hkalbasi
aa52cbf784
Support read_via_copy intrinsic
2023-07-09 23:17:51 +03:30
hkalbasi
4a444e768c
Implement recursion in mir interpreter without recursion
2023-07-07 15:07:29 +03:30
hkalbasi
3a1054fc1c
Replace x
with it
2023-07-06 17:33:17 +03:30
hkalbasi
171ae2ee5d
Fix size_of_val and support min_align_of_val
2023-07-06 15:41:52 +03:30
hkalbasi
6f7452882a
Fix layout of simd types and respect align in mir interpreter
2023-07-02 00:42:33 +03:30
hkalbasi
15a0da6f30
Fix overflow checking in shift operator
2023-07-01 17:16:56 +03:30
hkalbasi
302bb3c871
Fix data layout of reference to nested unsized structs
2023-06-29 23:38:13 +03:30
hkalbasi
2272803330
Fix realloc problem in allocating smaller amounts
2023-06-29 17:28:48 +03:30
hkalbasi
6d2d1387af
Fix some unsizing problems in mir
2023-06-26 01:57:12 +03:30
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
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
hkalbasi
a481e004b0
Lower const params with a bad id
2023-06-11 00:39:28 +03:30
hkalbasi
aab7589c40
Fix string pattern matching in mir interpreter
2023-06-02 23:45:29 +03:30
hkalbasi
a6a27a7ff8
Support floating point intrinsics in const eval
2023-06-02 17:29:17 +03:30
hkalbasi
51368793b4
MIR episode 6
2023-05-28 23:25:15 +03:30
Lukas Wirth
c7ef6c25b7
internal: Replace Display impl for Name
2023-05-24 20:55:12 +02:00
hkalbasi
92d6670f72
Consider block impls in lookup_impl_assoc_item_for_trait_ref
2023-05-20 01:11:17 +03:30