Lukas Wirth
498f39eae2
fix: Diagnose everything in nested items, not just def diagnostics
2023-11-15 10:34:09 +01:00
Lukas Wirth
6ddccc9a6e
Diagnose some orphan trait impl cases
2023-11-14 18:09:34 +01:00
Lukas Wirth
b74015512d
Remove UserError from LayoutError
2023-11-14 13:32:04 +01:00
Lukas Wirth
e844784d8d
Simplify
2023-11-14 12:53:14 +01:00
Lukas Wirth
ba61766217
Add config for preferring / ignoring prelude modules in find_path
2023-11-11 14:56:38 +01:00
hkalbasi
3bcdb7d886
Truncate closure capture place for raw pointer
2023-11-09 20:59:17 +03:30
cui fliter
9c99afe3aa
Fix some typos
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-30 10:31:50 +08:00
hkalbasi
8b82ea4f51
Store binding mode for each instance independently
2023-10-22 23:35:33 +03:30
bors
bd38871a98
Auto merge of #15736 - rmehri01:15678_module_incorrect_case_diagnostics, r=HKalbasi
...
fix: add incorrect case diagnostics for module names
Adds diagnostics for checking both inline and file module names are snake case.
Closes #15678
2023-10-20 16:20:40 +00:00
Lukas Wirth
40acc5250f
Update rustc_abi dependency
2023-10-15 18:57:40 +02:00
Christian Schott
8217ff9c16
make ProjectionStore-impls pub-accessible
2023-10-14 19:20:11 +02:00
Ryan Mehri
36eac9abee
fix: add incorrect case diagnostics for module names
2023-10-09 13:36:39 -07:00
bors
ab62c0186f
Auto merge of #15696 - rmehri01:14293_tuple_return_type_to_struct, r=Veykril
...
feat: implement tuple return type to tuple struct assist
This PR implements the `convert_tuple_return_type_to_struct` assist, for converting the return type of a function or method from a tuple to a tuple struct. Additionally, it moves the `to_camel_case` and `char_has_case` functions from `case_conv` to `stdx` so that they can be used similar to `to_lower_snake_case`.
[tuple_return_type_to_tuple_struct.webm](https://github.com/rust-lang/rust-analyzer/assets/52933714/2803ff58-fde3-4144-9495-7c7c7e139075 )
Currently, the assist puts the struct definition above the function, or above the nearest `impl` or `trait` if applicable and only rewrites literal tuples that are returned in the body of the function. Additionally, it only attempts to rewrite simple tuple pattern usages with the corresponding tuple struct pattern but does so across files and modules.
I think that this is sufficient for the majority of use cases but I could be wrong. One thing I'm still not sure how to approach is handling `Self` and generics/lifetimes in the tuple type to be extracted. I was thinking of either manually figuring out what lifetimes and generics are in scope and using them (sort of similar to the `generate_function` assist) or maybe using `ctx.sema.resolve_type` and `generic_params` on `hir::Type` but this seems to not deal with lifetimes.
Closes #14293
2023-10-09 08:14:42 +00:00
Lukas Wirth
88a00bf49d
Shrink PatPtr by swapping its AstPtr and Either wrap order
2023-10-06 12:32:37 +02:00
Tobias Berger
114f8a07e9
Fix typos exec_intrinsic
2023-10-06 09:24:28 +02:00
Laurențiu Nicola
084ee934b8
Strip base prefix in layout_scalar_valid_range
2023-10-02 10:47:18 +03:00
Ryan Mehri
40f80e29a5
move to_camel_case
and char_has_case
from case_conv to stdx
2023-09-30 08:04:04 -07:00
Lukas Wirth
a943b19e08
Make rustc_layout_scalar_valid_range attributes work for non-decimal literals
2023-09-29 15:30:47 +02:00
hkalbasi
ab52ba2de7
Fix unused_variables in tests
2023-09-24 23:45:36 +03:30
hkalbasi
7834b8fadb
Add unused_variables
native diagnostic
2023-09-24 21:29:15 +03:30
Wilfred Hughes
3a63255d2a
Update chalk version
2023-09-19 16:56:59 -07:00
bors
22b18b9f77
Auto merge of #15616 - HKalbasi:rustc-deps, r=HKalbasi
...
Switch to in-tree rustc dependencies with a cfg flag
We can use this flag to detect and prevent breakages in rustc CI. (see #14846 and #15569 )
~The `IN_RUSTC_REPOSITORY` is just a placeholder. Is there any existing cfg flag that rustc CI sets?~
2023-09-19 17:41:12 +00:00
jDomantas
a961068504
add layout test
2023-09-17 17:00:57 +03:00
jDomantas
a0c31b73d8
don't skip the rest of the block after let-else
2023-09-17 12:46:41 +03:00
hkalbasi
f4704bc8ae
Switch to in-tree rustc dependencies with a cfg flag
2023-09-15 18:10:11 +03:30
Lukas Wirth
affe5a7315
fix: Temporarily skip decl check in derive expansions
2023-09-12 23:10:03 +02:00
Lukas Wirth
ccff704c25
Shrink some stuff
2023-09-10 08:24:26 +02:00
Lukas Wirth
8f5fee4a5a
Diagnose incorrect and private fields in record structs
2023-09-09 10:45:29 +02:00
Lukas Wirth
55c75450fb
Diagnose private fields in record constructor
2023-09-08 23:19:30 +02:00
Lukas Wirth
8654a098c7
Diagnose mismatched arg count for tuple struct patterns
2023-09-08 14:54:43 +02:00
bors
548d2f08e0
Auto merge of #15575 - HKalbasi:mir, r=HKalbasi
...
Intern projections in mir place
I hope this reduces mir memory usage.
2023-09-08 09:28:46 +00:00
hkalbasi
9708a29e57
Intern projections in mir place
2023-09-08 12:39:41 +03:30
Lukas Wirth
cd53bd6b8e
Remove allocation on mir eval memory write
2023-09-07 18:41:50 +02:00
Lukas Wirth
10b0cd7047
Replace format-args parser with upstream fork
2023-09-07 11:37:59 +02:00
Lukas Wirth
f13b184eb3
Implement write_via_move
intrinsic for mir-eval
2023-09-06 21:49:16 +02:00
Lukas Wirth
5fdd1e36e3
Remove todo!()
s
2023-09-06 15:30:44 +02:00
Lukas Wirth
e243a03da1
Desugar builtin#format_args
2023-09-06 15:21:41 +02:00
Lukas Wirth
abe8f1ece4
Implement builtin#format_args, using rustc's format_args parser
2023-09-05 19:19:46 +02:00
Lukas Wirth
3431d586e5
Insert builtin#asm into asm! expansion
2023-09-05 14:00:49 +02:00
Lukas Wirth
15048304e3
Implement offset_of in hir-def and hir-ty
2023-09-05 12:27:52 +02:00
Lukas Wirth
9b8eb807a3
Parse builtin# syntax
2023-09-05 10:36:35 +02:00
Lukas Wirth
0bf0563a00
Add a few more db.unwind_if_cancelled()
calls
2023-09-02 14:39:19 +02:00
Lukas Wirth
70e21dc30b
Remove some allocations in borrowck
2023-09-01 19:17:57 +02:00
hkalbasi
fa76f60cc1
Run cargo fmt on 1.72
2023-08-25 22:24:41 +03:30
hkalbasi
3864b43d28
Update offset intrinsic to match 1.72
2023-08-25 22:24:40 +03:30
Laurențiu Nicola
30d8aa1bec
Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra
2023-08-21 12:44:09 +03:00
Ralf Jung
883f16d805
fix RA build
2023-08-20 18:31:22 +02:00
Ralf Jung
59f9c95ec0
give some unwind-related terminators a more clear name
2023-08-20 15:52:38 +02:00
Laurențiu Nicola
aa55ce9567
Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-ra
2023-08-07 12:03:15 +03:00
Laurențiu Nicola
0155385b57
Merge commit '99718d0c8bc5aadd993acdcabc1778fc7b5cc572' into sync-from-ra
2023-07-24 12:21:34 +03:00