Commit graph

152 commits

Author SHA1 Message Date
Ryo Yoshida
e9f14c505f
Remove TypeWalk and use TypeFlags instead 2023-01-24 19:44:58 +09:00
Lukas Wirth
f8ed4d7ae4 Use lang item resolution instead of known paths 2023-01-21 19:03:36 +01:00
Lukas Wirth
1535881836 Replace SmolStr usage with lang item enum for lang items 2023-01-21 17:55:45 +01:00
Laurențiu Nicola
392a6ee422 Bump once_cell 2023-01-21 08:48:46 +02:00
Lukas Wirth
384fa4b84a fix: Fix target-data-layout fetching incorrectly passing 'rustc' to rustc 2023-01-19 21:31:08 +01:00
Ryo Yoshida
c53064fb58
Enforce builtin binop expectations even without lang items 2023-01-17 20:17:15 +09:00
Ryo Yoshida
461435adab
Enforce builtin binop expectations on single references
Also don't enforce them on non-builtin types
2023-01-17 20:17:09 +09: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
bors
62907858d5 Auto merge of #13964 - Veykril:workspace.package, r=Veykril
Specify authors, edition, license and rust-versian via workspace.package
2023-01-17 10:13:24 +00:00
Lukas Wirth
bed4db3c62 Use workspace.dependencies to declare local dependencies 2023-01-17 10:52:26 +01:00
hkalbasi
77efa0267d Don't compute layout if TargetDataLayout is not available 2023-01-16 22:43:27 +03:30
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
8800ea6461 Auto merge of #13950 - WaffleLapkin:iterate_over_arrays_directly, r=Veykril
minor: Iterate over arrays dirrectly, instead of going through a slice

Minor code improvement.
2023-01-14 13:08:36 +00:00
Maybe Waffle
bd04416aaa Iterate over arrays dirrectly, instead of going through a slice 2023-01-14 13:02:28 +00:00
Lukas Wirth
27ba598dfe Make inlay hint location links work for more types 2023-01-14 13:30:56 +01:00
Lukas Wirth
bb4e272d8a Refine search for const and function assoc items 2023-01-11 17:10:04 +01:00
bors
f32f64bffc Auto merge of #13929 - danieleades:simplify, r=lnicola
internal: a number of code simplifications
2023-01-11 09:38:34 +00:00
bors
75877d78d9 Auto merge of #13897 - bvanjoi:nearest-block-search, r=Veykril
fix(ty): should query impls in nearest block

fix https://github.com/rust-lang/rust-analyzer/issues/13895
2023-01-10 22:44:29 +00:00
Daniel Eades
d218b237fd collapse some nested blocks 2023-01-10 20:40:08 +00:00
Daniel Eades
95d14c393c avoid 'cloning' types that implement 'Copy' 2023-01-10 18:20:12 +00:00
bvanjoi
9a15cc81b4 fix(ty): should query impls in nearest block 2023-01-10 10:28:17 +08:00
Lukas Wirth
68723043db Split out hir-def attribute handling parts into hir-expand 2023-01-09 19:29:28 +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
Ryo Yoshida
d01630c8f3
Apply fallback to scalar type variables before final obligation resolution 2023-01-06 06:07:08 +09:00
Ryo Yoshida
b183612610
Add INTEGER and FLOAT flags for type variables 2023-01-05 23:10:06 +09:00
Ryo Yoshida
1bfc732b78
Store diverging flag for type variables as bitflags 2023-01-05 23:10:00 +09:00
Lukas Wirth
b996a54cd8 Skip lifetime elision on fn pointers and fn trait types 2023-01-03 11:58:31 +01:00
Lukas Wirth
f51111aacb Write down adjustments introduced by binary operators 2023-01-02 23:16:09 +01:00
Daniel Eades
bb083b8202 remove useless casts 2023-01-02 15:02:54 +00:00
Daniel Eades
4f8ffd0ba4 remove unnecessary lifetimes that can be elided 2023-01-02 15:02:54 +00:00
Daniel Eades
efd2c20e96 remove useless conversions 2023-01-02 15:02:54 +00:00
Daniel Eades
cc80c5bd07 remove unnecessary lazy evaluations 2023-01-02 15:02:54 +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
Lukas Wirth
eee7de0225 Diagnose private assoc item accesses 2023-01-01 13:24:48 +01:00
Lukas Wirth
e3d144d17f Diagnose private field accesses 2022-12-31 14:20:59 +01:00
Lukas Wirth
1d782a9095 Add test for private method inference fallback 2022-12-31 11:42:44 +01:00
Lukas Wirth
5d54c550e7 Fallback to invisible associated functions and constants if no visible resolutions are found 2022-12-30 23:56:08 +01:00
bors
0d76b94c90 Auto merge of #13866 - Nilstrieb:rustc_safe_intrinsic, r=Veykril
Use `rustc_safe_intrinsic` attribute to check for intrinsic safety

Instead of maintaining a list that is poorly kept in sync we can just use the attribute.

This will make new RA versions unusable with old toolchains that don't have the attribute yet. Should we keep maintaining the list as a fallback or just don't care?
2022-12-30 22:14:31 +00:00
bors
20b0ae4afe Auto merge of #13857 - WaffleLapkin:yeet, r=Veykril
feat: Implement yeeting

See tracking issue: https://github.com/rust-lang/rust/issues/96373

Before:
![2022-12-29_03-19](https://user-images.githubusercontent.com/38225716/209884634-e34e98fb-615d-4954-9614-7f9ce6291678.png)
After:
![2022-12-29_03-21](https://user-images.githubusercontent.com/38225716/209884633-4bba5eba-6dcc-4714-86cb-5c0d1f358364.png)
2022-12-30 21:48:23 +00:00
Nilstrieb
72afcf2cad Use rustc_safe_intrinsic attribute to check for intrinsic safety
Instead of maintaining a list that is poorly kept in sync we can just
use the attribute.
2022-12-30 20:29:37 +01:00
Maybe Waffle
346bf5fb5b Implement do yeet expression 2022-12-28 23:17:13 +00:00
Maybe Waffle
aaa682c534 Implement try{} block type inference 2022-12-28 21:25:47 +00:00
Maybe Waffle
eecab99dec Allow break and co to go through try{} blocks 2022-12-28 20:56:58 +00:00
Maybe Waffle
16264a3a53 fixup a doc comment 2022-12-28 20:43:12 +00:00
bors
74ae2dd303 Auto merge of #13840 - lowr:fix/hir-callable-sig-escaping-boundvars, r=lowr
fix: handle lifetime variables in `CallableSig` query

Fixes #13838

The problem is similar to #13223: we've been skipping non-empty binders, letting lifetime bound variables escape.

I ended up refactoring `hir_ty::callable_sig_from_fnonce()`. Like #13223, I chose to make use of `InferenceTable` which is capable of handling variables (I feel we should always use it when we solve trait-related stuff instead of manually building obligations/queries).

I couldn't make up a test that crashes without this patch (since the function I'm fixing is only used *outside* `hir-ty`, simple `hir-ty` test wouldn't cause crash), but at least I tested with my local build and made sure it doesn't crash with the code in the original issue. I'd appreciate any help to find a regression test.
2022-12-25 14:53:16 +00:00
Ryo Yoshida
a639917b66
fix: handle lifetime variables in CallableSig query 2022-12-25 05:07:44 +09: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
Yuri Astrakhan
1d59c7b667 Remove non-needed clones
I am not certain if this will improve performance,
but it seems having a .clone() without any need should be removed.

This was done with clippy, and manually reviewed:

```
cargo clippy --fix -- -A clippy::all -D clippy::redundant_clone
```
2022-12-23 02:20:03 -05:00