aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-052-2/+7
|\ | | | | | | | | | | | | | | 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-052-2/+7
| |
* | 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-292-7/+51
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 4652: Upgrade Chalk r=kjeremy a=flodiebold Fixes #4072. Co-authored-by: Florian Diebold <[email protected]>
| * | Upgrade ChalkFlorian Diebold2020-05-292-7/+51
| |/ | | | | | | Fixes #4072.
* / Support raw_ref_op's raw reference operatorrobojumper2020-05-284-22/+70
|/
* Merge #4641bors[bot]2020-05-284-55/+54
|\ | | | | | | | | | | | | | | | | 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-274-55/+54
| | | | | | | | | | 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
|
* Use TypeCtorId as AdtId directly, and rename the type alias StructId -> AdtIdFlorian Diebold2020-05-225-14/+14
|
* Split up chalk module a bitFlorian Diebold2020-05-223-958/+982
|
* Add some tests for Chalk built-in trait implsFlorian Diebold2020-05-221-0/+78
|
* Provide Chalk well-known traitsFlorian Diebold2020-05-221-6/+33
|
* Use Chalk's built-in representations of primitive typesFlorian Diebold2020-05-221-10/+160
| | | | For references, we make sure Chalk actually gets a lifetime here.
* Update ChalkFlorian Diebold2020-05-223-52/+81
| | | | | As always, this just makes compilation work, we don't use the newly available functionality yet.
* Switch to new magic marksAleksey Kladov2020-05-2012-42/+28
|
* Apply suggestion of @flodiebold: Get rid of multiple unwrapsRoland Ruckerbauer2020-05-191-12/+10
|
* loop return value inference: add testsRoland Ruckerbauer2020-05-191-0/+63
|
* Move false negative expr_diverges_missing_arm() to working testsRoland Ruckerbauer2020-05-191-21/+18
|
* loop return value inference: coerce_merge branchesRoland Ruckerbauer2020-05-191-15/+23
|
* Infer return type of loops with value breaks.Roland Ruckerbauer2020-05-182-6/+16
|
* Merge #4497bors[bot]2020-05-181-0/+31
|\ | | | | | | | | | | | | | | | | | | | | | | 4497: Create LowerCtx on the fly r=matklad a=edwin0cheng Previously we create `LowerCtx` at the beginning of lowering, however, the hygiene content is in fact changing between macro expression expanding. This PR change it to create the `LowerCtx` on the fly to fix above bug. However, #4465 is not fixed by this PR, the goto-def is still not work yet. It only fixed the infer part. Co-authored-by: Edwin Cheng <[email protected]>
| * Create LowerCtx on the flyEdwin Cheng2020-05-171-0/+31
| |
* | Add more tests for Fn traitsHrvoje Ban2020-05-181-0/+132
| |
* | Allow calling dyn trait super trait methods without the super trait in scopeFlorian Diebold2020-05-163-15/+40
|/ | | | | This also removes some vestiges of the old impl trait support which I think aren't currently in use.
* Chalk upgradeFlorian Diebold2020-05-162-22/+41
|
* Handle `Self` in values and patternsFlorian Diebold2020-05-154-14/+183
| | | | | | | | | I.e. - `Self(x)` or `Self` in tuple/unit struct impls - `Self::Variant(x)` or `Self::Variant` in enum impls - the same in patterns Fixes #4454.
* Adds a param_idx helperFedor Sakharov2020-05-141-0/+5
|
*-. Merge #4394 #4414bors[bot]2020-05-101-2/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4394: Simplify r=matklad a=Veetaha 4414: Highlighting improvements r=matklad a=matthewjasper - `static mut`s are highlighted as `mutable`. - The name of the macro declared by `macro_rules!` is now highlighted. Co-authored-by: veetaha <[email protected]> Co-authored-by: Matthew Jasper <[email protected]>
| | * Highlight mutable statics as mutableMatthew Jasper2020-05-101-2/+6
| | |
* | | Omit default types in HirDisplay SourceCode modeTimo Freiberg2020-05-102-27/+63
| | |
* | | infer: Make expected rhs type for plain assign the lhs typeEmil Lauridsen2020-05-102-1/+31
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where the following code sample would fail to infer the type contained in the option: ```rust fn main() { let mut end = None; // TODO: Fix inference for this in RA loop { end = Some(true); } } ```