Commit Graph

220424 Commits

Author SHA1 Message Date
bors
7c05f55f0c Auto merge of #13789 - feniljain:fix_enum_completion, r=Veykril
feat: show only missing variant suggestion for enums in patterns completion and bump them in list too

Fixes #12438

### Points to help in review:

- This PR can be reviewed commit wise, first commit is about bumping enum variant completions up in the list of completions and second commit is about only showing enum variants which are not complete
- I am calculating missing variants in analysis.rs by firstly locating the enum and then comparing each of it's variant's name and checking if arm string already contains that name, this is kinda hacky but I didn't want to implement complete missing_arms assist here as that would have been too bulky to run on each completion cycle ( if we can improve this somehow would appreciate some inputs on it )

### Output:

https://user-images.githubusercontent.com/49019259/208245540-57d7321b-b275-477e-bef0-b3a1ff8b7040.mov

Relevant Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Issue.20.2312438
2023-03-18 07:06:27 +00:00
feniljain
a79a76a942 refactor: pass is_variant_missing as args to build_completion 2023-03-18 11:46:22 +05:30
Andre Bogus
27e9ee9bae move Option::as_slice to intrinsic 2023-03-18 07:15:15 +01:00
feniljain
f7113685b5 fix: make tests valid rust code 2023-03-18 11:43:45 +05:30
Joshua Nelson
675c4aa2c1 address review comments 2023-03-18 00:43:37 -05:00
Joshua Nelson
3a58b2b3b0 Let tidy use more threads
This has a significant speedup for me locally, from about 1.3 seconds to
.9 seconds.
2023-03-18 00:38:17 -05:00
Joshua Nelson
19b272a94b Use a single WalkBuilder for multiple paths 2023-03-18 00:38:17 -05:00
Joshua Nelson
d26a15563d Make ui_tests non-quadratic
Previously, it would walk each directory twice: once in the main `Walk`
iterator, and once to count the number of entries in the directory. Now
it only walks each directory once.
2023-03-18 00:38:17 -05:00
Joshua Nelson
9b606a3203 Speed up file walking in tidy
- Skip files in `skip` wherever possible to avoid reading their contents
- Don't look for `tidy-alphabetic-start` in tests. It's never currently used and slows the check down a lot.
- Add new `filter_not_rust` helper function
2023-03-18 00:38:17 -05:00
Joshua Nelson
c76e260fa7 Use named threads in tidy
This makes it easier to profile.
2023-03-18 00:38:16 -05:00
Gus Caplan
3ae03c7aee review 2023-03-17 21:00:10 -07:00
Gus Caplan
d1712f49d7 move default backtrace setting to sys 2023-03-17 20:59:28 -07:00
John Millikin
a3f3db842d Stabilise unix_socket_abstract
Fixes https://github.com/rust-lang/rust/issues/85410
2023-03-18 12:32:09 +09:00
Ezra Shaw
0dc36fcd5b
fix: don't suggest similar method when unstable 2023-03-18 16:19:00 +13:00
bors
85123d2504 Auto merge of #109284 - matthiaskrgr:rollup-aaublsx, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #109102 (Erase escaping late-bound regions when probing for ambiguous associated types)
 - #109200 (Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer`)
 - #109211 (E0206 - update description )
 - #109222 (Do not ICE for unexpected lifetime with ConstGeneric rib)
 - #109235 (fallback to lstat when stat fails on Windows)
 - #109248 (Pass the right HIR back from `get_fn_decl`)
 - #109251 (Suggest surrounding the macro with `{}` to interpret as a statement)
 - #109256 (Check for llvm-tools before install)
 - #109257 (resolve: Improve debug impls for `NameBinding`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-18 03:16:32 +00:00
Scott McMurray
35088797ae Use size_of_val instead of manual calculation
Very minor thing that I happened to notice in passing, but it's both shorter and means it gets `mul nuw`, so why not.
2023-03-17 19:55:49 -07:00
Matthias Krüger
0d4a56cc21
Rollup merge of #109257 - petrochenkov:bindebug, r=WaffleLapkin
resolve: Improve debug impls for `NameBinding`

Print at least the Some/None/Ok/Err status of the nested bindings if not the bindings themselves.
Noticed while reviewing https://github.com/rust-lang/rust/pull/108729.
2023-03-18 00:05:55 +01:00
Matthias Krüger
01edab6024
Rollup merge of #109256 - chaitanyav:fix_108948, r=albertlarsan68
Check for llvm-tools before install

Fixes #108948
````@jpalus```` Please review
2023-03-18 00:05:55 +01:00
Matthias Krüger
7e5705e5c6
Rollup merge of #109251 - MU001999:master, r=Nilstrieb
Suggest surrounding the macro with `{}` to interpret as a statement

Fixes #109237
2023-03-18 00:05:54 +01:00
Matthias Krüger
d91858b080
Rollup merge of #109248 - compiler-errors:get_fn_decl-aaa, r=WaffleLapkin
Pass the right HIR back from `get_fn_decl`

Fixes #109232

Makes sure that the `fn_id: HirId` that we pass to `suggest_missing_return_type` matches up with the `fn_decl: hir::FnDecl` that we pass to it, so the late-bound vars that we fetch from the former match up with the types in the latter...

This HIR suggestion code really needs a big refactor. I've tried to do it in the past (a couple of attempts), but it's a super tangled mess. It really shouldn't be passing around things like `hir::Node` and just deal with `LocalDefId`s everywhere... Anyways, I'd rather fix this ICE, now.
2023-03-18 00:05:54 +01:00
Matthias Krüger
2a3c0e34cb
Rollup merge of #109235 - chaitanyav:master, r=ChrisDenton
fallback to lstat when stat fails on Windows

Fixes #109106
````@ChrisDenton```` please let me know if this is the expected behavior for stat on windows
2023-03-18 00:05:53 +01:00
Matthias Krüger
dfd2b6493a
Rollup merge of #109222 - chenyukang:yukang/fix-109143, r=petrochenkov
Do not ICE for unexpected lifetime with ConstGeneric rib

Fixes #109143
r? ````@petrochenkov````

Combining this test with the previous test will affect the previous diagnostics, so I added a separate test case.
2023-03-18 00:05:53 +01:00
Matthias Krüger
e7d6369ed4
Rollup merge of #109211 - mili-l:mili_l/update_e0206_description, r=WaffleLapkin
E0206 - update description

added `union` to description
2023-03-18 00:05:52 +01:00
Matthias Krüger
55d5cd5e95
Rollup merge of #109200 - compiler-errors:issue-109191, r=WaffleLapkin
Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer`

Fixes #109191
2023-03-18 00:05:52 +01:00
Matthias Krüger
0ee7539e96
Rollup merge of #109102 - compiler-errors:ambig-assoc-in-non-lt-binder, r=jackh726
Erase escaping late-bound regions when probing for ambiguous associated types

Fixes #109090
2023-03-18 00:05:52 +01:00
Santiago Pastorino
640c20272e
Fix generics_of for impl's RPITIT synthesized associated type 2023-03-17 20:01:57 -03:00
Michael Howell
8628e27da3 rustdoc: reduce allocations in visibility_to_src_with_space 2023-03-17 15:43:01 -07:00
onestacked
7bc67ef6e0 Make the Step implementations const. 2023-03-17 23:04:54 +01:00
Michael Goulet
6639538575 Remove VecMap 2023-03-17 20:49:28 +00:00
Santiago Pastorino
9139ed076d
Fix impl_trait_ty_to_ty substs 2023-03-17 16:28:00 -03:00
Santiago Pastorino
e0302bbc3b
Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed tests 2023-03-17 16:01:53 -03:00
bors
13afbdaa06 Auto merge of #108862 - Mark-Simulacrum:bootstrap-bump, r=pietroalbini
Bump bootstrap compiler to 1.69 beta

r? `@pietroalbini`
2023-03-17 19:00:38 +00:00
The 8472
7cce618d18 Fast path that skips over unchanged obligations in process_obligations
- only borrow the refcell once per loop
- avoid complex matches to reduce branch paths in the hot loop
- use a by-ref fast path that avoids mutations at the expense of having false negatives
2023-03-17 19:56:03 +01:00
Santiago Pastorino
ae7fa1d269
Add generic parameters mismatch test for async in traits 2023-03-17 15:45:57 -03:00
Santiago Pastorino
c7cc1c7442
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty 2023-03-17 15:36:02 -03:00
Maybe Waffle
c2ccdfa198 Switch impls of is_sorted_by between slices and slice iters
This makes a bit more sense — iter impl converts to slice first, while
slice impl used to create iter, doing unnecessary conversions.
2023-03-17 18:10:21 +00:00
Maybe Waffle
0d53565b60 Make slice::is_sorted_by impl nicer 2023-03-17 18:04:56 +00:00
NagaChaitanya Vellanki
32c589b236 Modify code style as per comments 2023-03-17 10:44:22 -07:00
Guillaume Gomez
e9f29c4016 Add regression test for #109258 2023-03-17 17:04:23 +01:00
Joshua Nelson
c7eccdaaee Use python3.11 in CI to make sure toml is validated
This also fixes a regression from
https://github.com/rust-lang/rust/pull/106085 which stopped testing that
we support python2 in PR CI.
2023-03-17 10:52:51 -05:00
klensy
433d243c6e extra_info_tags don't return string, use display_fn 2023-03-17 18:52:36 +03:00
Michael Goulet
08c913279f Pass the right HIR back from get_fn_decl 2023-03-17 15:39:05 +00:00
Michael Goulet
79ad7cca45 Erase escaping late-bound regions when probing for ambiguous associated types 2023-03-17 15:33:24 +00:00
Joshua Nelson
d808bc296d Add tests for configure.py
- Separate out functions so that each unit test doesn't create a file on disk
- Add a few unit tests

Notably, verifying that we generate valid toml relies on python 3.11 so
we can use `tomllib`.
2023-03-17 10:24:40 -05:00
Boxy
b85bc19705 move compute_goal and evaluate_x methods to inner module 2023-03-17 15:02:24 +00:00
bors
03b01c5bec Auto merge of #109253 - matthiaskrgr:rollup-2xmv5zk, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108958 (Remove box expressions from HIR)
 - #109044 (Prevent stable `libtest` from supporting `-Zunstable-options`)
 - #109155 (Fix riscv64 fuchsia LLVM target name)
 - #109156 (Fix linker detection for clang with prefix)
 - #109181 (inherit_overflow: adapt pattern to also work with v0 mangling)
 - #109198 (Install projection from RPITIT to default trait method opaque correctly)
 - #109215 (Use sort_by_key instead of sort_by)
 - #109229 (Fix invalid markdown link references)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-17 14:56:30 +00:00
Jamilya Shurukhova
c4bb47ac36
Update compiler/rustc_error_codes/src/error_codes/E0206.md
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2023-03-17 15:50:37 +01:00
Vadim Petrochenkov
5e0fc0459e rustdoc: Correctly merge import's and its target's docs in one more case 2023-03-17 18:46:27 +04:00
Boxy
9df35a5050 fix bad assertion 2023-03-17 14:40:21 +00:00
Boxy
e624ef4d64 replace chain with two add_goal 2023-03-17 14:35:12 +00:00