Commit Graph

447 Commits

Author SHA1 Message Date
hkalbasi
eb143383c3 Pass TraitEnvironment into layout_ty and const_eval 2023-07-20 13:08:38 +03:30
hkalbasi
e64a10fc4d Use .kind(Interner) instead of .data(Interner).kind 2023-07-17 20:56:31 +03:30
hkalbasi
832eb0d94c Normalize type alias in projected_ty 2023-07-17 01:16:26 +03:30
hkalbasi
41b8b0b77d Enable cfg miri in analysis 2023-07-14 22:59:46 +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
50559118fb Give real discriminant_type to chalk 2023-07-14 20:15:18 +03:30
hkalbasi
5208bf8f55 implement type_name intrinsic 2023-07-14 16:52:36 +03:30
bors
f6ae0c11ac Auto merge of #15270 - ChristianSchott:patch-1, r=HKalbasi
Make fields of mir::Terminator public

When trying to use the RA crate, I am unable to access the fields in `hir_def::mir::Terminator`.
I don't see any reason, why these should be private, especially as the fields of `hir_def::mir::Statement` are `pub`.

I am not sure if the fields in `hir_def::mir::SwitchTargets` should be made `pub` too, but at least they are read-accessible via some public methods..

Sorry if I missed something, this is my first PR.
2023-07-13 07:54:44 +00:00
bors
d16d5fcf68 Auto merge of #15268 - HKalbasi:mir, r=HKalbasi
Add write_bytes and ctlz intrinsics
2023-07-12 23:19:30 +00:00
ChristianSchott
8f612b5352
Make fields of mir::Terminator public 2023-07-12 09:35:44 +02: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
42d35f8af9 Fix missing terminator in pattern matching of consts 2023-07-10 01:01:59 +03:30
hkalbasi
aa52cbf784 Support read_via_copy intrinsic 2023-07-09 23:17:51 +03:30
hkalbasi
f0ba0dbe8a Use debug impl in rendering const eval result 2023-07-08 01:07:38 +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
bors
4125fea0a7 Auto merge of #15222 - HKalbasi:mir, r=HKalbasi
Fix size_of_val and support min_align_of_val
2023-07-06 12:40:21 +00:00
hkalbasi
171ae2ee5d Fix size_of_val and support min_align_of_val 2023-07-06 15:41:52 +03:30
Ryo Yoshida
827a0530bc
Don't show unresolved-field diagnostic for missing names 2023-07-06 20:39:48 +09:00
bors
e219999a17 Auto merge of #15211 - lowr:patch/gats-in-bounds-for-assoc, r=flodiebold
Support GATs in bounds for associated types

Chalk has a dedicated IR for bounds on trait associated type: `rust_ir::InlineBound`. We have been failing to convert GATs inside those bounds from our IR to chalk IR. This PR provides an easy fix for it: properly take GATs into account during the conversion.
2023-07-04 15:36:16 +00:00
Ryo Yoshida
9fd5f8c670
Support GATs in bounds for associated types 2023-07-04 18:58:19 +09:00
bors
45272efec5 Auto merge of #14990 - HKalbasi:diagnostic-map, r=HKalbasi
Map our diagnostics to rustc and clippy's ones

And control their severity by lint attributes `#[allow]`, `#[deny]` and ... .

It doesn't work with proc macros and I would like to fix that before merge but I don't know how to do it.
2023-07-03 18:58:47 +00:00
bors
daba334611 Auto merge of #15206 - Veykril:let-else-fmt, r=Veykril
internal: Format let-else

As nightly finally got support for it I went ahead and formatted r-a with the latest nightly, then with the latest stable (in case other stuff changed)
2023-07-03 18:41:59 +00:00
Lukas Wirth
69cd3c30ac Format let-else 2023-07-03 20:34:09 +02:00
bors
5703346523 Auto merge of #15118 - alexkirsz:alexkirsz/resolve-deref-raw, r=Veykril
Follow raw pointers in autoderef chain when resolving methods with custom receiver

Fixes #15083

I believe this stopped working after e797479651
2023-07-03 14:55:08 +00:00
Ryo Yoshida
6086ced61d Revert "Support #[rustc_coinductive]"
This reverts commit d026479ba6.
2023-07-03 05:06:55 +09:00
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
bb85a980e0 Bump chalk 2023-06-30 23:36:47 +03:30
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
hkalbasi
302bb3c871 Fix data layout of reference to nested unsized structs 2023-06-29 23:38:13 +03:30
Ryo Yoshida
4e793e7859
Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
hkalbasi
2272803330 Fix realloc problem in allocating smaller amounts 2023-06-29 17:28:48 +03:30
bors
021604431c Auto merge of #15125 - lowr:patch/rustc_coinductive, r=Veykril
internal: support `#[rustc_coinductive]`

rust-lang/rust#100386 changed the trait solver so that `Sized` is treated as coinductive trait, just like auto traits. This is now controlled by the perma-unstable `#[rustc_coinductive]` attribute (rust-lang/rust#108033), which this PR adds support for.

In practice, I don't think this matters much if at all. Currently we don't give chalk enough information so chalk cannot precisely (dis)prove `Sized` bounds.
2023-06-28 10:13:31 +00:00
hkalbasi
6d2d1387af Fix some unsizing problems in mir 2023-06-26 01:57:12 +03:30
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
Alex Kirszenberg
5991f0d869 Follow raw pointers in autoderef chain when resolving methods with custom receiver 2023-06-23 15:35:41 +02:00
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
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
David Lattimore
bea3a33d84 Change in-tree libs to workspace dependencies 2023-06-20 13:53:39 +10:00
Lukas Wirth
9476fdaaa9 HIR ExternCrateDecl 2023-06-19 14:15:08 +02: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
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
Lukas Wirth
c3186202a2 Shrink size of hir::Binding 2023-06-18 12:03:04 +02:00
hkalbasi
527dfede48 Support Pointee trait 2023-06-16 16:43:43 +03:30