aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge #4958bors[bot]2020-06-204-24/+312
|\ | | | | | | | | | | | | | | | | 4958: Infer FnSig via Fn traits r=flodiebold a=adamrk Addresses https://github.com/rust-analyzer/rust-analyzer/issues/4481. When inferring types check if the callee implements one of the builtin `Fn` traits. Also autoderef the callee before trying to figure out it's `FnSig`. Co-authored-by: adamrk <[email protected]>
| * Push obligation instead of matching on solutionadamrk2020-06-202-45/+40
| |
| * Get Output assoc type by nameadamrk2020-06-201-13/+3
| |
| * Add test for dyn Fn Outputadamrk2020-06-201-0/+68
| |
| * move tests to ra_hir_tyadamrk2020-06-201-0/+155
| |
| * Fixes to callable_sig_from_fn_traitadamrk2020-06-201-65/+65
| |
| * Make get_fn_trait a method of FnTraitadamrk2020-06-203-21/+21
| |
| * Switch back callable_sig for known fn typesadamrk2020-06-202-4/+4
| |
| * Infer FnSig from Fn traitsadamrk2020-06-194-18/+98
| |
* | Shift bound variables correctly when using assoc type shorthandFlorian Diebold2020-06-192-0/+94
| | | | | | | | | | Fixes #4885. Fixes #4800.
* | Use correct substs for super trait assoc typesFlorian Diebold2020-06-193-17/+47
|/ | | | | | | | When referring to an associated type of a super trait, we used the substs of the subtrait. That led to the #4931 crash if the subtrait had less parameters, but it could also lead to other incorrectness if just the order was different. Fixes #4931.
* Fix substs in resolve_value_path for ImplSelfVincent Rouillé2020-06-192-1/+33
| | | | Fixes #4953.
* Merge #4851bors[bot]2020-06-191-1/+11
|\ | | | | | | | | | | | | | | | | | | | | | | 4851: Add quickfix to add a struct field r=TimoFreiberg a=TimoFreiberg Related to #4563 I created a quickfix for record literals first because the NoSuchField diagnostic was already there. To offer that quickfix for FieldExprs with unknown fields I'd need to add a new diagnostic (or create a `NoSuchField` diagnostic for those cases) I think it'd make sense to make this a snippet completion (to select the generated type), but this would require changing the `Analysis` API and I'd like some feedback before I touch that. Co-authored-by: Timo Freiberg <[email protected]>
| * Add quickfix to add a struct fieldTimo Freiberg2020-06-121-1/+11
| |
* | Merge #4839bors[bot]2020-06-191-7/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 4839: `Go to Type Definition` hover action. r=matklad a=vsrs ![hover_actions_goto](https://user-images.githubusercontent.com/62505555/83335671-0122e380-a2b7-11ea-9922-fbdcfb11a7f3.gif) This implementation supports things like `dyn Trait<SomeType>`, `-> impl Trait`, etc. Co-authored-by: vsrs <[email protected]>
| * | Apply suggestions from code reviewvsrs2020-06-181-28/+25
| | |
| * | Add Type::walk methodvsrs2020-06-181-0/+52
| | |
| * | Add `Go to Type Definition` hover action.vsrs2020-06-181-3/+3
| | |
* | | Avoid all unchecked indexing in match checkingJonas Schievink2020-06-171-28/+49
|/ /
* | Use ra_fixture and reformat testsJonas Schievink2020-06-161-387/+385
| |
* | Fix index-out-of-bounds panic in match checkingJonas Schievink2020-06-161-2/+26
| |
* | _match.rs: improve comment formattingJonas Schievink2020-06-141-113/+142
|/
* Make known paths use `core` instead of `std`Jonas Schievink2020-06-114-28/+32
|
* Make relevant_crates return a SetAleksey Kladov2020-06-111-1/+2
|
* Clean up handling of int/float literal typesFlorian Diebold2020-06-066-104/+33
| | | | | | 'Unknown' int/float types actually never exist as such, they get replaced by type variables immediately. So the whole `Uncertain<IntTy>` thing was unnecessary and just led to a bunch of match branches that were never hit.
* Fix type parameter defaultsFlorian Diebold2020-06-057-110/+187
| | | | | They should not be applied in expression or pattern contexts, unless there are other explicitly given type args.
* Merge #4761bors[bot]2020-06-051-0/+5
|\ | | | | | | | | | | | | | | 4761: Upgrade Chalk to published version r=matklad a=flodiebold CC @pksunkara Co-authored-by: Florian Diebold <[email protected]>
| * Upgrade Chalk to published versionFlorian Diebold2020-06-051-0/+5
| |
* | Merge #4689bors[bot]2020-06-0510-79/+439
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4689: Implement return position impl trait / opaque type support r=matklad a=flodiebold This is working, but I'm not that happy with how the lowering works. We might need an additional representation between `TypeRef` and `Ty` where names are resolved and `impl Trait` bounds are separated out, but things like inference variables don't exist and `impl Trait` is always represented the same way. Also note that this doesn't implement correct handling of RPIT *inside* the function (which involves turning the `impl Trait`s into variables and creating obligations for them). That intermediate representation might help there as well. Co-authored-by: Florian Diebold <[email protected]> Co-authored-by: Florian Diebold <[email protected]>
| * | Review fixesFlorian Diebold2020-06-053-23/+65
| | |
| * | Implement return position impl trait / opaque type supportFlorian Diebold2020-06-0510-77/+395
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This is working, but I'm not that happy with how the lowering works. We might need an additional representation between `TypeRef` and `Ty` where names are resolved and `impl Trait` bounds are separated out, but things like inference variables don't exist and `impl Trait` is always represented the same way. Also note that this doesn't implement correct handling of RPIT *inside* the function (which involves turning the `impl Trait`s into variables and creating obligations for them). That intermediate representation might help there as well.
* / Minimize FileLoader interfaceAleksey Kladov2020-06-051-10/+1
|/
* More direct signature for resolve_pathAleksey Kladov2020-06-051-2/+2
|
* Rename resolve_relative_path -> resolve_pathAleksey Kladov2020-06-051-6/+2
| | | | For things like `concant!(env!("OUT_DIR"))`, we need to support abs paths
* correctly infer labelled breaksrobojumper2020-05-313-26/+50
|
* labelled break testrobojumper2020-05-311-0/+54
|
* Merge #4653bors[bot]2020-05-302-5/+61
|\ | | | | | | | | | | | | | | 4653: Fix match ergonomics in closure parameters r=matklad a=flodiebold Fixes #4476. Co-authored-by: Florian Diebold <[email protected]>
| * Fix match ergonomics in closure parametersFlorian Diebold2020-05-292-5/+61
| | | | | | | | Fixes #4476.
* | Merge #4651bors[bot]2020-05-292-4/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4651: Use first match branch in case of type mismatch, not last r=kjeremy a=flodiebold The comment says this was intentional, but I do agree with #4304 that it makes more sense the other way around (for if/else as well). Fixes #4304. Co-authored-by: Florian Diebold <[email protected]>
| * | Use first match branch in case of type mismatch, not lastFlorian Diebold2020-05-292-4/+2
| | | | | | | | | | | | | | | | | | | | | The comment says this was intentional, but I do agree with #4304 that it makes more sense the other way around (for if/else as well). Fixes #4304.
* | | Merge #4652bors[bot]2020-05-291-5/+49
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 4652: Upgrade Chalk r=kjeremy a=flodiebold Fixes #4072. Co-authored-by: Florian Diebold <[email protected]>
| * | Upgrade ChalkFlorian Diebold2020-05-291-5/+49
| |/ | | | | | | Fixes #4072.
* / Support raw_ref_op's raw reference operatorrobojumper2020-05-284-22/+70
|/
* Merge #4641bors[bot]2020-05-283-52/+52
|\ | | | | | | | | | | | | | | | | 4641: Upgrade Chalk r=matklad a=flodiebold Chalk newly added TypeName::Never and Array; I implemented the conversion for Never, but not Array since that expects a const argument. Co-authored-by: Florian Diebold <[email protected]>
| * Upgrade ChalkFlorian Diebold2020-05-273-52/+52
| | | | | | | | | | Chalk newly added TypeName::Never and Array; I implemented the conversion for Never, but not Array since that expects a const argument.
* | Fixed missing newline on each field on "Missing structure fields".Cadu2020-05-271-2/+2
|/
* Fix some clippy perf warningsJeremy Kolb2020-05-251-2/+1
|
* Use Chalk's Ty::Function for function pointer typesFlorian Diebold2020-05-222-8/+51
| | | | | | Function pointers can be 'higher-ranked' over lifetimes, which is why they're not an application type in Chalk, but since we don't model lifetimes it doesn't matter for us yet.
* Use Chalk's built-in representation of function item typesFlorian Diebold2020-05-227-10/+128
|
* Provide missing Chalk debug methodsFlorian Diebold2020-05-222-0/+112
|